Repository: volcengine/volc-sdk-python Branch: main Commit: 69341c688547 Files: 1547 Total size: 3.6 MB Directory structure: gitextract_wvnpcbki/ ├── .gitignore ├── Changelog ├── LICENSE ├── Open Source Notice.txt ├── README.EN.MD ├── README.md ├── SECURITY.md ├── requirements.txt ├── setup.py └── volcengine/ ├── ApiInfo.py ├── Credentials.py ├── Policy.py ├── ServiceInfo.py ├── ServiceInfoHttps.py ├── __init__.py ├── adblocker/ │ ├── AdBlockerService.py │ └── __init__.py ├── auth/ │ ├── MetaData.py │ ├── SignParam.py │ ├── SignResult.py │ ├── SignerV4.py │ └── __init__.py ├── base/ │ ├── Request.py │ ├── Service.py │ ├── __init__.py │ └── models/ │ ├── __init__.py │ ├── base/ │ │ ├── __init__.py │ │ └── base_pb2.py │ └── business/ │ ├── VQScore_pb2.py │ ├── __init__.py │ ├── addr_pb2.py │ ├── deny_config_pb2.py │ ├── domain_pb2.py │ ├── pull_to_push_pb2.py │ ├── record_manage_pb2.py │ ├── relay_source_pb2.py │ ├── snapshot_manage_pb2.py │ └── stream_manage_pb2.py ├── billing/ │ ├── BillingService.py │ └── __init__.py ├── bioos/ │ ├── BioOsService.py │ ├── README.md │ ├── __init__.py │ └── doc/ │ ├── Makefile │ ├── __init__.py │ ├── make.bat │ └── source/ │ ├── __init__.py │ ├── bioos.rst │ ├── conf.py │ └── index.rst ├── business_security/ │ ├── RiskDetectionService.py │ └── __init__.py ├── cdn/ │ ├── __init__.py │ └── service.py ├── code_pipeline/ │ ├── CodePipelineService.py │ └── __init__.py ├── const/ │ ├── Const.py │ └── __init__.py ├── content_security/ │ ├── ContentSecurityService.py │ ├── RcLlmAgentService.py │ └── __init__.py ├── dcdn/ │ ├── DCDNService.py │ └── __init__.py ├── dts/ │ ├── __init__.py │ └── dts_service.py ├── emr/ │ ├── EMRService.py │ └── __init__.py ├── example/ │ ├── DemoSignOnly.py │ ├── __init__.py │ ├── adblocker/ │ │ └── example_adblocker.py │ ├── billing/ │ │ ├── example_list_amortized_cost_bill_detail.py │ │ ├── example_list_amortized_cost_bill_monthly.py │ │ ├── example_list_bill.py │ │ ├── example_list_bill_detail.py │ │ ├── example_list_bill_overview_by_prod.py │ │ └── example_list_split_bill_detail.py │ ├── bioos/ │ │ ├── __init__.py │ │ ├── example_bind_cluster_to_workspace.py │ │ ├── example_cancel_run.py │ │ ├── example_cancel_submission.py │ │ ├── example_create_data_model.py │ │ ├── example_create_data_set.py │ │ ├── example_create_notebook_server_image.py │ │ ├── example_create_submission.py │ │ ├── example_create_workflow.py │ │ ├── example_create_workspace.py │ │ ├── example_dataset.yaml │ │ ├── example_delete_cluster.py │ │ ├── example_delete_data_model_rows_and_headers.py │ │ ├── example_delete_data_set.py │ │ ├── example_delete_notebook_server.py │ │ ├── example_delete_notebook_server_settings.py │ │ ├── example_delete_submission.py │ │ ├── example_delete_workflow.py │ │ ├── example_delete_workspace.py │ │ ├── example_get_api_accesskey.py │ │ ├── example_get_notebook_edit_info.py │ │ ├── example_get_notebook_server_extra_packages.py │ │ ├── example_get_notebook_server_settings.py │ │ ├── example_get_notebook_server_stat.py │ │ ├── example_get_trs_workflow_info.py │ │ ├── example_list_clusters.py │ │ ├── example_list_clusters_of_workspace.py │ │ ├── example_list_data_files.py │ │ ├── example_list_data_model_rows.py │ │ ├── example_list_data_models.py │ │ ├── example_list_data_sets.py │ │ ├── example_list_notebook_server_images.py │ │ ├── example_list_notebook_server_resource_opts.py │ │ ├── example_list_notebook_servers.py │ │ ├── example_list_overview_submissions.py │ │ ├── example_list_runs.py │ │ ├── example_list_submissions.py │ │ ├── example_list_tasks.py │ │ ├── example_list_workflows.py │ │ ├── example_list_workspace_labels.py │ │ ├── example_list_workspaces.py │ │ ├── example_stop_notebook_server.py │ │ ├── example_unbind_cluster_and_workspace.py │ │ ├── example_update_api_accesskey.py │ │ ├── example_update_notebook_server_settings.py │ │ ├── example_update_workflow.py │ │ └── example_update_workspace.py │ ├── business_security/ │ │ └── example_risk_detect.py │ ├── cdn/ │ │ ├── __init__.py │ │ ├── add_cdn_certificate.py │ │ ├── add_cdn_domain.py │ │ ├── add_resource_tags.py │ │ ├── batch_deploy_cert.py │ │ ├── delete_cdn_domain.py │ │ ├── delete_resource_tags.py │ │ ├── describe_accounting_data.py │ │ ├── describe_accounting_summary.py │ │ ├── describe_cdn_access_log.py │ │ ├── describe_cdn_config.py │ │ ├── describe_cdn_data.py │ │ ├── describe_cdn_data_detail.py │ │ ├── describe_cdn_origin_data.py │ │ ├── describe_cdn_region_and_isp.py │ │ ├── describe_cdn_service.py │ │ ├── describe_cdn_upper_ip.py │ │ ├── describe_cert_config.py │ │ ├── describe_content_block_tasks.py │ │ ├── describe_content_quota.py │ │ ├── describe_content_tasks.py │ │ ├── describe_district_isp_data.py │ │ ├── describe_edge_nrt_data_summary.py │ │ ├── describe_edge_statistical_data.py │ │ ├── describe_edge_top_nrt_data.py │ │ ├── describe_edge_top_statistical_data.py │ │ ├── describe_edge_top_status_code.py │ │ ├── describe_ip_info.py │ │ ├── describe_ip_list_info.py │ │ ├── describe_origin_nrt_data_summary.py │ │ ├── describe_origin_top_nrt_data.py │ │ ├── describe_origin_top_status_code.py │ │ ├── list_cdn_cert_info.py │ │ ├── list_cdn_domains.py │ │ ├── list_cert_info.py │ │ ├── list_resource_tags.py │ │ ├── start_cdn_domain.py │ │ ├── stop_cdn_domain.py │ │ ├── submit_block_task.py │ │ ├── submit_preload_task.py │ │ ├── submit_refresh_task.py │ │ ├── submit_unblock_task.py │ │ ├── update_cdn_config.py │ │ └── update_resource_tags.py │ ├── code_pipeline/ │ │ └── example_list_workspaces.py │ ├── content_security/ │ │ └── example_video_risk.py │ ├── dcdn/ │ │ ├── __init__.py │ │ ├── batch_block_ip.py │ │ ├── check_purge_prefetch_task.py │ │ ├── create_domain.py │ │ ├── create_domain_v2.py │ │ ├── create_purge_prefetch_task.py │ │ ├── delete_domain.py │ │ ├── describe_block_ip.py │ │ ├── describe_dcdn_edge_ip.py │ │ ├── describe_dcdn_origin_ip.py │ │ ├── describe_dcdn_region_and_isp.py │ │ ├── describe_domain_config.py │ │ ├── describe_domain_isp_data.py │ │ ├── describe_domain_logs.py │ │ ├── describe_domain_probe_setting.py │ │ ├── describe_domain_pv_data.py │ │ ├── describe_domain_region_data.py │ │ ├── describe_domain_uv_data.py │ │ ├── describe_ga_origin_policy.py │ │ ├── describe_l2_ips.py │ │ ├── describe_origin_realtime_data.py │ │ ├── describe_origin_statistics.py │ │ ├── describe_origin_statistics_detail.py │ │ ├── describe_realtime_data.py │ │ ├── describe_statistics.py │ │ ├── describe_statistics_detail.py │ │ ├── describe_top_domains.py │ │ ├── describe_top_ips.py │ │ ├── describe_top_referers.py │ │ ├── describe_top_urls.py │ │ ├── describe_user_domains.py │ │ ├── describe_verify_content.py │ │ ├── describe_ws_statistics.py │ │ ├── get_purge_prefetch_task_quota.py │ │ ├── retry_purge_prefetch_task.py │ │ ├── start_domain.py │ │ ├── stop_domain.py │ │ ├── update_domain_config.py │ │ ├── update_domain_config_v2.py │ │ ├── update_domain_probe_setting.py │ │ ├── update_ga_origin_policy.py │ │ └── verify_domain_ownership.py │ ├── dts/ │ │ ├── __init__.py │ │ ├── create_dts_task.py │ │ ├── delete_dts_task.py │ │ ├── describe_dts_task_progress.py │ │ ├── describe_dts_tasks.py │ │ ├── describe_task_info.py │ │ ├── get_async_precheck_result.py │ │ ├── modify_dts_task.py │ │ ├── precheck_async.py │ │ ├── resume_dts_task.py │ │ ├── retry_dts_task.py │ │ ├── start_dts_task.py │ │ ├── stop_dts_task.py │ │ ├── subscription/ │ │ │ ├── avro/ │ │ │ │ ├── deserializer.py │ │ │ │ ├── dts_kafka_consumer_demo.py │ │ │ │ ├── record.avsc │ │ │ │ └── record_printer.py │ │ │ ├── canal/ │ │ │ │ ├── canal.proto │ │ │ │ ├── canal_pb2.py │ │ │ │ └── dts_kafka_consumer_demo.py │ │ │ └── volc/ │ │ │ ├── dts_kafka_consumer_demo.py │ │ │ ├── volc.proto │ │ │ └── volc_pb2.py │ │ └── suspend_dts_task.py │ ├── emr/ │ │ ├── __init__.py │ │ ├── example_list_clusters.py │ │ └── example_list_instances.py │ ├── game_protect/ │ │ └── example_anti_plugin.py │ ├── iam/ │ │ └── example_list_users.py │ ├── image_registry/ │ │ └── example_image_registry.py │ ├── imagex/ │ │ ├── v1/ │ │ │ ├── __init__.py │ │ │ ├── data/ │ │ │ │ ├── __init__.py │ │ │ │ ├── bucket_base_op_usage.py │ │ │ │ ├── bucket_usage.py │ │ │ │ ├── cdn_top_request_data.py │ │ │ │ ├── compress_usage.py │ │ │ │ ├── domain_bandwidth_data.py │ │ │ │ ├── domain_traffic_data.py │ │ │ │ ├── edge_request.py │ │ │ │ ├── edge_request_bandwidth.py │ │ │ │ ├── edge_request_region.py │ │ │ │ ├── edge_request_traffic.py │ │ │ │ ├── hit_rate_request_data.py │ │ │ │ ├── hit_rate_traffic_data.py │ │ │ │ ├── imagex_summary.py │ │ │ │ ├── mirror_request_bandwidth.py │ │ │ │ ├── mirror_request_http_code_by_time.py │ │ │ │ ├── mirror_request_http_code_overview.py │ │ │ │ ├── mirror_request_traffic.py │ │ │ │ └── request_cnt_usage.py │ │ │ ├── examle_get_image_erase_models.py │ │ │ ├── example_common.py │ │ │ ├── example_create_image_content_task.py │ │ │ ├── example_delete_image.py │ │ │ ├── example_describe_imagex_volc_cdn_access_log.py │ │ │ ├── example_fetch_url.py │ │ │ ├── example_get_image_bg_fill_result.py │ │ │ ├── example_get_image_comic_result.py │ │ │ ├── example_get_image_content_block_list.py │ │ │ ├── example_get_image_content_task_detail.py │ │ │ ├── example_get_image_enhance_result.py │ │ │ ├── example_get_image_enhance_result_with_data.py │ │ │ ├── example_get_image_erase_result.py │ │ │ ├── example_get_image_info.py │ │ │ ├── example_get_image_ocr.py │ │ │ ├── example_get_image_segment.py │ │ │ ├── example_get_image_style_result.py │ │ │ ├── example_get_image_super_resolution_result.py │ │ │ ├── example_get_license_plate_detection.py │ │ │ ├── example_update_storage_ttl.py │ │ │ ├── example_upload_image.py │ │ │ ├── example_upload_image_token.py │ │ │ └── example_upload_sts2.py │ │ └── v2/ │ │ ├── __init__.py │ │ ├── api/ │ │ │ ├── AIProcessExample.py │ │ │ ├── AddCertExample.py │ │ │ ├── AddDomainV1Example.py │ │ │ ├── AddImageBackgroundColorsExample.py │ │ │ ├── AddImageElementsExample.py │ │ │ ├── ApplyImageUploadExample.py │ │ │ ├── ApplyVpcUploadInfoExample.py │ │ │ ├── BatchImageAuditExample.py │ │ │ ├── CommitImageUploadExample.py │ │ │ ├── CreateAudioAuditTaskExample.py │ │ │ ├── CreateBatchProcessTaskExample.py │ │ │ ├── CreateCVImageGenerateTaskExample.py │ │ │ ├── CreateFileRestoreExample.py │ │ │ ├── CreateHiddenWatermarkImageExample.py │ │ │ ├── CreateHmExtractTaskExample.py │ │ │ ├── CreateImageAIProcessCallbackExample.py │ │ │ ├── CreateImageAIProcessQueueExample.py │ │ │ ├── CreateImageAITaskExample.py │ │ │ ├── CreateImageAnalyzeTaskExample.py │ │ │ ├── CreateImageAuditTaskExample.py │ │ │ ├── CreateImageCompressTaskExample.py │ │ │ ├── CreateImageContentTaskExample.py │ │ │ ├── CreateImageFromUriExample.py │ │ │ ├── CreateImageHmEmbedExample.py │ │ │ ├── CreateImageHmExtractExample.py │ │ │ ├── CreateImageMigrateTaskExample.py │ │ │ ├── CreateImageMonitorRuleExample.py │ │ │ ├── CreateImageRetryAuditTaskExample.py │ │ │ ├── CreateImageServiceExample.py │ │ │ ├── CreateImageSettingRuleExample.py │ │ │ ├── CreateImageStyleExample.py │ │ │ ├── CreateImageTemplateExample.py │ │ │ ├── CreateImageTemplatesByImportExample.py │ │ │ ├── CreateImageTranscodeCallbackExample.py │ │ │ ├── CreateImageTranscodeQueueExample.py │ │ │ ├── CreateImageTranscodeTaskExample.py │ │ │ ├── CreateTemplatesFromBinExample.py │ │ │ ├── CreateVideoAuditTaskExample.py │ │ │ ├── DelCertExample.py │ │ │ ├── DelDomainExample.py │ │ │ ├── DeleteImageAIProcessDetailExample.py │ │ │ ├── DeleteImageAIProcessQueueExample.py │ │ │ ├── DeleteImageAnalyzeTaskExample.py │ │ │ ├── DeleteImageAnalyzeTaskRunExample.py │ │ │ ├── DeleteImageAuditResultExample.py │ │ │ ├── DeleteImageBackgroundColorsExample.py │ │ │ ├── DeleteImageElementsExample.py │ │ │ ├── DeleteImageMigrateTaskExample.py │ │ │ ├── DeleteImageMonitorRecordsExample.py │ │ │ ├── DeleteImageMonitorRulesExample.py │ │ │ ├── DeleteImageServiceExample.py │ │ │ ├── DeleteImageSettingRuleExample.py │ │ │ ├── DeleteImageStyleExample.py │ │ │ ├── DeleteImageTemplateExample.py │ │ │ ├── DeleteImageTranscodeDetailExample.py │ │ │ ├── DeleteImageTranscodeQueueExample.py │ │ │ ├── DeleteImageUploadFilesExample.py │ │ │ ├── DeleteTemplatesFromBinExample.py │ │ │ ├── DescribeImageVolcCdnAccessLogExample.py │ │ │ ├── DescribeImageXAIRequestCntUsageExample.py │ │ │ ├── DescribeImageXAddOnQPSUsageExample.py │ │ │ ├── DescribeImageXBaseOpUsageExample.py │ │ │ ├── DescribeImageXBillingRequestCntUsageExample.py │ │ │ ├── DescribeImageXBucketRetrievalUsageExample.py │ │ │ ├── DescribeImageXBucketUsageExample.py │ │ │ ├── DescribeImageXCDNTopRequestDataExample.py │ │ │ ├── DescribeImageXCdnDurationAllExample.py │ │ │ ├── DescribeImageXCdnDurationDetailByTimeExample.py │ │ │ ├── DescribeImageXCdnErrorCodeAllExample.py │ │ │ ├── DescribeImageXCdnErrorCodeByTimeExample.py │ │ │ ├── DescribeImageXCdnProtocolRateByTimeExample.py │ │ │ ├── DescribeImageXCdnReuseRateAllExample.py │ │ │ ├── DescribeImageXCdnReuseRateByTimeExample.py │ │ │ ├── DescribeImageXCdnSuccessRateAllExample.py │ │ │ ├── DescribeImageXCdnSuccessRateByTimeExample.py │ │ │ ├── DescribeImageXClientCountByTimeExample.py │ │ │ ├── DescribeImageXClientDecodeDurationByTimeExample.py │ │ │ ├── DescribeImageXClientDecodeSuccessRateByTimeExample.py │ │ │ ├── DescribeImageXClientDemotionRateByTimeExample.py │ │ │ ├── DescribeImageXClientErrorCodeAllExample.py │ │ │ ├── DescribeImageXClientErrorCodeByTimeExample.py │ │ │ ├── DescribeImageXClientFailureRateExample.py │ │ │ ├── DescribeImageXClientFileSizeExample.py │ │ │ ├── DescribeImageXClientLoadDurationAllExample.py │ │ │ ├── DescribeImageXClientLoadDurationExample.py │ │ │ ├── DescribeImageXClientQualityRateByTimeExample.py │ │ │ ├── DescribeImageXClientQueueDurationByTimeExample.py │ │ │ ├── DescribeImageXClientScoreByTimeExample.py │ │ │ ├── DescribeImageXClientSdkVerByTimeExample.py │ │ │ ├── DescribeImageXClientTopDemotionURLExample.py │ │ │ ├── DescribeImageXClientTopFileSizeExample.py │ │ │ ├── DescribeImageXClientTopQualityURLExample.py │ │ │ ├── DescribeImageXCompressUsageExample.py │ │ │ ├── DescribeImageXCubeUsageExample.py │ │ │ ├── DescribeImageXDomainBandwidthDataExample.py │ │ │ ├── DescribeImageXDomainBandwidthNinetyFiveDataExample.py │ │ │ ├── DescribeImageXDomainTrafficDataExample.py │ │ │ ├── DescribeImageXEdgeRequestBandwidthExample.py │ │ │ ├── DescribeImageXEdgeRequestExample.py │ │ │ ├── DescribeImageXEdgeRequestRegionsExample.py │ │ │ ├── DescribeImageXEdgeRequestTrafficExample.py │ │ │ ├── DescribeImageXExceedCountByTimeExample.py │ │ │ ├── DescribeImageXExceedFileSizeExample.py │ │ │ ├── DescribeImageXExceedResolutionRatioAllExample.py │ │ │ ├── DescribeImageXHeifEncodeDurationByTimeExample.py │ │ │ ├── DescribeImageXHeifEncodeErrorCodeByTimeExample.py │ │ │ ├── DescribeImageXHeifEncodeFileInSizeByTimeExample.py │ │ │ ├── DescribeImageXHeifEncodeFileOutSizeByTimeExample.py │ │ │ ├── DescribeImageXHeifEncodeSuccessCountByTimeExample.py │ │ │ ├── DescribeImageXHeifEncodeSuccessRateByTimeExample.py │ │ │ ├── DescribeImageXHitRateRequestDataExample.py │ │ │ ├── DescribeImageXHitRateTrafficDataExample.py │ │ │ ├── DescribeImageXMirrorRequestBandwidthExample.py │ │ │ ├── DescribeImageXMirrorRequestHttpCodeByTimeExample.py │ │ │ ├── DescribeImageXMirrorRequestHttpCodeOverviewExample.py │ │ │ ├── DescribeImageXMirrorRequestTrafficExample.py │ │ │ ├── DescribeImageXMultiCompressUsageExample.py │ │ │ ├── DescribeImageXRequestCntUsageExample.py │ │ │ ├── DescribeImageXScreenshotUsageExample.py │ │ │ ├── DescribeImageXSensibleCacheHitRateByTimeExample.py │ │ │ ├── DescribeImageXSensibleCountByTimeExample.py │ │ │ ├── DescribeImageXSensibleTopRamURLExample.py │ │ │ ├── DescribeImageXSensibleTopResolutionURLExample.py │ │ │ ├── DescribeImageXSensibleTopSizeURLExample.py │ │ │ ├── DescribeImageXSensibleTopUnknownURLExample.py │ │ │ ├── DescribeImageXServerQPSUsageExample.py │ │ │ ├── DescribeImageXServiceQualityExample.py │ │ │ ├── DescribeImageXSourceRequestBandwidthExample.py │ │ │ ├── DescribeImageXSourceRequestExample.py │ │ │ ├── DescribeImageXSourceRequestTrafficExample.py │ │ │ ├── DescribeImageXStorageUsageExample.py │ │ │ ├── DescribeImageXSummaryExample.py │ │ │ ├── DescribeImageXUploadCountByTimeExample.py │ │ │ ├── DescribeImageXUploadDurationExample.py │ │ │ ├── DescribeImageXUploadErrorCodeAllExample.py │ │ │ ├── DescribeImageXUploadErrorCodeByTimeExample.py │ │ │ ├── DescribeImageXUploadFileSizeExample.py │ │ │ ├── DescribeImageXUploadSegmentSpeedByTimeExample.py │ │ │ ├── DescribeImageXUploadSpeedExample.py │ │ │ ├── DescribeImageXUploadSuccessRateByTimeExample.py │ │ │ ├── DescribeImageXVideoClipDurationUsageExample.py │ │ │ ├── DownloadCertExample.py │ │ │ ├── ExportFailedMigrateTaskExample.py │ │ │ ├── FetchImageUrlExample.py │ │ │ ├── GetAiGenerateImageExample.py │ │ │ ├── GetAllCertsExample.py │ │ │ ├── GetAllImageServicesExample.py │ │ │ ├── GetAllImageTemplatesExample.py │ │ │ ├── GetAudioAuditResultExample.py │ │ │ ├── GetAuditEntrysCountExample.py │ │ │ ├── GetBatchProcessResultExample.py │ │ │ ├── GetBatchTaskInfoExample.py │ │ │ ├── GetCVAnimeGenerateImageExample.py │ │ │ ├── GetCVImageGenerateResultExample.py │ │ │ ├── GetCVImageGenerateTaskExample.py │ │ │ ├── GetCVTextGenerateImageExample.py │ │ │ ├── GetCertInfoExample.py │ │ │ ├── GetComprehensiveEnhanceImageExample.py │ │ │ ├── GetCompressTaskInfoExample.py │ │ │ ├── GetDedupTaskStatusExample.py │ │ │ ├── GetDenoisingImageExample.py │ │ │ ├── GetDomainConfigExample.py │ │ │ ├── GetDomainOwnerVerifyContentExample.py │ │ │ ├── GetImageAIDetailsExample.py │ │ │ ├── GetImageAIProcessQueuesExample.py │ │ │ ├── GetImageAITasksExample.py │ │ │ ├── GetImageAddOnTagExample.py │ │ │ ├── GetImageAiGenerateTaskExample.py │ │ │ ├── GetImageAlertRecordsExample.py │ │ │ ├── GetImageAllDomainCertExample.py │ │ │ ├── GetImageAnalyzeResultExample.py │ │ │ ├── GetImageAnalyzeTasksExample.py │ │ │ ├── GetImageAuditResultExample.py │ │ │ ├── GetImageAuditTaskResultExample.py │ │ │ ├── GetImageAuditTasksExample.py │ │ │ ├── GetImageAuthKeyExample.py │ │ │ ├── GetImageBackgroundColorsExample.py │ │ │ ├── GetImageBgFillResultExample.py │ │ │ ├── GetImageComicResultExample.py │ │ │ ├── GetImageContentBlockListExample.py │ │ │ ├── GetImageContentTaskDetailExample.py │ │ │ ├── GetImageDetectResultExample.py │ │ │ ├── GetImageDuplicateDetectionExample.py │ │ │ ├── GetImageElementsExample.py │ │ │ ├── GetImageEnhanceResultExample.py │ │ │ ├── GetImageEraseModelsExample.py │ │ │ ├── GetImageEraseResultExample.py │ │ │ ├── GetImageFontsExample.py │ │ │ ├── GetImageHmExtractTaskInfoExample.py │ │ │ ├── GetImageMigrateTasksExample.py │ │ │ ├── GetImageMonitorRulesExample.py │ │ │ ├── GetImageOCRV2Example.py │ │ │ ├── GetImagePSDetectionExample.py │ │ │ ├── GetImageQualityExample.py │ │ │ ├── GetImageServiceExample.py │ │ │ ├── GetImageServiceSubscriptionExample.py │ │ │ ├── GetImageSettingRuleHistoryExample.py │ │ │ ├── GetImageSettingRulesExample.py │ │ │ ├── GetImageSettingsExample.py │ │ │ ├── GetImageSmartCropResultExample.py │ │ │ ├── GetImageStorageFilesExample.py │ │ │ ├── GetImageStyleDetailExample.py │ │ │ ├── GetImageStyleResultExample.py │ │ │ ├── GetImageStylesExample.py │ │ │ ├── GetImageSuperResolutionResultExample.py │ │ │ ├── GetImageTemplateExample.py │ │ │ ├── GetImageTranscodeDetailsExample.py │ │ │ ├── GetImageTranscodeQueuesExample.py │ │ │ ├── GetImageUpdateFilesExample.py │ │ │ ├── GetImageUploadFileExample.py │ │ │ ├── GetImageUploadFilesExample.py │ │ │ ├── GetImageXQueryAppsExample.py │ │ │ ├── GetImageXQueryDimsExample.py │ │ │ ├── GetImageXQueryRegionsExample.py │ │ │ ├── GetImageXQueryValsExample.py │ │ │ ├── GetLicensePlateDetectionExample.py │ │ │ ├── GetPrivateImageTypeExample.py │ │ │ ├── GetProductAIGCResultExample.py │ │ │ ├── GetResourceURLExample.py │ │ │ ├── GetResponseHeaderValidateKeysExample.py │ │ │ ├── GetSegmentImageExample.py │ │ │ ├── GetServiceDomainsExample.py │ │ │ ├── GetSyncAuditResultExample.py │ │ │ ├── GetTemplatesFromBinExample.py │ │ │ ├── GetUrlFetchTaskExample.py │ │ │ ├── GetVendorBucketsExample.py │ │ │ ├── GetVideoAuditResultExample.py │ │ │ ├── PreviewImageUploadFileExample.py │ │ │ ├── RerunImageMigrateTaskExample.py │ │ │ ├── SetDefaultDomainExample.py │ │ │ ├── SingleImageAuditExample.py │ │ │ ├── TerminateImageMigrateTaskExample.py │ │ │ ├── UpdateAdvanceExample.py │ │ │ ├── UpdateAudioAuditTaskExample.py │ │ │ ├── UpdateAuditImageStatusExample.py │ │ │ ├── UpdateDomainAdaptiveFmtExample.py │ │ │ ├── UpdateFileStorageClassExample.py │ │ │ ├── UpdateHttpsExample.py │ │ │ ├── UpdateImageAIProcessQueueExample.py │ │ │ ├── UpdateImageAIProcessQueueStatusExample.py │ │ │ ├── UpdateImageAnalyzeTaskExample.py │ │ │ ├── UpdateImageAnalyzeTaskStatusExample.py │ │ │ ├── UpdateImageAuditTaskExample.py │ │ │ ├── UpdateImageAuditTaskStatusExample.py │ │ │ ├── UpdateImageAuthKeyExample.py │ │ │ ├── UpdateImageBatchDomainCertExample.py │ │ │ ├── UpdateImageDomainAreaAccessExample.py │ │ │ ├── UpdateImageDomainBandwidthLimitExample.py │ │ │ ├── UpdateImageDomainConfigExample.py │ │ │ ├── UpdateImageDomainDownloadSpeedLimitExample.py │ │ │ ├── UpdateImageDomainIPAuthExample.py │ │ │ ├── UpdateImageDomainUaAccessExample.py │ │ │ ├── UpdateImageDomainVolcOriginExample.py │ │ │ ├── UpdateImageExifDataExample.py │ │ │ ├── UpdateImageFileCTExample.py │ │ │ ├── UpdateImageFileKeyExample.py │ │ │ ├── UpdateImageMirrorConfExample.py │ │ │ ├── UpdateImageMonitorRuleExample.py │ │ │ ├── UpdateImageMonitorRuleStatusExample.py │ │ │ ├── UpdateImageObjectAccessExample.py │ │ │ ├── UpdateImageResourceStatusExample.py │ │ │ ├── UpdateImageSettingRuleExample.py │ │ │ ├── UpdateImageSettingRulePriorityExample.py │ │ │ ├── UpdateImageStorageTTLExample.py │ │ │ ├── UpdateImageStyleExample.py │ │ │ ├── UpdateImageStyleMetaExample.py │ │ │ ├── UpdateImageTaskStrategyExample.py │ │ │ ├── UpdateImageTranscodeQueueExample.py │ │ │ ├── UpdateImageTranscodeQueueStatusExample.py │ │ │ ├── UpdateImageUploadFilesExample.py │ │ │ ├── UpdateImageUploadOverwriteExample.py │ │ │ ├── UpdateReferExample.py │ │ │ ├── UpdateResEventRuleExample.py │ │ │ ├── UpdateResponseHeaderExample.py │ │ │ ├── UpdateServiceNameExample.py │ │ │ ├── UpdateSlimConfigExample.py │ │ │ ├── UpdateStorageRulesExample.py │ │ │ ├── UpdateStorageRulesV2Example.py │ │ │ ├── UpdateVideoAuditTaskExample.py │ │ │ └── VerifyDomainOwnerExample.py │ │ ├── data/ │ │ │ ├── __init__.py │ │ │ ├── bucket_base_op_usage.py │ │ │ ├── bucket_usage.py │ │ │ ├── cdn_top_request_data.py │ │ │ ├── compress_usage.py │ │ │ ├── domain_bandwidth_data.py │ │ │ ├── domain_traffic_data.py │ │ │ ├── edge_request.py │ │ │ ├── edge_request_bandwidth.py │ │ │ ├── edge_request_region.py │ │ │ ├── edge_request_traffic.py │ │ │ ├── hit_rate_request_data.py │ │ │ ├── hit_rate_traffic_data.py │ │ │ ├── imagex_summary.py │ │ │ ├── mirror_request_bandwidth.py │ │ │ ├── mirror_request_http_code_by_time.py │ │ │ ├── mirror_request_http_code_overview.py │ │ │ ├── mirror_request_traffic.py │ │ │ └── request_cnt_usage.py │ │ ├── examle_get_image_erase_models.py │ │ ├── example_common.py │ │ ├── example_create_image_content_task.py │ │ ├── example_delete_image.py │ │ ├── example_describe_imagex_volc_cdn_access_log.py │ │ ├── example_fetch_url.py │ │ ├── example_get_image_bg_fill_result.py │ │ ├── example_get_image_comic_result.py │ │ ├── example_get_image_content_block_list.py │ │ ├── example_get_image_content_task_detail.py │ │ ├── example_get_image_enhance_result.py │ │ ├── example_get_image_erase_result.py │ │ ├── example_get_image_ocr.py │ │ ├── example_get_image_style_result.py │ │ ├── example_get_image_super_resolution_result.py │ │ ├── example_update_storage_ttl.py │ │ ├── example_upload_image.py │ │ ├── example_upload_image_token.py │ │ ├── example_upload_sts2.py │ │ └── example_vpc_upload_image.py │ ├── imp/ │ │ ├── KillJob.py │ │ ├── RetrieveJob.py │ │ ├── SubmitJob.py │ │ ├── SubmitJobByJob.py │ │ └── __init__.py │ ├── live/ │ │ ├── __init__.py │ │ ├── example_audit/ │ │ │ ├── __init__.py │ │ │ ├── example_create_snapshot_audit_preset.py │ │ │ ├── example_delete_snapshot_audit_preset.py │ │ │ ├── example_list_vhost_snapshot_audit_preset.py │ │ │ └── example_update_snapshot_audit_preset.py │ │ ├── example_auth/ │ │ │ ├── __init__.py │ │ │ ├── example_describe_auth.py │ │ │ └── example_update_auth_key.py │ │ ├── example_callback/ │ │ │ ├── __init__.py │ │ │ ├── example_delete_callback.py │ │ │ ├── example_describe_callback.py │ │ │ └── example_update_callback.py │ │ ├── example_cert/ │ │ │ ├── __init__.py │ │ │ ├── example_bind_cert.py │ │ │ ├── example_create_cert.py │ │ │ ├── example_delete_cert.py │ │ │ ├── example_list_cert.py │ │ │ ├── example_un_bind_cert.py │ │ │ └── example_update_cert.py │ │ ├── example_deny_config/ │ │ │ ├── example_describe_deny_config.py │ │ │ └── example_update_deny_config.py │ │ ├── example_describe_info/ │ │ │ ├── __init__.py │ │ │ └── example_describe_info.py │ │ ├── example_domain/ │ │ │ ├── __init__.py │ │ │ ├── example_create_domain.py │ │ │ ├── example_delete_domain.py │ │ │ ├── example_describe_domain.py │ │ │ ├── example_disable_domain.py │ │ │ ├── example_enable_domain.py │ │ │ ├── example_list_domain_detail.py │ │ │ └── example_manager_pull_push_domain_bind.py │ │ ├── example_generate_url/ │ │ │ ├── __init__.py │ │ │ ├── example_generate_play_u_r_l.py │ │ │ └── example_generate_push_u_r_l.py │ │ ├── example_index_m3u8/ │ │ │ ├── __init__.py │ │ │ └── example_create_live_stream_record_index_file.py │ │ ├── example_pull_to_push/ │ │ │ ├── __init__.py │ │ │ ├── example_create_pull_to_push_task.py │ │ │ ├── example_delete_pull_to_push_task.py │ │ │ ├── example_list_pull_to_push_task.py │ │ │ ├── example_restart_pull_to_push_task.py │ │ │ ├── example_stop_pull_to_push_task.py │ │ │ └── example_update_pull_to_push_task.py │ │ ├── example_record/ │ │ │ ├── __init__.py │ │ │ ├── example_create_record_preset.py │ │ │ ├── example_delete_record_preset.py │ │ │ ├── example_describe_record_task_file_history.py │ │ │ ├── example_list_vhost_record_preset.py │ │ │ └── example_update_record_preset.py │ │ ├── example_referer/ │ │ │ ├── __init__.py │ │ │ ├── example_delete_referer.py │ │ │ ├── example_describe_referer.py │ │ │ └── example_update_referer.py │ │ ├── example_relay_source/ │ │ │ ├── __init__.py │ │ │ ├── example_delete_relay_source_v2.py │ │ │ ├── example_describe_relay_source_v2.py │ │ │ └── example_update_relay_source_v2.py │ │ ├── example_snapshot/ │ │ │ ├── __init__.py │ │ │ ├── example_create_snapshot_preset.py │ │ │ ├── example_delete_snapshot_preset.py │ │ │ ├── example_describe_c_d_n_snapshot_history.py │ │ │ ├── example_list_vhost_snapshot_preset.py │ │ │ └── example_update_snapshot_preset.py │ │ ├── example_stream/ │ │ │ ├── __init__.py │ │ │ ├── example_describe_closed_stream_info_by_page.py │ │ │ ├── example_describe_forbidden_stream_info_by_page.py │ │ │ ├── example_describe_live_stream_info_by_page.py │ │ │ ├── example_describe_live_stream_state.py │ │ │ ├── example_forbid_stream.py │ │ │ ├── example_kill_stream.py │ │ │ └── example_resume_stream.py │ │ ├── example_transcode/ │ │ │ ├── __init__.py │ │ │ ├── example_create_transcode_preset.py │ │ │ ├── example_delete_transcode_preset.py │ │ │ ├── example_list_common_trans_preset_detail.py │ │ │ ├── example_list_vhost_transcode_preset.py │ │ │ └── example_update_transcode_preset.py │ │ ├── example_usage/ │ │ │ ├── __init__.py │ │ │ ├── describe_live_batch_push_stream_metrics.py │ │ │ └── describe_live_batch_source_stream_metrics.py │ │ ├── example_vqs_task/ │ │ │ ├── __init__.py │ │ │ ├── example_create_v_q_score_task.py │ │ │ ├── example_describe_v_q_score_task.py │ │ │ └── example_list_v_q_score_task.py │ │ └── v20230101/ │ │ ├── BindCertExample.py │ │ ├── BindEncryptDRMExample.py │ │ ├── ContinuePullToPushTaskExample.py │ │ ├── CreateCarouselTaskExample.py │ │ ├── CreateCertExample.py │ │ ├── CreateCloudMixTaskExample.py │ │ ├── CreateDomainExample.py │ │ ├── CreateDomainV2Example.py │ │ ├── CreateHighLightTaskExample.py │ │ ├── CreateLivePadPresetExample.py │ │ ├── CreateLiveStreamRecordIndexFilesExample.py │ │ ├── CreateLiveVideoQualityAnalysisTaskExample.py │ │ ├── CreatePullRecordTaskExample.py │ │ ├── CreatePullToPushGroupExample.py │ │ ├── CreatePullToPushTaskExample.py │ │ ├── CreateRecordPresetV2Example.py │ │ ├── CreateRelaySourceV4Example.py │ │ ├── CreateSnapshotAuditPresetExample.py │ │ ├── CreateSnapshotPresetV2Example.py │ │ ├── CreateSpeechTaskExample.py │ │ ├── CreateSubtitleTranscodePresetExample.py │ │ ├── CreateTimeShiftPresetV3Example.py │ │ ├── CreateTranscodePresetExample.py │ │ ├── CreateWatermarkPresetExample.py │ │ ├── CreateWatermarkPresetV2Example.py │ │ ├── DeleteCallbackExample.py │ │ ├── DeleteCarouselTaskExample.py │ │ ├── DeleteCertExample.py │ │ ├── DeleteCloudMixTaskExample.py │ │ ├── DeleteDomainExample.py │ │ ├── DeleteHTTPHeaderConfigExample.py │ │ ├── DeleteIPAccessRuleExample.py │ │ ├── DeleteLivePadPresetExample.py │ │ ├── DeleteLiveVideoQualityAnalysisTaskExample.py │ │ ├── DeletePullToPushGroupExample.py │ │ ├── DeletePullToPushTaskExample.py │ │ ├── DeleteRecordPresetExample.py │ │ ├── DeleteRefererExample.py │ │ ├── DeleteRelaySourceV3Example.py │ │ ├── DeleteRelaySourceV4Example.py │ │ ├── DeleteSnapshotAuditPresetExample.py │ │ ├── DeleteSnapshotPresetExample.py │ │ ├── DeleteSpeechTaskExample.py │ │ ├── DeleteStreamQuotaConfigExample.py │ │ ├── DeleteSubtitleTranscodePresetExample.py │ │ ├── DeleteTaskByAccountIDExample.py │ │ ├── DeleteTimeShiftPresetV3Example.py │ │ ├── DeleteTranscodePresetExample.py │ │ ├── DeleteWatermarkPresetExample.py │ │ ├── DeleteWatermarkPresetV2Example.py │ │ ├── DescribeAuthExample.py │ │ ├── DescribeCDNSnapshotHistoryExample.py │ │ ├── DescribeCallbackExample.py │ │ ├── DescribeCertDRMExample.py │ │ ├── DescribeCertDetailSecretV2Example.py │ │ ├── DescribeClosedStreamInfoByPageExample.py │ │ ├── DescribeDomainExample.py │ │ ├── DescribeEncryptDRMExample.py │ │ ├── DescribeEncryptHLSExample.py │ │ ├── DescribeForbiddenStreamGroupByPageExample.py │ │ ├── DescribeForbiddenStreamInfoByPageExample.py │ │ ├── DescribeHTTPHeaderConfigExample.py │ │ ├── DescribeHighLightTaskByAccountIDExample.py │ │ ├── DescribeIPAccessRuleExample.py │ │ ├── DescribeIpInfoExample.py │ │ ├── DescribeLicenseDRMExample.py │ │ ├── DescribeLiveAuditDataExample.py │ │ ├── DescribeLiveBandwidthDataExample.py │ │ ├── DescribeLiveBatchPushStreamAvgMetricsExample.py │ │ ├── DescribeLiveBatchPushStreamMetricsExample.py │ │ ├── DescribeLiveBatchSourceStreamAvgMetricsExample.py │ │ ├── DescribeLiveBatchSourceStreamMetricsExample.py │ │ ├── DescribeLiveBatchStreamSessionDataExample.py │ │ ├── DescribeLiveBatchStreamTrafficDataExample.py │ │ ├── DescribeLiveBatchStreamTranscodeDataExample.py │ │ ├── DescribeLiveCallbackDataExample.py │ │ ├── DescribeLiveEdgeStatDataExample.py │ │ ├── DescribeLiveISPDataExample.py │ │ ├── DescribeLiveLogDataExample.py │ │ ├── DescribeLiveMetricBandwidthDataExample.py │ │ ├── DescribeLiveMetricTrafficDataExample.py │ │ ├── DescribeLiveP95PeakBandwidthDataExample.py │ │ ├── DescribeLivePadPresetDetailExample.py │ │ ├── DescribeLivePadStreamListExample.py │ │ ├── DescribeLivePlayStatusCodeDataExample.py │ │ ├── DescribeLivePullToPushBandwidthDataExample.py │ │ ├── DescribeLivePullToPushDataExample.py │ │ ├── DescribeLivePushStreamCountDataExample.py │ │ ├── DescribeLivePushStreamInfoDataExample.py │ │ ├── DescribeLivePushStreamMetricsExample.py │ │ ├── DescribeLiveRecordDataExample.py │ │ ├── DescribeLiveRegionDataExample.py │ │ ├── DescribeLiveSnapshotDataExample.py │ │ ├── DescribeLiveSourceBandwidthDataExample.py │ │ ├── DescribeLiveSourceStreamMetricsExample.py │ │ ├── DescribeLiveSourceTrafficDataExample.py │ │ ├── DescribeLiveStreamCountDataExample.py │ │ ├── DescribeLiveStreamGroupByPageExample.py │ │ ├── DescribeLiveStreamInfoByPageExample.py │ │ ├── DescribeLiveStreamSessionDataExample.py │ │ ├── DescribeLiveStreamStateExample.py │ │ ├── DescribeLiveTimeShiftDataExample.py │ │ ├── DescribeLiveTopPlayDataExample.py │ │ ├── DescribeLiveTrafficDataExample.py │ │ ├── DescribeLiveTranscodeDataExample.py │ │ ├── DescribeLiveTranscodeInfoDataExample.py │ │ ├── DescribeRecordTaskFileHistoryExample.py │ │ ├── DescribeRefererExample.py │ │ ├── DescribeRelaySourceV3Example.py │ │ ├── DescribeStreamQuotaConfigExample.py │ │ ├── DisableDomainExample.py │ │ ├── EnableDomainExample.py │ │ ├── EnableHTTPHeaderConfigExample.py │ │ ├── ForbidStreamExample.py │ │ ├── GeneratePlayURLExample.py │ │ ├── GeneratePushURLExample.py │ │ ├── GetCarouselDetailExample.py │ │ ├── GetCloudMixTaskDetailExample.py │ │ ├── GetHLSEncryptDataKeyExample.py │ │ ├── GetLiveVideoQualityAnalysisTaskDetailExample.py │ │ ├── GetPullRecordTaskExample.py │ │ ├── GetSpeechConfigExample.py │ │ ├── GetSpeechTaskExample.py │ │ ├── KillStreamExample.py │ │ ├── ListBindEncryptDRMExample.py │ │ ├── ListCarouselTaskExample.py │ │ ├── ListCertV2Example.py │ │ ├── ListCloudMixTaskExample.py │ │ ├── ListCommonTransPresetDetailExample.py │ │ ├── ListDomainDetailExample.py │ │ ├── ListHighLightTaskExample.py │ │ ├── ListLiveVideoQualityAnalysisTasksExample.py │ │ ├── ListPullRecordTaskExample.py │ │ ├── ListPullToPushGroupExample.py │ │ ├── ListPullToPushTaskExample.py │ │ ├── ListPullToPushTaskV2Example.py │ │ ├── ListRelaySourceV4Example.py │ │ ├── ListTimeShiftPresetV2Example.py │ │ ├── ListVhostRecordPresetV2Example.py │ │ ├── ListVhostSnapshotAuditPresetExample.py │ │ ├── ListVhostSnapshotPresetV2Example.py │ │ ├── ListVhostSubtitleTranscodePresetExample.py │ │ ├── ListVhostTransCodePresetExample.py │ │ ├── ListVhostWatermarkPresetExample.py │ │ ├── ListWatermarkPresetDetailExample.py │ │ ├── ListWatermarkPresetExample.py │ │ ├── RelaunchPullToPushTaskExample.py │ │ ├── RestartSpeechTaskExample.py │ │ ├── RestartTranscodingJobExample.py │ │ ├── ResumeStreamExample.py │ │ ├── SearchSpeechTaskExample.py │ │ ├── StopLivePadStreamExample.py │ │ ├── StopPullRecordTaskExample.py │ │ ├── StopPullToPushTaskExample.py │ │ ├── TranscodingJobStatusExample.py │ │ ├── UnBindEncryptDRMExample.py │ │ ├── UnbindCertExample.py │ │ ├── UpdateAuthKeyExample.py │ │ ├── UpdateCallbackExample.py │ │ ├── UpdateCarouselTaskExample.py │ │ ├── UpdateCloudMixTaskExample.py │ │ ├── UpdateDomainVhostExample.py │ │ ├── UpdateEncryptDRMExample.py │ │ ├── UpdateEncryptHLSExample.py │ │ ├── UpdateHTTPHeaderConfigExample.py │ │ ├── UpdateIPAccessRuleExample.py │ │ ├── UpdateLivePadPresetExample.py │ │ ├── UpdatePullToPushGroupExample.py │ │ ├── UpdatePullToPushTaskExample.py │ │ ├── UpdateRecordPresetV2Example.py │ │ ├── UpdateRefererExample.py │ │ ├── UpdateRelaySourceV3Example.py │ │ ├── UpdateRelaySourceV4Example.py │ │ ├── UpdateSnapshotAuditPresetExample.py │ │ ├── UpdateSnapshotPresetV2Example.py │ │ ├── UpdateSpeechTaskExample.py │ │ ├── UpdateStreamQuotaConfigExample.py │ │ ├── UpdateSubtitleTranscodePresetExample.py │ │ ├── UpdateTimeShiftPresetV3Example.py │ │ ├── UpdateTranscodePresetExample.py │ │ ├── UpdateWatermarkPresetExample.py │ │ └── UpdateWatermarkPresetV2Example.py │ ├── livesaas/ │ │ ├── __init__.py │ │ ├── example_client_sdk/ │ │ │ ├── __init__.py │ │ │ └── example_get_sdk_token_api.py │ │ ├── example_comment/ │ │ │ ├── __init__.py │ │ │ ├── example_delete_chat_api.py │ │ │ └── example_presenter_chat_api.py │ │ ├── example_live_admin/ │ │ │ ├── __init__.py │ │ │ ├── example_create_activity_api.py │ │ │ ├── example_delete_activity_api.py │ │ │ └── example_list_activity_api.py │ │ ├── example_live_control/ │ │ │ ├── __init__.py │ │ │ ├── example_get_activity_api.py │ │ │ ├── example_get_activity_basic_config_api.py │ │ │ ├── example_get_streams_api.py │ │ │ ├── example_update_activity_basic_config_api.py │ │ │ ├── example_update_activity_status_api.py │ │ │ ├── example_update_loop_video_api.py │ │ │ ├── example_update_loop_video_status_api.py │ │ │ └── example_update_pull_to_push_api.py │ │ └── example_replay_admin/ │ │ ├── __init__.py │ │ ├── example_list_medias_api.py │ │ ├── example_update_media_online_status_api.py │ │ └── example_upload_replay_api.py │ ├── maas/ │ │ ├── __init__.py │ │ ├── example_chat.py │ │ ├── example_classification.py │ │ ├── example_embeddings.py │ │ ├── example_function_call.py │ │ ├── example_plugin.py │ │ ├── example_tokenize.py │ │ ├── text_privatization/ │ │ │ └── example_text_privatization.py │ │ └── v2/ │ │ ├── __init__.py │ │ ├── audio/ │ │ │ ├── __init__.py │ │ │ └── example_speech.py │ │ ├── example_chat_v2.py │ │ ├── example_chat_with_apikey_v2.py │ │ ├── example_classification_v2.py │ │ ├── example_embeddings_v2.py │ │ ├── example_tokenize_v2.py │ │ └── image/ │ │ ├── __init__.py │ │ ├── example_images_flex_gen.py │ │ └── example_images_quick_gen.py │ ├── nlp/ │ │ ├── __init__.py │ │ ├── example_essay_auto_grade.py │ │ ├── example_keyphrase_extraction_extract.py │ │ ├── example_novel_correction.py │ │ ├── example_sentiment_analysis.py │ │ ├── example_text_correction_en_correct.py │ │ ├── example_text_correction_zh_correct.py │ │ └── example_text_summarization.py │ ├── rdspostgresql/ │ │ ├── __init__.py │ │ └── example_create_instance.py │ ├── rtc/ │ │ ├── RtcService.py │ │ ├── __init__.py │ │ ├── example_get_record_task.py │ │ ├── example_start_record.py │ │ └── example_stop_reocrd.py │ ├── sms/ │ │ ├── __init__.py │ │ ├── example_apply_signature_ident.py │ │ ├── example_apply_sms_signature.py │ │ ├── example_apply_sms_signature_v2.py │ │ ├── example_apply_sms_template.py │ │ ├── example_apply_vms_template.py │ │ ├── example_batch_bind_signature_ident.py │ │ ├── example_conversion.py │ │ ├── example_delete_signature.py │ │ ├── example_delete_sms_template.py │ │ ├── example_get_signature_and_order_list.py │ │ ├── example_get_signature_ident_list.py │ │ ├── example_get_sms_send_details.py │ │ ├── example_get_sms_template_and_order_list.py │ │ ├── example_get_sub_account_detail.py │ │ ├── example_get_sub_account_list.py │ │ ├── example_insert_sms_sub_account.py │ │ ├── example_send_batch_sms.py │ │ ├── example_send_sms.py │ │ ├── example_send_vms.py │ │ ├── example_update_sms_signature.py │ │ └── example_vms_template_query.py │ ├── sts/ │ │ ├── __init__.py │ │ └── example_assume_role.py │ ├── tls/ │ │ ├── __init__.py │ │ ├── example_alarm.py │ │ ├── example_consumer.py │ │ ├── example_consumer_group.py │ │ ├── example_describe_trace_instance.py │ │ ├── example_embedded_console.py │ │ ├── example_etl.py │ │ ├── example_host_group.py │ │ ├── example_import_task.py │ │ ├── example_index.py │ │ ├── example_log.py │ │ ├── example_producer.py │ │ ├── example_project.py │ │ ├── example_rule.py │ │ ├── example_schedule_sql_task.py │ │ ├── example_shipper.py │ │ ├── example_tag.py │ │ └── example_topic.py │ ├── vedit/ │ │ ├── __init__.py │ │ └── example_edit.py │ ├── veen/ │ │ ├── __init__.py │ │ ├── attach_ebs.py │ │ ├── batch_reset_system.py │ │ ├── create_cloudserver.py │ │ ├── create_ebs_instances.py │ │ ├── create_instance.py │ │ ├── delete_cloudserver.py │ │ ├── delete_ebs_instance.py │ │ ├── detach_ebs.py │ │ ├── get_cloudserver.py │ │ ├── get_ebs_instance.py │ │ ├── get_instance.py │ │ ├── get_instance_cloud_disk_info.py │ │ ├── list_available_resource_info.py │ │ ├── list_cloudservers.py │ │ ├── list_ebs_instances.py │ │ ├── list_instance_types.py │ │ ├── list_instances.py │ │ ├── offline_instances.py │ │ ├── reboot_cloudserver.py │ │ ├── reboot_instances.py │ │ ├── reset_login_credential.py │ │ ├── scale_ebs_instance_capacity.py │ │ ├── scale_instance_cloud_disk_capacity.py │ │ ├── set_instance_name.py │ │ ├── start_cloudserver.py │ │ ├── start_instances.py │ │ ├── stop_cloudserver.py │ │ └── stop_instances.py │ ├── verender/ │ │ ├── add_render_setting_demo.py │ │ ├── auto_full_speed_render_jobs_demo.py │ │ ├── create_render_setting_demo.py │ │ ├── delete_render_jobs_demo.py │ │ ├── delete_render_setting_demo.py │ │ ├── download_file_demo.py │ │ ├── full_speed_render_jobs_demo.py │ │ ├── get_current_user_demo.py │ │ ├── get_job_output_demo.py │ │ ├── get_render_job_demo.py │ │ ├── get_render_setting_demo.py │ │ ├── list_account_dcc_plugins_demo.py │ │ ├── list_cell_spec_demo.py │ │ ├── list_dcc_demo.py │ │ ├── list_file_demo.py │ │ ├── list_job_output_demo.py │ │ ├── list_render_job_demo.py │ │ ├── list_render_setting_demo.py │ │ ├── list_workspace_demo.py │ │ ├── remove_file_demo.py │ │ ├── resume_render_jobs_demo.py │ │ ├── retry_render_job_demo.py │ │ ├── stat_file_demo.py │ │ ├── stop_render_jobs_demo.py │ │ ├── update_job_output_demo.py │ │ ├── update_render_jobs_priority_demo.py │ │ ├── update_render_setting_dem.py │ │ ├── upload_file_demo.py │ │ ├── upload_folder_demo.py │ │ └── verender_init.py │ ├── viking_db/ │ │ ├── __init__.py │ │ ├── collection_create.py │ │ ├── collection_create_with_vectorize.py │ │ ├── collection_drop.py │ │ ├── collection_get.py │ │ ├── collection_list.py │ │ ├── data_fetch_by_collection.py │ │ ├── data_fetch_by_index.py │ │ ├── data_upsert.py │ │ ├── example.py │ │ ├── index_create.py │ │ ├── index_drop.py │ │ ├── index_sort.py │ │ ├── search_agg.py │ │ ├── search_post_process_ops.py │ │ ├── search_primary_key_filter.py │ │ ├── search_with_multi_modal.py │ │ └── utils.py │ ├── viking_knowledgebase/ │ │ ├── __init__.py │ │ └── example.py │ ├── visual/ │ │ ├── __init__.py │ │ ├── cv_common.py │ │ ├── cv_get_result.py │ │ ├── cv_process.py │ │ ├── cv_submit_task.py │ │ ├── cv_sync2async_get_result.py │ │ ├── cv_sync2async_submit_task.py │ │ ├── example_ai_gufeng.py │ │ ├── example_all_age_generation.py │ │ ├── example_body_detection.py │ │ ├── example_car_detection.py │ │ ├── example_car_plate_detection.py │ │ ├── example_car_segment.py │ │ ├── example_cert_auth.py │ │ ├── example_cert_config_get.py │ │ ├── example_cert_config_init.py │ │ ├── example_cert_h5_config_init.py │ │ ├── example_cert_h5_token.py │ │ ├── example_cert_pro_liveness_verify_query.py │ │ ├── example_cert_src_face_comp.py │ │ ├── example_cert_token.py │ │ ├── example_cert_verify.py │ │ ├── example_cert_verify1.py │ │ ├── example_cert_verify_query.py │ │ ├── example_common.py │ │ ├── example_convert_photo_v2.py │ │ ├── example_cv_cancel_task.py │ │ ├── example_distortion_free.py │ │ ├── example_dolly_zoom.py │ │ ├── example_emoticon_edit.py │ │ ├── example_emotion_portrait.py │ │ ├── example_enhance_photo_v2.py │ │ ├── example_entity_detect.py │ │ ├── example_entity_segment.py │ │ ├── example_eye_close2open.py │ │ ├── example_face_compare.py │ │ ├── example_face_fusion_movie.py │ │ ├── example_face_fusion_movie_get_result.py │ │ ├── example_face_fusion_movie_submit_task.py │ │ ├── example_face_pretty.py │ │ ├── example_face_swap.py │ │ ├── example_face_swap_v2.py │ │ ├── example_faceswap_ai.py │ │ ├── example_general_segment.py │ │ ├── example_goods_detect.py │ │ ├── example_goods_segment.py │ │ ├── example_hair_segment.py │ │ ├── example_hair_style.py │ │ ├── example_hair_style_v2.py │ │ ├── example_high_aes_smart_drawing.py │ │ ├── example_high_aes_smart_drawing_v2.py │ │ ├── example_human_segment.py │ │ ├── example_image_animation.py │ │ ├── example_image_correction.py │ │ ├── example_image_cut.py │ │ ├── example_image_flow.py │ │ ├── example_image_inpaint.py │ │ ├── example_image_outpaint.py │ │ ├── example_image_score_v2.py │ │ ├── example_image_search_image_add.py │ │ ├── example_image_search_image_delete.py │ │ ├── example_image_search_image_search.py │ │ ├── example_image_style_conversion.py │ │ ├── example_img2img_anime.py │ │ ├── example_img2img_anime_accelerated_maintain_id.py │ │ ├── example_img2img_comics_style.py │ │ ├── example_img2img_create_aes_blueline.py │ │ ├── example_img2img_create_anylora_makoto.py │ │ ├── example_img2img_create_disney_style_no_face.py │ │ ├── example_img2img_create_ether_real_mix.py │ │ ├── example_img2img_create_ink_and_water.py │ │ ├── example_img2img_create_pastel_boys2d.py │ │ ├── example_img2img_create_rev_animated.py │ │ ├── example_img2img_create_toonyou.py │ │ ├── example_img2img_exquisite_style.py │ │ ├── example_img2img_inpainting.py │ │ ├── example_img2img_inpainting_edit.py │ │ ├── example_img2img_outpainting.py │ │ ├── example_img2img_style.py │ │ ├── example_img2img_water_color_style.py │ │ ├── example_img2img_xl_sft.py │ │ ├── example_img2video3d.py │ │ ├── example_jpcartoon.py │ │ ├── example_ocr_async_demo.py │ │ ├── example_ocr_demo.py │ │ ├── example_ocr_pdf_query_task.py │ │ ├── example_ocr_pdf_submit_task.py │ │ ├── example_over_resolution.py │ │ ├── example_over_resolution_v2.py │ │ ├── example_poem_material.py │ │ ├── example_potrait_effect.py │ │ ├── example_product_search_add_image.py │ │ ├── example_product_search_delete_image.py │ │ ├── example_product_search_search_image.py │ │ ├── example_sky_segment.py │ │ ├── example_still_liveness_img.py │ │ ├── example_stretch_recovery.py │ │ ├── example_t2i_ldm.py │ │ ├── example_text2img_xl_sft.py │ │ ├── example_three_d_game_cartoon.py │ │ ├── example_tupo_cartoon.py │ │ ├── example_video_cover_selection.py │ │ ├── example_video_highlight_extraction_query_task.py │ │ ├── example_video_highlight_extraction_submit_task.py │ │ ├── example_video_inpaint_query_task.py │ │ ├── example_video_inpaint_submit_task.py │ │ ├── example_video_over_resolution_get_result_v2.py │ │ ├── example_video_over_resolution_query_task.py │ │ ├── example_video_over_resolution_submit_task.py │ │ ├── example_video_over_resolution_submit_task_v2.py │ │ ├── example_video_retargeting_query_task.py │ │ ├── example_video_retargeting_submit_task.py │ │ ├── example_video_scene_detect.py │ │ ├── example_video_summarization_query_task.py │ │ └── example_video_summarization_submit_task.py │ ├── vms/ │ │ ├── __init__.py │ │ ├── examplae_sigle_batch_append.py │ │ ├── example_batch_append_task.py │ │ ├── example_bind_axb.py │ │ ├── example_bind_axb_for_axne.py │ │ ├── example_bind_axg.py │ │ ├── example_bind_axn.py │ │ ├── example_bind_axne.py │ │ ├── example_bind_axyb.py │ │ ├── example_bind_yb_for_axyb.py │ │ ├── example_click2_call.py │ │ ├── example_click2_call_lite.py │ │ ├── example_commit_resource_upload.py │ │ ├── example_create_number_pool.py │ │ ├── example_create_task.py │ │ ├── example_create_tts.py │ │ ├── example_delete_resource.py │ │ ├── example_enable_or_disable_number.py │ │ ├── example_fetch_resource.py │ │ ├── example_get_reource_upload_url.py │ │ ├── example_number_list.py │ │ ├── example_number_pool_list.py │ │ ├── example_open_update_resource.py │ │ ├── example_pause_task.py │ │ ├── example_query_can_call.py │ │ ├── example_query_open_get_resource.py │ │ ├── example_query_subscription.py │ │ ├── example_query_subscription_for_list.py │ │ ├── example_query_usable_resource.py │ │ ├── example_remuse_task.py │ │ ├── example_select_number.py │ │ ├── example_select_number_and_bind_axb_form.py │ │ ├── example_select_number_and_bind_axn.py │ │ ├── example_single_cancle.py │ │ ├── example_single_info.py │ │ ├── example_stop_task.py │ │ ├── example_unbind_axb.py │ │ ├── example_unbind_axn.py │ │ ├── example_unbind_axne.py │ │ ├── example_unbind_axyb.py │ │ ├── example_update_axb.py │ │ ├── example_update_axn.py │ │ ├── example_update_axne.py │ │ ├── example_update_axyb.py │ │ ├── example_update_number_pool.py │ │ ├── example_update_task.py │ │ └── example_upgrade_ax_to_axb.py │ └── vod/ │ ├── __init__.py │ ├── callback/ │ │ ├── AddCallbackSubscriptionExample.py │ │ ├── SetCallbackEvent.py │ │ └── __init__.py │ ├── cdn/ │ │ ├── AddOrUpdateCertificate.py │ │ ├── CreateCdnPreloadTaskExample.py │ │ ├── CreateCdnRefreshTaskExample.py │ │ ├── CreateDomainExample.py │ │ ├── DescribeCdnIpExample.py │ │ ├── DescribeDomainConfigExample.py │ │ ├── DescribeDomainVerifyContentExample.py │ │ ├── DescribeVodDomainBandwidthDataExample.py │ │ ├── DescribeVodDomainTrafficDataExample.py │ │ ├── ListCdnAccessLogExample.py │ │ ├── ListCdnPvDataExample.py │ │ ├── ListCdnStatusDataExample.py │ │ ├── ListCdnTasksExample.py │ │ ├── ListCdnTopAccessExample.py │ │ ├── ListCdnTopAccessUrlExample.py │ │ ├── ListCdnUsageDataExample.py │ │ ├── ListDomainExample.py │ │ ├── UpdateDomainAuthConfigExample.py │ │ ├── UpdateDomainConfigExample.py │ │ ├── UpdateDomainExpireExample.py │ │ ├── UpdateDomainUrlAuthConfigExample.py │ │ ├── VerifyDomainOwnerExample.py │ │ └── __init__.py │ ├── measure/ │ │ ├── DescribeVodEnhanceImageData.py │ │ ├── DescribeVodMostPlayedStatisData.py │ │ ├── DescribeVodPlayedStatisData.py │ │ ├── DescribeVodRealtimeMediaData.py │ │ ├── DescribeVodRealtimeMediaDetailData.py │ │ ├── DescribeVodSnapshotData.py │ │ ├── DescribeVodSpaceAIStatisData.py │ │ ├── DescribeVodSpaceDetectStatisData.py │ │ ├── DescribeVodSpaceEditDetailData.py │ │ ├── DescribeVodSpaceEditStatisData.py │ │ ├── DescribeVodSpaceSubtitleStatisData.py │ │ ├── DescribeVodSpaceTranscodeData.py │ │ ├── DescribeVodSpaceWorkflowDetailData.py │ │ ├── DescribeVodVidTrafficFileLogExample.py │ │ └── __init__.py │ ├── media/ │ │ ├── DeleteMaterial.py │ │ ├── DeleteMediaTosFile.py │ │ ├── GetAdAuditResultByVidExample.py │ │ ├── GetFileInfos.py │ │ ├── GetInnerAuditURLsExample.py │ │ ├── GetSubtitleAuthToken.py │ │ ├── GetSubtitleToken.py │ │ ├── ListBlockObjectTasks.py │ │ ├── ListFileMetaInfosByFileNames.py │ │ ├── MediaExample.py │ │ ├── SubmitBlockObjectTasks.py │ │ └── __init__.py │ ├── play/ │ │ ├── CreateHlsDecryptionKeyExample.py │ │ ├── GetAllPlayInfoExample.py │ │ ├── GetHlsDrmAuthTokenExample.py │ │ ├── GetPlayAuthTokenExample.py │ │ ├── GetPlayInfoExample.py │ │ ├── GetPlayInfoWithLiveTimeShiftSceneExample.py │ │ ├── GetPrivateDrmPlayAuthExample.py │ │ ├── GetPrivateDrmPlayAuthTokenExample.py │ │ └── __init__.py │ ├── space/ │ │ ├── CreateSpaceExample.py │ │ ├── DescribeUploadSpaceConfigExample.py │ │ ├── DescribeVodSpaceStorageDataExample.py │ │ ├── ListSpaceExample.py │ │ ├── UpdateSpaceExample.py │ │ ├── UpdateSpaceUploadConfigExample.py │ │ ├── UpdateUploadSpaceConfigExample.py │ │ └── __init__.py │ ├── subtitle/ │ │ ├── SubtitleExample.py │ │ └── __init__.py │ ├── upload/ │ │ ├── ApplyUploadInfoExample.py │ │ ├── CommitUploadInfoExample.py │ │ ├── QueryUploadTaskInfo.py │ │ ├── UploadMaterial.py │ │ ├── UploadMedia.py │ │ ├── UploadMediaHLS.py │ │ ├── UploadSts2.py │ │ ├── UploadUrl.py │ │ └── __init__.py │ ├── vedit/ │ │ ├── AsyncVCreativeTaskExample.py │ │ ├── CancelDirectEditTask.py │ │ ├── GetDirectEditProgress.py │ │ ├── GetDirectEditResult.py │ │ ├── GetVCreativeTaskResultExample.py │ │ ├── SubmitDirectEditTaskAsync.py │ │ ├── SubmitDirectEditTaskSync.py │ │ └── __init__.py │ └── workflow/ │ ├── GetWorkflowExecutionExample.py │ ├── GetWorkflowExecutionResultExample.py │ ├── RetrieveTranscodeResultExample.py │ ├── WorkflowExample.py │ └── __init__.py ├── game_protect/ │ ├── GameProtectService.py │ └── __init__.py ├── iam/ │ ├── IamService.py │ └── __init__.py ├── image_registry/ │ ├── ImageRegistryService.py │ └── __init__.py ├── imagex/ │ ├── ImageXConfig.py │ ├── ImageXService.py │ ├── __init__.py │ └── v2/ │ ├── __init__.py │ ├── const.py │ ├── helper/ │ │ ├── __init__.py │ │ └── file_section_reader.py │ ├── imagex_config.py │ ├── imagex_service.py │ ├── imagex_trait.py │ └── upload.py ├── imp/ │ ├── ImpService.py │ ├── ImpServiceConfig.py │ ├── __init__.py │ └── models/ │ ├── __init__.py │ ├── base/ │ │ ├── __init__.py │ │ └── base_pb2.py │ ├── business/ │ │ ├── __init__.py │ │ └── imp_common_pb2.py │ ├── request/ │ │ ├── __init__.py │ │ └── request_imp_pb2.py │ └── response/ │ ├── __init__.py │ └── response_imp_pb2.py ├── live/ │ ├── LiveService.py │ ├── __init__.py │ ├── models/ │ │ ├── __init__.py │ │ ├── business/ │ │ │ ├── VQScore_pb2.py │ │ │ ├── __init__.py │ │ │ ├── addr_pb2.py │ │ │ ├── deny_config_pb2.py │ │ │ ├── domain_pb2.py │ │ │ ├── index_m3u8_pb2.py │ │ │ ├── pull_to_push_pb2.py │ │ │ ├── record_manage_pb2.py │ │ │ ├── relay_source_pb2.py │ │ │ ├── snapshot_manage_pb2.py │ │ │ └── stream_manage_pb2.py │ │ ├── request/ │ │ │ ├── __init__.py │ │ │ ├── live_requests.py │ │ │ └── request_live_pb2.py │ │ └── response/ │ │ ├── __init__.py │ │ └── response_live_pb2.py │ └── v20230101/ │ ├── __init__.py │ ├── live_config.py │ ├── live_service.py │ └── live_trait.py ├── livesaas/ │ ├── LivesaasService.py │ └── __init__.py ├── maas/ │ ├── MaasService.py │ ├── __init__.py │ ├── _response.py │ ├── exception.py │ ├── ka_mgr.py │ ├── sse_decoder.py │ ├── text_privatization/ │ │ ├── README.md │ │ ├── __init__.py │ │ ├── budget_allocator/ │ │ │ ├── __init__.py │ │ │ ├── allocator.py │ │ │ └── cti_allocator.py │ │ ├── priv_conf/ │ │ │ ├── __init__.py │ │ │ ├── cls_priv.py │ │ │ ├── gen_priv.py │ │ │ └── priv.py │ │ ├── privatizer/ │ │ │ ├── __init__.py │ │ │ ├── cls_privatizer.py │ │ │ ├── make.py │ │ │ └── privatizer.py │ │ └── utils.py │ ├── utils.py │ └── v2/ │ ├── MaasService.py │ ├── __init__.py │ ├── _resource.py │ ├── audio/ │ │ ├── __init__.py │ │ ├── audio.py │ │ └── speech.py │ ├── images/ │ │ ├── __init__.py │ │ └── images.py │ └── utils.py ├── nlp/ │ ├── NLPService.py │ ├── README.md │ └── __init__.py ├── rdspostgresql/ │ ├── __init__.py │ └── rdspostgresql.py ├── sms/ │ ├── SmsService.py │ └── __init__.py ├── sts/ │ ├── StsService.py │ └── __init__.py ├── tls/ │ ├── README.md │ ├── TLSService.py │ ├── __init__.py │ ├── const.py │ ├── consumer/ │ │ ├── __init__.py │ │ ├── checkpoint_manager.py │ │ ├── consumer.py │ │ ├── consumer_model.py │ │ ├── heartbeat_runner.py │ │ └── log_consumer.py │ ├── data.py │ ├── log.proto │ ├── log_content_patch.py │ ├── log_pb2.py │ ├── producer/ │ │ ├── __init__.py │ │ ├── batch_manager.py │ │ ├── batch_semaphore.py │ │ ├── log_dispatcher.py │ │ ├── mover.py │ │ ├── producer.py │ │ ├── producer_model.py │ │ ├── retry_queue.py │ │ └── send_batch_task.py │ ├── retry_policy.py │ ├── test/ │ │ ├── api_key_anonymous_auth_unit_test.py │ │ ├── cancel_download_task_test.py │ │ ├── consumer_test.py │ │ ├── create_alarm_content_template_test.py │ │ ├── create_alarm_webhook_integration_test.py │ │ ├── delete_alarm_content_template_test.py │ │ ├── delete_schedule_sql_task_test.py │ │ ├── describe_alarm_content_templates_test.py │ │ ├── describe_alarm_notify_groups_test.py │ │ ├── describe_alarm_webhook_integrations_test.py │ │ ├── describe_etl_task_test.py │ │ ├── describe_import_task_test.py │ │ ├── describe_import_tasks_test.py │ │ ├── describe_rule_test.py │ │ ├── describe_schedule_sql_task_test.py │ │ ├── describe_shipper_test.py │ │ ├── describe_trace_instances_test.py │ │ ├── describe_trace_test.py │ │ ├── etl_task_test.py │ │ ├── etl_test.py │ │ ├── get_account_status_test.py │ │ ├── import_task_test.py │ │ ├── list_tags_for_resources_test.py │ │ ├── manual_shard_split_test.py │ │ ├── modify_alarm_webhook_integration_test.py │ │ ├── processor_contract_test.py │ │ ├── producer_split_unit_test.py │ │ ├── producer_test.py │ │ ├── put_logs_test.py │ │ ├── put_logs_validation_unit_test.py │ │ ├── schedule_sql_task_test.py │ │ ├── shipper_test.py │ │ ├── tag_resources_test.py │ │ ├── test_create_shipper.py │ │ ├── test_delete_alarm_webhook_integration.py │ │ ├── test_delete_import_task.py │ │ ├── test_delete_trace_instance.py │ │ ├── test_describe_shippers.py │ │ ├── test_import_task.py │ │ ├── test_modify_alarm_content_template.py │ │ ├── test_modify_schedule_sql_task.py │ │ ├── test_modify_trace_instance.py │ │ ├── test_producer_batch_manager.py │ │ ├── test_quality_fixes.py │ │ ├── test_search_traces.py │ │ ├── test_untag_resources.py │ │ ├── tls_service_test.py │ │ ├── topic_test.py │ │ ├── trace_test.py │ │ └── util_test.py │ ├── tls_exception.py │ ├── tls_requests.py │ ├── tls_responses.py │ └── util.py ├── util/ │ ├── Functions.py │ ├── Util.py │ └── __init__.py ├── vedit/ │ ├── VEditService.py │ └── __init__.py ├── veen/ │ ├── __init__.py │ └── service.py ├── verender/ │ ├── VerenderService.py │ ├── __init__.py │ └── ftrans.py ├── viking_db/ │ ├── Collection.py │ ├── CollectionClient.py │ ├── Index.py │ ├── IndexClient.py │ ├── ServiceBase.py │ ├── Task.py │ ├── VikingDBService.py │ ├── __init__.py │ ├── common.py │ └── exception.py ├── viking_knowledgebase/ │ ├── Collection.py │ ├── Doc.py │ ├── Point.py │ ├── RespIter.py │ ├── VikingKnowledgeBaseService.py │ ├── __init__.py │ ├── common.py │ └── exception.py ├── visual/ │ ├── README.md │ ├── VisualService.py │ └── __init__.py ├── vms/ │ ├── VmsService.py │ └── __init__.py └── vod/ ├── VodService.py ├── VodServiceConfig.py ├── __init__.py ├── helper/ │ ├── FileSectionReader.py │ └── __init__.py └── models/ ├── __init__.py ├── business/ │ ├── __init__.py │ ├── vod_apps_manage_pb2.py │ ├── vod_callback_pb2.py │ ├── vod_cdn_pb2.py │ ├── vod_common_pb2.py │ ├── vod_drama_pb2.py │ ├── vod_edit_pb2.py │ ├── vod_measure_pb2.py │ ├── vod_media_pb2.py │ ├── vod_migrate_pb2.py │ ├── vod_object_pb2.py │ ├── vod_play_pb2.py │ ├── vod_project_pb2.py │ ├── vod_reporter_pb2.py │ ├── vod_smart_strategy_pb2.py │ ├── vod_space_pb2.py │ ├── vod_trade_pb2.py │ ├── vod_upload_pb2.py │ └── vod_workflow_pb2.py ├── request/ │ ├── __init__.py │ └── request_vod_pb2.py └── response/ ├── __init__.py └── response_vod_pb2.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.pyc venv/ .idea/ build/ dist/ .vscode/ *.egg-info/ ================================================ FILE: Changelog ================================================ ### Change log 2026-05-07 Bumped to version v1.0.222 - Updated apis for content_security/tls 2026-04-23 Bumped to version v1.0.221 - Updated apis for vod 2026-04-16 Bumped to version v1.0.220 - Updated apis for live/sms/tls 2026-03-26 Bumped to version v1.0.219 - Updated apis for tls/vod 2026-03-19 Bumped to version v1.0.218 - Updated apis for content_security 2026-03-12 Bumped to version v1.0.217 - Updated apis for tls/visual 2026-02-05 Bumped to version v1.0.216 - Updated apis for content_security 2026-01-22 Bumped to version v1.0.215 - Updated apis for viking_knowledgebase 2026-01-15 Bumped to version v1.0.214 - Updated apis for tls/viking_db/viking_knowledgebase 2026-01-08 Bumped to version v1.0.213 - Updated apis for tls 2025-12-25 Bumped to version v1.0.212 - Updated apis for tls 2025-12-23 Bumped to version v1.0.211 - Updated apis for viking_db 2025-12-22 Bumped to version v1.0.210 - Updated apis for tls 2025-12-11 Bumped to version v1.0.209 - Updated apis for vms/vod 2025-12-04 Bumped to version v1.0.208 - Updated apis for tls 2025-11-20 Bumped to version v1.0.207 - Updated apis for vod 2025-11-06 Bumped to version v1.0.206 - Updated apis for tls/vms/vod 2025-10-30 Bumped to version v1.0.205 - Updated apis for tls 2025-10-23 Bumped to version v1.0.204 - Updated apis for cdn/tls/vod 2025-10-16 Bumped to version v1.0.203 - Updated apis for imagex/vod 2025-10-13 Bumped to version v1.0.202 - Updated apis for base/content_security/tls 2025-09-25 Bumped to version v1.0.201 - Updated apis for viking_knowledgebase/vod 2025-09-18 Bumped to version v1.0.200 - Updated apis for viking_knowledgebase/vod 2025-09-11 Bumped to version v1.0.199 - Updated apis for tls 2025-08-28 Bumped to version v1.0.198 - Updated apis for vod 2025-08-21 Bumped to version v1.0.197 - Updated apis for imagex 2025-08-14 Bumped to version v1.0.196 - Updated apis for business_security/content_security/dcdn 2025-08-07 Bumped to version v1.0.195 - Updated apis for imagex 2025-07-17 Bumped to version v1.0.194 - Updated apis for tls 2025-07-10 Bumped to version v1.0.193 - Updated apis for imagex/viking_db 2025-07-03 Bumped to version v1.0.192 - Updated apis for imagex 2025-06-26 Bumped to version v1.0.191 - Updated apis for const/example/live/sms 2025-06-19 Bumped to version v1.0.190 - Updated apis for vod 2025-06-17 Bumped to version v1.0.189 - Updated sdk setup.py 2025-06-05 Bumped to version v1.0.188 - Updated apis for vod 2025-05-29 Bumped to version v1.0.187 - Updated apis for imagex/viking_db/viking_knowledgebase 2025-05-22 Bumped to version v1.0.186 - Updated apis for imagex 2025-05-15 Bumped to version v1.0.185 - Updated apis for vod 2025-05-08 Bumped to version v1.0.184 - Updated apis for imagex 2025-04-25 Bumped to version v1.0.183 - Updated apis for live 2025-04-24 Bumped to version v1.0.182 - Updated apis for imagex/vod 2025-04-17 Bumped to version v1.0.181 - Updated apis for content_security/viking_db/vms/vod 2025-04-10 Bumped to version v1.0.180 - Updated apis for viking_db 2025-04-01 Bumped to version v1.0.179 - Updated apis for imagex 2025-03-31 Bumped to version v1.0.178 - Updated apis for imagex 2025-03-27 Bumped to version v1.0.177 - Updated apis for imagex/vod 2025-03-20 Bumped to version v1.0.176 - Updated apis for vod 2025-03-13 Bumped to version v1.0.175 - Updated apis for viking_knowledgebase 2025-02-27 Bumped to version v1.0.174 - Updated apis for example/imagex/tls/viking_db/vod 2025-02-20 Bumped to version v1.0.173 - Updated apis for viking_db 2025-02-13 Bumped to version v1.0.172 - Updated apis for imp/tls/viking_db 2025-02-06 Bumped to version v1.0.171 - Updated apis for viking_knowledgebase 2025-01-23 Bumped to version v1.0.170 - Updated apis for viking_db 2025-01-16 Bumped to version v1.0.169 - Updated apis for vod/tls 2025-01-09 Bumped to version v1.0.168 - Updated apis for viking_db 2025-01-02 Bumped to version v1.0.167 - Updated apis for vod/viking_db/viking_knowledgebase 2024-12-26 Bumped to version v1.0.166 - Updated apis for vod 2024-12-16 Bumped to version v1.0.165 - Updated apis for tls/live 2024-12-05 Bumped to version v1.0.164 - Updated apis for viking_knowledgebase/cdn/tls 2024-11-28 Bumped to version v1.0.163 - Updated apis for viking_db/visual/tls 2024-11-21 Bumped to version v1.0.162 - Updated apis for viking_db 2024-11-14 Bumped to version v1.0.161 - Updated apis for vod 2024-11-07 Bumped to version v1.0.160 - Updated apis for imagex/tls/viking_db 2024-10-24 Bumped to version v1.0.159 - Updated apis for viking_db 2024-10-24 Bumped to version v1.0.158 - Updated apis for vod/tls 2024-10-17 Bumped to version v1.0.157 - Updated apis for vod/viking_db/viking_knowledgebase 2024-10-10 Bumped to version v1.0.156 - Updated apis for imp/tls/vod 2024-09-26 Bumped to version v1.0.155 - Updated apis for imp/viking_knowledgebase/live 2024-09-19 Bumped to version v1.0.154 - Updated apis for viking_db/vod 2024-09-12 Bumped to version v1.0.153 - Updated apis for visual/viking_db/vod 2024-09-05 Bumped to version v1.0.152 - Updated apis for viking_knowledgebase/vod 2024-08-29 Bumped to version v1.0.151 - Updated apis for live/viking_knowledgebase/viking_db/vod 2024-08-15 Bumped to version v1.0.150 - Updated apis for visual/tls/dcdn 2024-08-08 Bumped to version v1.0.149 - Updated apis for viking_knowledgebase/cdn/vod/imagex 2024-07-25 Bumped to version v1.0.148 - Updated apis for visual/viking_knowledgebase 2024-07-18 Bumped to version v1.0.147 - Updated apis for cdn/vod 2024-07-04 Bumped to version v1.0.146 - Updated apis for vod/viking_knowledgebase 2024-06-27 Bumped to version v1.0.145 - Updated apis for live/viking_knowledgebase 2024-06-24 Bumped to version v1.0.144 - Updated apis for live/sms/business_security 2024-06-13 Bumped to version v1.0.143 - Updated apis for viking_knowledgebase/dcdn/imp 2024-06-06 Bumped to version v1.0.142 - Updated apis for viking_knowledgebase/vod 2024-05-23 Bumped to version v1.0.141 - Updated apis for viking_knowledgebase/vod 2024-05-16 Bumped to version v1.0.140 - Updated apis for viking_knowledgebase/tls 2024-05-09 Bumped to version v1.0.139 - Updated apis for vod/sms/viking_db - Add viking_knowledgebase sdk 2024-04-25 Bumped to version v1.0.138 - Updated apis for maas 2024-04-18 Bumped to version v1.0.137 - Updated apis for vod/viking_db/maas 2024-04-11 Bumped to version v1.0.136 - Updated apis for imagex/viking_db/maas/live 2024-04-01 Bumped to version v1.0.135 - Updated apis for vod/maas 2024-03-21 Bumped to version v1.0.134 - Updated apis for dcdn/dts/imagex/live/sms/visual 2024-03-14 Bumped to version v1.0.133 - Updated apis for viking_db/imagex/visual/maas/tls 2024-03-13 Bumped to version v1.0.132 - Updated apis for maas 2024-03-07 Bumped to version v1.0.131 - Updated apis for billing/maas/veen/viking_db 2024-03-06 Bumped to version v1.0.130 - Updated apis for vod 2024-02-29 Bumped to version v1.0.129 - Updated apis for maas/viking_db 2024-02-22 Bumped to version v1.0.128 - Updated apis for live/dcdn/maas/tls 2024-02-05 Bumped to version v1.0.127 - Updated apis for visual/imagex 2024-02-01 Bumped to version v1.0.126 - Updated apis for vod/imagex/dcdn/live/visual 2024-01-29 Bumped to version v1.0.125 - Updated apis for viking_db/imagex 2024-01-18 Bumped to version v1.0.124 - Updated apis for dts/viking_db 2024-01-11 Bumped to version v1.0.123 - Updated apis for viking_db/vod 2024-01-04 Bumped to version v1.0.122 - Updated apis for bioos/tls 2023-12-28 Bumped to version v1.0.121 - Updated apis for viking_db/maas/sms 2023-12-21 Bumped to version v1.0.120 - Updated apis for viking_db/maas 2023-12-14 Bumped to version v1.0.119 - Updated apis for viking_db/maas/live/sms 2023-12-07 Bumped to version v1.0.118 - Updated apis for viking_db 2023-11-30 Bumped to version v1.0.117 - Updated apis for viking_db/visual/tls 2023-11-22 Bumped to version v1.0.116 - Updated apis for live 2023-11-16 Bumped to version v1.0.115 - Updated apis for vod/verender/visual - Added service viking_db 2023-11-09 Bumped to version v1.0.114 - Updated apis for imagex 2023-11-02 Bumped to version v1.0.113 - Updated apis for maas 2023-10-26 Bumped to version v1.0.112 - Updated apis for tls/maas/live 2023-10-24 Bumped to version v1.0.111 - Updated apis for vod 2023-10-19 Bumped to version v1.0.110 - Updated apis for bioos/verender/live/vod/maas/tls 2023-10-12 Bumped to version v1.0.109 - Updated apis for business_security/content_security/maas/vod 2023-09-28 Bumped to version v1.0.108 - Updated apis for tls 2023-09-27 Bumped to version v1.0.107 - Updated apis for tls 2023-09-14 Bumped to version v1.0.106 - Updated apis for veen 2023-08-31 Bumped to version v1.0.105 - Updated apis for maas/vod/verender 2023-08-24 Bumped to version v1.0.104 - Updated apis for maas 2023-08-17 Bumped to version v1.0.103 - Updated apis for maas 2023-08-10 Bumped to version v1.0.102 - Updated apis for imagex/maas/vod/security 2023-08-03 Bumped to version v1.0.101 - Updated apis for verender/vod 2023-07-27 Bumped to version v1.0.100 - Updated apis for vod/billing/maas 2023-07-21 Bumped to version v1.0.99 - Updated apis for vod/maas/visual 2023-07-13 Bumped to version v1.0.98 - Updated apis for bioos/maas/visual - Added service dts 2023-07-06 Bumped to version v1.0.97 - Updated apis for maas 2023-06-29 Bumped to version v1.0.96 - Updated apis for cdn/vod - Added service maas 2023-06-20 Bumped to version v1.0.95 - Updated apis for security 2023-06-16 Bumped to version v1.0.94 - Updated apis for imagex/vod/security/emr 2023-06-01 Bumped to version v1.0.93 - Updated apis for imagex/tls 2023-05-25 Bumped to version v1.0.92 - Updated apis for vms 2023-05-18 Bumped to version v1.0.91 - Updated apis for sms/vod/security - Urgent notice and update: Due to privacy data security requirements, the Volc SMS SDK will no longer support SG overseas access points. If you used volc-sdk to implement SG overseas endpoints before, please modify your code to avoid future build failures. If you require overseas access to SMS, please use BytePlus services. 2023-05-17 Bumped to version v1.0.90 - Removed special logic from setup.py 2023-05-11 Bumped to version v1.0.89 - Updated apis for imagex - Removed lz4a from setup.py 2023-05-05 Bumped to version v1.0.88 - Updated apis for vod/imagex 2023-04-28 Bumped to version v1.0.87 - Updated apis for tls/imagex/bioos 2023-04-20 Bumped to version v1.0.86 - Added service veen - Updated apis for tls 2023-04-13 Bumped to version v1.0.85 - Updated apis for cdn 2023-04-06 Bumped to version v1.0.84 - Updated apis for bioos/vod/iamgx/tls 2023-03-30 Bumped to version v1.0.83 - removed lz4a from requirements 2023-03-30 Bumped to version v1.0.82 - Updated apis for vod/imagex/sms 2023-03-23 Bumped to version v1.0.81 - Fixed bug for vod 2023-03-17 Bumped to version v1.0.80 - Fixed bug for live 2023-03-16 Bumped to version v1.0.79 - Updated apis for live/imagex 2023-03-09 Bumped to version v1.0.78 - Updated apis for vod 2023-03-02 Bumped to version v1.0.77 - Updated apis for visual/imagex/sms/live 2023-02-16 Bumped to version v1.0.76 - Updated apis for vod/imagex/sms 2023-02-16 Bumped to version v1.0.75 - Updated apis for bioos/live 2023-02-09 Bumped to version v1.0.74 - Updated apis for visual/security 2023-02-02 Bumped to version v1.0.73 - Updated apis for sms/vms/security 2023-01-19 Bumped to version v1.0.72 - Updated apis for live - Added bio service 2023-01-13 Bumped to version v1.0.71 - Updated apis for secetnumber/vms/vod 2023-01-05 Bumped to version v1.0.70 - Updated apis for vod/imagex/security 2022-12-29 Bumped to version v1.0.69 - Updated apis for vod/visual/dcdn 2022-12-22 Bumped to version v1.0.68 - Updated apis for imagex 2022-12-15 Bumped to version v1.0.67 - Updated apis for iam/vod/cdn 2022-12-08 Bumped to version v1.0.66 - Updated apis for sms - Updated config for rds/imp 2022-12-05 Bumped to version v1.0.65 - Updated apis for imagex 2022-11-24 Bumped to version v1.0.64 - Updated apis for sms/cdn 2022-11-18 Bumped to version v1.0.63 - Added sts credential support - Updated apis for visual - Fixed dependency for windows 2022-11-10 Bumped to version v1.0.62 - Added live service - Updated apis for security 2022-10-27 Bumped to version v1.0.61 - Added emr service - Updated example for rtc - Updated apis for vod 2022-10-13 Bumped to version v1.0.60 - Updated apis for vod 2022-09-22 Bumped to version v1.0.59 - Updated setup 2022-09-15 Bumped to version v1.0.58 - Added tls service - Updated apis for vod 2022-09-09 Bumped to version v1.0.57 - Added apis for billing 2022-09-01 Bumped to version v1.0.56 - Added apis for visual 2022-08-25 Bumped to version v1.0.55 - Added apis for live 2022-08-18 Bumped to version v1.0.54 - Added apis for cdn 2022-08-11 Bumped to version v1.0.53 - Updated apis for vod 2022-08-05 Bumped to version v1.0.52 - Removed pycrypto dependency 2022-08-04 Bumped to version v1.0.51 - Added apis for sts\cdn 2022-07-28 Bumped to version v1.0.50 - Upgraded apis for vod 2022-07-07 Bumped to version v1.0.49 - Added apis for live\rtc 2022-06-30 Bumped to version v1.0.48 - Upgraded example for rtc - Upgraded service verender 2022-06-23 Bumped to version v1.0.47 - Added apis for imagex\vod 2022-06-17 Bumped to version v1.0.46 - Added apis for imagex\vod 2022-06-09 Bumped to version v1.0.45 - Fixed apis for cdn - Added api for security 2022-05-20 Bumped to version v1.0.44 - Added verender service 2022-05-12 Bumped to version v1.0.43 - Added apis for Vod\security 2022-04-28 Bumped to version v1.0.42 - Added apis for live 2022-04-22 Bumped to version v1.0.41 - Added service live 2022-04-14 Bumped to version v1.0.40 - Refactored apis for cr - Added apis for vod\cdn\visual 2022-03-31 Bumped to version v1.0.39 - Added notify client - Added api for cr - Upgraded api for vod 2022-03-18 Bumped to version v1.0.38 - Added some apis of space\callback\cdn for vod 2022-03-08 Bumped to version v1.0.37 - fixed configparser import 2022-03-03 Bumped to version v1.0.36 - 新增视觉-ocr能力为印章识别、pdf文字识别、高速公路过路费票据识别、商标证识别、软件著作权证书识别、化妆品生产许可证识别,已测试完成 - Add Video-Classification for VOD - Fix BaseService for Python2.7 - Implement related example for cdn apis - Add new cdn apis 2022-02-24 Bumped to version v1.0.35 - Added cr and cp client - Fixed mobile status v2 2022-02-10 Bumped to version v1.0.34 - Added 号码核验二期需求 - Added content security services - Supported ini config 2022-01-21 Bumped to version v1.0.33 - Added vod start workflow - Added 闲时转码 2022-01-20 Bumped to version v1.0.32 - Visual add new api 2022-01-14 Bumped to version v1.0.31 - Fixed for python2.7 2022-01-13 Bumped to version v1.0.30 - Add sdk for 8 apis 2022-01-04 Bumped to version v1.0.29 - Vod python2.7 support 2021-12-30 Bumped to version v1.0.28 - Refactored signing method 2021-12-16 Bumped to version v1.0.27 - element_verify - Dev rds postgresql - Implemented CDN apis 2021-10-29 Bumped to version v1.0.26 - added new service mobile status - added account risk 2021-10-27 Bumped to version v1.0.25 - Vod修正大文件上传配置 - Vod添加HDR支持 2021-09-29 Bumped to version v1.0.24 - Fixed large file upload 2021-09-16 Bumped to version v1.0.23 - Add rtc sdk - Add private drm for vod 2021-08-24 Bumped to version v1.0.22 - ocr sdk - removed not used example files 2021-08-20 Bumped to version v1.0.21 livesaas: add async sdk 2021-08-12 Bumped to version v1.0.20 - added more livesaas api - 新增3个直播间管理类接口 - 新增8个直播控制类接口 - 新增3个回放管理类接口 - 新增2个评论类接口 - 新增1个客户端SDK类接口 2021-08-05 Bumped to version v1.0.19 - Added sms - Added ocr - Added nlp 2021-07-14 Bumped to version v1.0.18 - Fixed cr32 2021-07-14 Bumped to version v1.0.17 - Revert fixed base json for dict type 2021-07-08 Bumped to version v1.0.16 - Fixed base json for dict type 2021-06-03 Bumped to version v1.0.15 - Hotfix for vod service 2021-06-02 Bumped to version v1.0.14 - Add get media list - Support material upload 2021-05-24 Bumped to version v1.0.13 - Add essay_auto_grade api 2021-05-19 Bumped to version v1.0.12 - Add hls drm utils for vod - Add a new product 'game_protect' api to get risk result on gaming scenes. - Add retry after http error - Support upload material 2021-04-20 Bumped to version v1.0.11 - Added store keys res. - Added pcdn and barrageMask into sdk. 2021-04-08 Bumped to version v1.0.10 - Added nlp sdk. 2021-04-08 Bumped to version v1.0.9 - Added more sms support. 2021-03-24 Bumped to version v1.0.8 - Added async and risk result. - Added more abblocker support. - Added media delete api. 2021-02-04 Bumped to version v1.0.7 - Add cloud-edit sdk. 2021-01-29 Bumped to version v1.0.6 - Fix vod init bug. 2021-01-28 Bumped to version v1.0.5 - Added sts2_ak support - Added common imagex api - Added more vod api 2021-01-20 Bumped to version v1.0.4 - Add new visual apis. - Add adblock sdk. 2020-12-30 Bumped to version v1.0.3 - ImageX:add delete api. 2020-12-22 Bumped to version v1.0.2 - Add vod sdk. - Add ImageX sdk. 2020-11-22 Bumped to version v1.0.1 - Update README.md. - Update dependency library,Compatible with python2 and python3. 2020-11-09 Bumped to version v1.0.0 - Add iam sdk. - Add visual sdk. - Add visual demo. - Add version in header. ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2023 Beijing Volcano Engine Technology Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: Open Source Notice.txt ================================================ NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THIS PRODUCT. Component: apache/phoenix-queryserver : Apache License 2.0 appengine-python-standard : MIT License BeautifulSoup4 : MIT License chardet : GNU Lesser General Public License v3.0 or later charset-normalizer : MIT License decorator : BSD 3-clause "New" or "Revised" License google : BSD 3-clause "New" or "Revised" License google-cloud-error_reporting : Apache License 2.0 google/bumble : Apache License 2.0 google/clusterfuzz : Apache License 2.0 idna : BSD 3-clause "New" or "Revised" License invl/retry : Apache License 2.0 minio : Apache License 2.0 models : Apache License 2.0 naked : MIT License Pretix : Apache License 2.0 py : MIT License pycryptodome : (BSD 2-clause "Simplified" License AND Apache License 2.0 AND Public Domain) pypi/setuptools : Python Software Foundation License 2.0 Python six : MIT License python-certifi : Mozilla Public License 2.0 python-lz4 : BSD 3-clause "New" or "Revised" License python-protobuf : BSD 3-clause "New" or "Revised" License PyTZ - Python Time Zone Library : MIT License PyYAML : MIT License releng-tool : BSD 2-clause "Simplified" License requests : Apache License 2.0 shellescape : MIT License soupsieve : MIT License strongdm : Apache License 2.0 ttvcloud : MIT License urllib3 : MIT License volcengine : MIT License License: Apache License 2.0 (apache/phoenix-queryserver, google-cloud-error_reporting, google/bumble, google/clusterfuzz, invl/retry, minio, models, Pretix, pycryptodome, requests, strongdm) Apache License Version 2.0, January 2004 ========================= http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: a. You must give any other recipients of the Work or Derivative Works a copy of this License; and b. You must cause any modified files to carry prominent notices stating that You changed the files; and c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- BSD 2-clause "Simplified" License (releng-tool) BSD Two Clause License ====================== Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- BSD 2-clause "Simplified" License (pycryptodome) license. The copyright of each piece belongs to the respective author. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE --- BSD 3-clause "New" or "Revised" License (decorator, google, idna) Copyright (c) , All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- BSD 3-clause "New" or "Revised" License (python-protobuf) Copyright 2008 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE --- BSD 3-clause "New" or "Revised" License (python-lz4) License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. Neither the name of Steeve Morin nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE --- GNU Lesser General Public License v3.0 or later (chardet) GNU LESSER GENERAL PUBLIC LICENSE ================================= Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. * b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. * b) Accompany the Combined Work with a copy of the GNU GPL and this license document. * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. * d) Do one of the following: * 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. * 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. -------------------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE ========================== Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. “This License” refers to version 3 of the GNU General Public License. “Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. “The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. A “covered work” means either the unmodified Program or a work based on the Program. To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: * a) The work must carry prominent notices stating that you modified it, and giving a relevant date. * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . --- MIT License (PyTZ - Python Time Zone Library) Copyright (c) 2003-2019 Stuart Bishop Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (Python six) Copyright (c) 2010-2018 Benjamin Peterson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (PyYAML) Copyright (c) 2017-2020 Ingy döt Net Copyright (c) 2006-2016 Kirill Simonov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (urllib3) MIT License Copyright (c) 2008-2020 Andrey Petrov and contributors (see CONTRIBUTORS.txt) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (py) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (appengine-python-standard, BeautifulSoup4, charset-normalizer, soupsieve, ttvcloud, volcengine) The MIT License =============== Copyright (c) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- MIT License (shellescape) The MIT License (MIT) Copyright (c) 2015 Christopher Simpkins Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- MIT License (naked) The MIT License (MIT) Copyright (c) {{year}} {{developer}} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE --- Mozilla Public License 2.0 (python-certifi) Mozilla Public License Version 2.0 ====================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty ------------------------- Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability -------------------------- Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. --- Public Domain (pycryptodome) Public domain code is not subject to any license. --- Python Software Foundation License 2.0 (pypi/setuptools) This license was approved as the official PSF License Version 2 on October 22, 2004. The only differences between this and version 1 of the PSF license consist of removing Python version numbers (like 2.1.1 or 2.3). PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 ============================================ -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using this software ("Python") in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved" are retained in Python alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python. 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License Agreement. --- ================================================ FILE: README.EN.MD ================================================ English | [中文](README.md)

Volcengine SDK for Python

Welcome to Volcengine SDK for Python. This document explains how to obtain and use the SDK. ## Prerequisites ### Enable the service Make sure the service you want to access is enabled. Go to the [Volcengine Console](https://console.volcengine.com/), select the service from the left navigation (or search it from the top bar), and complete the activation process in the service console. ### Obtain security credentials Access Key is the credential used to access Volcengine services. It consists of Access Key ID (AK) and Secret Access Key (SK). Log in to the [Volcengine Console](https://console.volcengine.com/), then go to [IAM](https://console.volcengine.com/iam) -> [Access Keys](https://console.volcengine.com/iam/keymanage/) to create and manage your Access Keys. For more information, see the [Access Key documentation](https://www.volcengine.com/docs/6291/65568). ### Environment check Python version must be **3.7** or later. ## Install Install the SDK via pip: ```bash pip install --user volcengine ``` If `volcengine` is already installed, upgrade it with: ```bash pip install --upgrade volcengine ``` ## Configuration ### Credential configuration Volcengine SDK for Python supports the following credential loading methods. *Note: Replace `Your AK` and `Your SK` in the code with your actual AK and SK.* **Method 1**: Set AK/SK on the client **(recommended)** ```python iam_service = IamService() iam_service.set_ak('Your AK') iam_service.set_sk('Your SK') ``` **Method 2**: Load AK/SK from environment variables ```bash VOLC_ACCESSKEY="Your AK" VOLC_SECRETKEY="Your SK" ``` **Method 3**: Load AK/SK from a file under HOME Add the following content to `~/.volc/config`: ```json { "ak": "Your AK", "sk": "Your SK" } ``` ## Other resources ### Some service directories and examples - [Visual Intelligence](volcengine/visual/README.md) - [NLP](volcengine/nlp/README.md) ## Security and privacy This project takes security seriously. For vulnerability reporting and supported versions, see [SECURITY.md](SECURITY.md) ================================================ FILE: README.md ================================================ 中文 | [English](README.EN.MD)

火山引擎SDK for Python

欢迎使用火山引擎SDK for Python,本文档为您介绍如何获取及调用SDK。 ## 前置准备 ### 服务开通 请确保您已开通了您需要访问的服务。您可前往[火山引擎控制台](https://console.volcengine.com/ ),在左侧菜单中选择或在顶部搜索栏中搜索您需要使用的服务,进入服务控制台内完成开通流程。 ### 获取安全凭证 Access Key(访问密钥)是访问火山引擎服务的安全凭证,包含Access Key ID(简称为AK)和Secret Access Key(简称为SK)两部分。您可登录[火山引擎控制台](https://console.volcengine.com/ ),前往“[访问控制](https://console.volcengine.com/iam )”的“[访问密钥](https://console.volcengine.com/iam/keymanage/ )”中创建及管理您的Access Key。更多信息可参考[访问密钥帮助文档](https://www.volcengine.com/docs/6291/65568 )。 ### 环境检查 Python版本需要不低于3.7。 ## 获取与安装 使用pip安装SDK for Python: ``` pip install --user volcengine ``` 如果已经安装volcengine包,则用下面命令升级即可: ``` pip install --upgrade volcengine ``` ## 相关配置 ### 安全凭证配置 火山引擎SDK for Python支持以下几种方式进行凭证管理: *注意:代码中Your AK及Your SK需要分别替换为您的AK及SK。* **方式一**:在Client中设置AK/SK **(推荐)** ```python iam_service = IamService() iam_service.set_ak('Your AK') iam_service.set_sk('Your SK') ``` **方式二**:从环境变量加载AK/SK ```bash VOLC_ACCESSKEY="Your AK" VOLC_SECRETKEY="Your SK" ``` **方式三**:从HOME文件加载AK/SK 在本地的~/.volc/config中添加如下内容: ```json { "ak": "Your AK", "sk": "Your SK" } ``` ##其它资源 ###部分SDK服务目录及示例 - 【视觉智能】请点击[这里](volcengine/visual/README.md) - 【智能语义】请点击[这里](volcengine/nlp/README.md) ## Security and privacy This project takes security seriously. For vulnerability reporting and supported versions, see [SECURITY.md](SECURITY.md) ================================================ FILE: SECURITY.md ================================================ ## Security and privacy If you discover potential security issues in the project, or believe you may have found a security issue, please notify the ByteDance security team through our [security center](https://security.bytedance.com/src/) or [vulnerability reporting email](mailto:src@bytedance.com). Please do not create public GitHub Issues. We will assess the vulnerability based on the Common Vulnerability Scoring System (CVSS 3.1). The security team will keep you updated on key progress and may request further information or guidance from you. You are welcome to contact us via the email or website mentioned above to ask questions or discuss disclosure matters. To protect the security of our customers, ByteDance requests that you do not publish or share information regarding the vulnerability in any public forum, nor publish or share data involving users, until the vulnerability has been remediated and our users have been notified. Please understand that the time required for remediation depends on the severity of the vulnerability and the scope of the impact. Individuals, companies, and security teams may wish to publish security advisories on their own websites or other forums. Please contact us via the email or website mentioned above prior to publication to discuss the information that can be disclosed and to coordinate the disclosure timeline. ## Bug Bounty Reward [For the policy of bug bounty reward](https://bytedance.larkoffice.com/docx/ZstQd7bbooDctqxBCAmcFasOngd), if you have any questions about the rules, please contact [https://src.bytedance.com/home](https://src.bytedance.com/home) for consultation. ================================================ FILE: requirements.txt ================================================ certifi>=2020.6.20 chardet>=4.0.0 decorator==4.4.2 idna==2.10 Naked==0.1.31 pycryptodome>=3.9.9,<4.0.0 pytz>=2020.5 PyYAML~=6.0.1 redo==2.0.4 requests>=2.25.1 retry>=0.9.2,<1.0.0 tenacity>=8.0.0 shellescape==3.8.1 urllib3~=1.26.16 setuptools>=44.1.1 google>=3.0.0 six>=1.0 protobuf>=3.18.3 minio~=7.1.9 readerwriterlock>=1.0.9 kafka~=1.3.5 avro~=1.11.3 aiohttp>=3.10.0 ================================================ FILE: setup.py ================================================ # coding:utf-8 import sys from setuptools import setup, find_packages from volcengine import VERSION install_requires = [ "requests>=2.25.1", "retry>=0.9.2,<1.0.0", "pytz>=2020.5", "pycryptodome>=3.9.9,<4.0.0", "protobuf>=3.18.3", "google>=3.0.0", "six>=1.0", ] setup( name="volcengine", version=VERSION, keywords=["pip", "volcengine", "volc-sdk-python"], description="The Volcengine SDK for Python", license="MIT License", url="https://github.com/Volcengine/volc-sdk-python", author="Volcengine SDK", packages=find_packages(), include_package_data=True, platforms="any", install_requires=install_requires ) ================================================ FILE: volcengine/ApiInfo.py ================================================ # coding:utf-8 class ApiInfo(object): def __init__(self, method, path, query, form, header): self.method = method self.path = path self.query = query self.form = form self.header = header def __str__(self): return 'method: ' + self.method + ', path: ' + self.path ================================================ FILE: volcengine/Credentials.py ================================================ # coding:utf-8 class Credentials(object): def __init__(self, ak, sk, service, region, session_token=''): self.ak = ak self.sk = sk self.service = service self.region = region self.session_token = session_token def set_ak(self, ak): self.ak = ak def set_sk(self, sk): self.sk = sk def set_session_token(self, session_token): self.session_token = session_token ================================================ FILE: volcengine/Policy.py ================================================ # coding:utf-8 import json class ComplexEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, Statement): return {'Effect': o.effect, 'Action': o.action, 'Resource': o.resource} if isinstance(o, InnerToken): return { 'LTAccessKeyId': o.lt_access_key_id, 'AccessKeyId': o.access_key_id, 'SignedSecretAccessKey': o.signed_secret_access_key, 'ExpiredTime': o.expired_time, 'PolicyString': o.policy_string, 'Signature': o.signature } if isinstance(o, Policy): return { 'Statement': [item for item in o.statements] } return json.JSONEncoder.default(self, o) class Policy(object): def __init__(self, statements): self.statements = statements class Statement(object): def __init__(self): self.effect = '' self.action = [] self.resource = [] self.condition = '' @staticmethod def new_allow_statement(actions, resources): s = Statement() s.effect = "Allow" s.action = actions s.resource = resources return s @staticmethod def new_deny_statement(actions, resources): s = Statement() s.effect = "Deny" s.action = actions s.resource = resources return s class SecurityToken2(object): def __init__(self): self.access_key_id = '' self.secret_access_key = '' self.session_token = '' self.expired_time = '' self.current_time = '' def __str__(self): return json.dumps({ 'AccessKeyID': self.access_key_id, 'SecretAccessKey': self.secret_access_key, 'SessionToken': self.session_token, 'ExpiredTime': self.expired_time, 'CurrentTime': self.current_time }) class InnerToken(object): def __init__(self): self.lt_access_key_id = '' self.access_key_id = '' self.signed_secret_access_key = '' self.expired_time = 0 self.policy_string = '' self.signature = '' def __str__(self): return json.dumps({ 'LTAccessKeyId': self.lt_access_key_id, 'AccessKeyId': self.access_key_id, 'SignedSecretAccessKey': self.signed_secret_access_key, 'ExpiredTime': self.expired_time, 'PolicyString': self.policy_string, 'Signature': self.signature }) ================================================ FILE: volcengine/ServiceInfo.py ================================================ # coding: utf-8 class ServiceInfo(object): def __init__(self, host, header, credentials, connection_timeout, socket_timeout, scheme='http'): self.host = host self.header = header self.credentials = credentials self.connection_timeout = connection_timeout self.socket_timeout = socket_timeout self.scheme = scheme ================================================ FILE: volcengine/ServiceInfoHttps.py ================================================ # coding: utf-8 class ServiceInfoSms(object): def __init__(self, host, header, credentials, connection_timeout, socket_timeout, scheme='https'): self.host = host self.header = header self.credentials = credentials self.connection_timeout = connection_timeout self.socket_timeout = socket_timeout self.scheme = scheme ================================================ FILE: volcengine/__init__.py ================================================ # coding:utf-8 VERSION='v1.0.222' ================================================ FILE: volcengine/adblocker/AdBlockerService.py ================================================ import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo import redo from requests import exceptions class AdBlockService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(AdBlockService, "_instance"): with AdBlockService._instance_lock: if not hasattr(AdBlockService, "_instance"): AdBlockService._instance = object.__new__(cls) return AdBlockService._instance def __init__(self): self.service_info = AdBlockService.get_service_info() self.api_info = AdBlockService.get_api_info() super(AdBlockService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("riskcontrol.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'AdBlocker', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = {"AdBlock": ApiInfo("POST", "/", {"Action": "AdBlock", "Version": "2021-01-06"}, {}, {})} return api_info @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def ad_block(self, params, body): res = self.json("AdBlock", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/adblocker/__init__.py ================================================ ================================================ FILE: volcengine/auth/MetaData.py ================================================ # coding:utf-8 class MetaData(object): def __init__(self): self.algorithm = '' self.credential_scope = '' self.signed_headers = '' self.date = '' self.region = '' self.service = '' def set_date(self, date): self.date = date def set_service(self, service): self.service = service def set_region(self, region): self.region = region def set_algorithm(self, algorithm): self.algorithm = algorithm def set_credential_scope(self, credential_scope): self.credential_scope = credential_scope def set_signed_headers(self, signed_headers): self.signed_headers = signed_headers ================================================ FILE: volcengine/auth/SignParam.py ================================================ # coding:utf-8 import datetime from collections import OrderedDict class SignParam(object): def __init__(self): self.body = '' self.query = OrderedDict() self.date = datetime.datetime.now() self.header_list = OrderedDict() self.is_sign_url = False self.host = '' self.path = '/' self.method = '' def set_date(self, date): self.date = date def set_body(self, body): self.body = body def set_host(self, host): self.host = host def set_query(self, query): self.query = query def set_header_list(self, header_list): self.header_list = header_list def set_is_sign_url(self, is_sign_url): self.is_sign_url = is_sign_url def set_path(self, path): self.path = path def set_method(self, method): self.method = method ================================================ FILE: volcengine/auth/SignResult.py ================================================ # coding:utf-8 class SignResult(object): def __init__(self): self.xdate = '' self.xCredential = '' self.xAlgorithm = '' self.xSignedHeaders = '' self.xSignedQueries = '' self.xSignature = '' self.xContextSha256 = '' self.xSecurityToken = '' self.authorization = '' def __str__(self): return '\n'.join(['%s:%s' % item for item in self.__dict__.items()]) ================================================ FILE: volcengine/auth/SignerV4.py ================================================ # coding : utf-8 import datetime import sys import pytz try: from urllib import urlencode except: from urllib.parse import urlencode from volcengine.auth.MetaData import MetaData from volcengine.util.Util import Util from volcengine.base.Request import Request from volcengine.auth.SignResult import SignResult class SignerV4(object): @staticmethod def sign(request, credentials): if request.path == '': request.path = '/' if request.method != 'GET' and not ('Content-Type' in request.headers): request.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' format_date = SignerV4.get_current_format_date() request.headers['X-Date'] = format_date if credentials.session_token != '': request.headers['X-Security-Token'] = credentials.session_token md = MetaData() md.set_algorithm('HMAC-SHA256') md.set_service(credentials.service) md.set_region(credentials.region) md.set_date(format_date[:8]) hashed_canon_req = SignerV4.hashed_canonical_request_v4(request, md) md.set_credential_scope('/'.join([md.date, md.region, md.service, 'request'])) signing_str = '\n'.join([md.algorithm, format_date, md.credential_scope, hashed_canon_req]) signing_key = SignerV4.get_signing_secret_key_v4(credentials.sk, md.date, md.region, md.service) sign = Util.to_hex(Util.hmac_sha256(signing_key, signing_str)) request.headers['Authorization'] = SignerV4.build_auth_header_v4(sign, md, credentials) return @staticmethod def sign_url(request, credentials): format_date = SignerV4.get_current_format_date() date = format_date[:8] md = MetaData() md.set_date(date) md.set_service(credentials.service) md.set_region(credentials.region) md.set_signed_headers('') md.set_algorithm('HMAC-SHA256') md.set_credential_scope('/'.join([md.date, md.region, md.service, 'request'])) query = request.query query['X-Date'] = format_date query['X-NotSignBody'] = '' query['X-Credential'] = credentials.ak + '/' + md.credential_scope query['X-Algorithm'] = md.algorithm query['X-SignedHeaders'] = md.signed_headers query['X-SignedQueries'] = '' query['X-SignedQueries'] = ';'.join(sorted(query.keys())) if credentials.session_token != '': query['X-Security-Token'] = credentials.session_token hashed_canon_req = SignerV4.hashed_simple_canonical_request_v4(request, md) signing_str = '\n'.join([md.algorithm, format_date, md.credential_scope, hashed_canon_req]) signing_key = SignerV4.get_signing_secret_key_v4(credentials.sk, md.date, md.region, md.service) sign = SignerV4.signature_v4(signing_key, signing_str) query['X-Signature'] = sign return urlencode(query) @staticmethod def sign_only(param, credentials): request = Request() request.host = param.host request.method = param.method request.path = param.path request.body = param.body request.query = param.query request.headers = param.header_list format_date = param.date.strftime("%Y%m%dT%H%M%SZ") date = format_date[:8] request.headers['X-Date'] = format_date md = MetaData() md.set_algorithm('HMAC-SHA256') md.set_service(credentials.service) md.set_region(credentials.region) md.set_date(date) md.set_credential_scope('/'.join([md.date, md.region, md.service, 'request'])) if param.is_sign_url: md.set_signed_headers('') md.set_credential_scope('/'.join([md.date, md.region, md.service, 'request'])) query = request.query query['X-Date'] = format_date query['X-NotSignBody'] = '' query['X-Credential'] = credentials.ak + '/' + md.credential_scope query['X-Algorithm'] = md.algorithm query['X-SignedHeaders'] = md.signed_headers query['X-SignedQueries'] = '' query['X-SignedQueries'] = ';'.join(sorted(query.keys())) if credentials.session_token != '': query['X-Security-Token'] = credentials.session_token hashed_canon_req = SignerV4.hashed_simple_canonical_request_v4(request, md) else: if credentials.session_token != '': request.headers['X-Security-Token'] = credentials.session_token hashed_canon_req = SignerV4.hashed_canonical_request_v4(request, md) signing_str = '\n'.join([md.algorithm, format_date, md.credential_scope, hashed_canon_req]) signing_key = SignerV4.get_signing_secret_key_v4(credentials.sk, md.date, md.region, md.service) sign = SignerV4.signature_v4(signing_key, signing_str) result = SignResult() result.xdate = format_date result.xAlgorithm = md.algorithm if param.is_sign_url: result.xSignedQueries = request.query['X-SignedQueries'] result.xSignedHeaders = md.signed_headers result.xCredential = credentials.ak + '/' + md.credential_scope result.xSignature = sign result.xContextSha256 = request.headers['X-Content-Sha256'] result.authorization = result.xAlgorithm + " Credential=" + result.xCredential + ", SignedHeaders=" + md.signed_headers + ", Signature=" + result.xSignature result.xSecurityToken = credentials.session_token return result @staticmethod def hashed_simple_canonical_request_v4(request, meta): body = bytes() # if sys.version_info[0] == 3: # body_hash = Util.sha256(body.decode('utf-8')) # else: body_hash = Util.sha256(body) if request.path == '': request.path = '/' canoncial_request = '\n'.join( [request.method, Util.norm_uri(request.path), Util.norm_query(request.query), '\n', meta.signed_headers, body_hash]) # if sys.version_info[0] == 3: # return Util.sha256(canoncial_request.decode('utf-8')) # else: return Util.sha256(canoncial_request) @staticmethod def hashed_canonical_request_v4(request, meta): # if sys.version_info[0] == 3: # body_hash = Util.sha256(request.body.decode('utf-8')) # else: body_hash = Util.sha256(request.body) request.headers['X-Content-Sha256'] = body_hash signed_headers = dict() for key in request.headers: if key in ['Content-Type', 'Content-Md5', 'Host'] or key.startswith('X-'): signed_headers[key.lower()] = request.headers[key] if 'host' in signed_headers: v = signed_headers['host'] if v.find(':') != -1: split = v.split(':') port = split[1] if str(port) == '80' or str(port) == '443': signed_headers['host'] = split[0] signed_str = '' for key in sorted(signed_headers.keys()): signed_str += key + ':' + signed_headers[key] + '\n' meta.set_signed_headers(';'.join(sorted(signed_headers.keys()))) canoncial_request = '\n'.join( [request.method, Util.norm_uri(request.path), Util.norm_query(request.query), signed_str, meta.signed_headers, body_hash]) return Util.sha256(canoncial_request) @staticmethod def signature_v4(signing_key, signing_str): return Util.to_hex(Util.hmac_sha256(signing_key, signing_str)) @staticmethod def get_signing_secret_key_v4(sk, date, region, service): if sys.version_info[0] == 3: kdate = Util.hmac_sha256(bytes(sk, encoding='utf-8'), date) else: kdate = Util.hmac_sha256(sk.encode('utf-8'), date) kregion = Util.hmac_sha256(kdate, region) kservice = Util.hmac_sha256(kregion, service) return Util.hmac_sha256(kservice, 'request') @staticmethod def build_auth_header_v4(signature, meta, credentials): credential = credentials.ak + '/' + meta.credential_scope return meta.algorithm + ' Credential=' + credential + ', SignedHeaders=' + meta.signed_headers + ', Signature=' + signature @staticmethod def get_current_format_date(): return datetime.datetime.now(tz=pytz.timezone('UTC')).strftime("%Y%m%dT%H%M%SZ") ================================================ FILE: volcengine/auth/__init__.py ================================================ ================================================ FILE: volcengine/base/Request.py ================================================ # coding : utf-8 from collections import OrderedDict try: from urllib import urlencode except: from urllib.parse import urlencode class Request(object): def __init__(self): self.schema = '' self.method = '' self.host = '' self.path = '' self.headers = OrderedDict() self.query = OrderedDict() self.body = '' self.form = dict() self.connection_timeout = 0 self.socket_timeout = 0 def set_schema(self, schema): self.schema = schema def set_shema(self, schema): """ Deprecated: Use set_schema() instead. This method will be removed in a future version. """ self.set_schema(schema) def set_method(self, method): self.method = method def set_host(self, host): self.host = host def set_path(self, path): self.path = path def set_headers(self, headers): self.headers = headers def set_query(self, query): self.query = query def set_body(self, body): self.body = body def set_connection_timeout(self, connection_timeout): self.connection_timeout = connection_timeout def set_socket_timeout(self, socket_timeout): self.socket_timeout = socket_timeout def build(self, doseq=0): return self.schema + '://' + self.host + self.path + '?' + urlencode(self.query, doseq) ================================================ FILE: volcengine/base/Service.py ================================================ # coding: utf-8 import json import logging import os import time from collections import OrderedDict from requests.auth import AuthBase try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: import configparser as configparser except ImportError: import ConfigParser as configparser import requests from volcengine.Policy import SecurityToken2, InnerToken, ComplexEncoder from volcengine.auth.SignerV4 import SignerV4 from volcengine.base.Request import Request from volcengine.util.Util import * from volcengine import VERSION class VolcAuth(AuthBase): def __init__(self, client, request): # setup any auth-related data here self.client = client self.request = request def __call__(self, r): self.request.body = r.body if "Content-Type" in r.headers: self.request.headers["Content-Type"] = r.headers["Content-Type"] if "Content-Length" in r.headers: self.request.headers["Content-Length"] = r.headers["Content-Length"] SignerV4.sign(self.request, self.client.service_info.credentials) for k in self.request.headers: v = self.request.headers[k] r.headers[k] = v return r.headers class Service(object): def __init__(self, service_info, api_info): self.service_info = service_info self.api_info = api_info self.session = requests.session() self.init() def init(self): if 'VOLC_ACCESSKEY' in os.environ and 'VOLC_SECRETKEY' in os.environ: self.service_info.credentials.set_ak(os.environ['VOLC_ACCESSKEY']) self.service_info.credentials.set_sk(os.environ['VOLC_SECRETKEY']) else: if os.environ.get('HOME', None) is None: return # 先尝试从credentials中读取ak、sk,credentials不存在则从config中读取 path_ini = os.environ['HOME'] + '/.volc/credentials' path_json = os.environ['HOME'] + '/.volc/config' if os.path.isfile(path_ini): conf = configparser.ConfigParser() conf.read(path_ini) default_section, ak_option, sk_option = "default", "access_key_id", "secret_access_key" if conf.has_section(default_section): if conf.has_option(default_section, ak_option): ak = conf.get(default_section, ak_option) self.service_info.credentials.set_ak(ak) if conf.has_option(default_section, sk_option): sk = conf.get(default_section, sk_option) self.service_info.credentials.set_sk(sk) elif os.path.isfile(path_json): with open(path_json, 'r') as f: try: j = json.load(f) except Exception: logging.warning("%s is not json file", path_json) return if 'ak' in j: self.service_info.credentials.set_ak(j['ak']) if 'sk' in j: self.service_info.credentials.set_sk(j['sk']) def set_ak(self, ak): self.service_info.credentials.set_ak(ak) def set_sk(self, sk): self.service_info.credentials.set_sk(sk) def set_session_token(self, session_token): self.service_info.credentials.set_session_token(session_token) def set_host(self, host): self.service_info.host = host def set_scheme(self, scheme): self.service_info.scheme = scheme def set_connection_timeout(self, connection_timeout): self.service_info.connection_timeout = connection_timeout def set_socket_timeout(self, socket_timeout): self.service_info.socket_timeout = socket_timeout def get_sign_url(self, api, params): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] mquery = self.merge(api_info.query, params) r = Request() r.set_schema(self.service_info.scheme) r.set_method(api_info.method) r.set_path(api_info.path) r.set_query(mquery) return SignerV4.sign_url(r, self.service_info.credentials) def get(self, api, params, doseq=0): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params, doseq) SignerV4.sign(r, self.service_info.credentials) url = r.build(doseq) resp = self.session.get(url, headers=r.headers, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return resp.text else: raise Exception(resp.text) def post(self, api, params, form): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/x-www-form-urlencoded' r.form = self.merge(api_info.form, form) r.body = urlencode(r.form, True) SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.post(url, headers=r.headers, data=r.form, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return resp.text else: raise Exception(resp.text) def request(self, api, params, data, files=None, reqConfig=None): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) if reqConfig is not None: reqConfig(r) url = r.build() resp = self.session.request(api_info.method, url, data=data, files=files, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout), auth=VolcAuth(self, r)) if resp.status_code == 200: return resp.text else: raise Exception(resp.text) def json(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.post(url, headers=r.headers, data=r.body, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return json.dumps(resp.json()) else: raise Exception(resp.text.encode("utf-8")) def put(self, url, file_path, headers): with open(file_path, 'rb') as f: resp = self.session.put(url, headers=headers, data=f) headers["X-Tt-Logid"] = resp.headers.get("X-Tt-Logid", "") if resp.status_code == 200: return True, resp.text.encode("utf-8") else: return False, resp.text.encode("utf-8") def put_data(self, url, data, headers): resp = self.session.put(url, headers=headers, data=data) headers["X-Tt-Logid"] = resp.headers.get("X-Tt-Logid", "") if resp.status_code == 200: return True, resp.text.encode("utf-8") else: return False, resp.text.encode("utf-8") def prepare_request(self, api_info, params, doseq=0): for key in params: if type(params[key]) == int or type(params[key]) == float or type(params[key]) == bool: params[key] = str(params[key]) elif sys.version_info[0] != 3: if type(params[key]) == unicode: params[key] = params[key].encode('utf-8') elif type(params[key]) == list: if not doseq: params[key] = ','.join(params[key]) connection_timeout = self.service_info.connection_timeout socket_timeout = self.service_info.socket_timeout r = Request() r.set_schema(self.service_info.scheme) r.set_method(api_info.method) r.set_connection_timeout(connection_timeout) r.set_socket_timeout(socket_timeout) mheaders = self.merge(api_info.header, self.service_info.header) mheaders['Host'] = self.service_info.host mheaders['User-Agent'] = 'volc-sdk-python/' + VERSION r.set_headers(mheaders) mquery = self.merge(api_info.query, params) r.set_query(mquery) r.set_host(self.service_info.host) r.set_path(api_info.path) return r def merge(self, param1, param2): od = OrderedDict() for key in param1: od[key] = param1[key] for key in param2: od[key] = param2[key] return od def sign_sts2(self, policy, expire): sk = self.service_info.credentials.sk key = hashlib.md5(sk.encode('utf-8')).digest() sts = SecurityToken2() sts.access_key_id = Util.generate_access_key_id('AKTP') sts.secret_access_key = Util.generate_secret_key() now = int(time.time()) sts.current_time = Service.to_rfc3339(now) if expire < 60: expire = 60 expire = now + expire sts.expired_time = Service.to_rfc3339(expire) inner_token = InnerToken() inner_token.lt_access_key_id = self.service_info.credentials.ak inner_token.access_key_id = sts.access_key_id if policy is None: inner_token.policy_string = '' else: inner_token.policy_string = json.dumps( policy, cls=ComplexEncoder, sort_keys=True).replace(' ', '') inner_token.signed_secret_access_key = Util.aes_encrypt_cbc_with_base64( sts.secret_access_key, key) inner_token.expired_time = expire sign_str = '{}|{}|{}|{}|{}'.format(inner_token.lt_access_key_id, inner_token.access_key_id, inner_token.expired_time, inner_token.signed_secret_access_key, inner_token.policy_string) inner_token.signature = Util.to_hex(Util.hmac_sha256(key, sign_str)) sts.session_token = 'STS2' + base64.b64encode( json.dumps(inner_token, cls=ComplexEncoder, sort_keys=True).replace(' ', '').encode('utf-8')).decode() return sts @staticmethod def to_rfc3339(t): format_time = time.strftime('%Y-%m-%dT%H:%M:%S%z', time.localtime(t)) pos = format_time.find('+') if pos == -1: pos = format_time.find('-') return format_time[:pos + 3] + ':' + format_time[pos + 3:pos + 5] ================================================ FILE: volcengine/base/__init__.py ================================================ ================================================ FILE: volcengine/base/models/__init__.py ================================================ ================================================ FILE: volcengine/base/models/base/__init__.py ================================================ ================================================ FILE: volcengine/base/models/base/base_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/base/base.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1avolcengine/base/base.proto\x12\x1bVolcengine.Base.Models.Base\x1a google/protobuf/descriptor.proto\"\xa2\x01\n\x10ResponseMetadata\x12\x11\n\tRequestId\x18\x01 \x01(\t\x12\x0e\n\x06\x41\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07Version\x18\x03 \x01(\t\x12\x0f\n\x07Service\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\x39\n\x05\x45rror\x18\x06 \x01(\x0b\x32*.Volcengine.Base.Models.Base.ResponseError\".\n\rResponseError\x12\x0c\n\x04\x43ode\x18\x01 \x01(\t\x12\x0f\n\x07Message\x18\x02 \x01(\tB\xc0\x01\n&com.volcengine.service.base.model.baseB\x04\x42\x61seP\x01Z>github.com/volcengine/volc-sdk-golang/service/base/models/base\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02\x1dVolc\\Service\\Base\\Models\\Base\xe2\x02$Volc\\Service\\Base\\Models\\GPBMetadatab\x06proto3') _RESPONSEMETADATA = DESCRIPTOR.message_types_by_name['ResponseMetadata'] _RESPONSEERROR = DESCRIPTOR.message_types_by_name['ResponseError'] ResponseMetadata = _reflection.GeneratedProtocolMessageType('ResponseMetadata', (_message.Message,), { 'DESCRIPTOR' : _RESPONSEMETADATA, '__module__' : 'volcengine.base.base_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Base.Models.Base.ResponseMetadata) }) _sym_db.RegisterMessage(ResponseMetadata) ResponseError = _reflection.GeneratedProtocolMessageType('ResponseError', (_message.Message,), { 'DESCRIPTOR' : _RESPONSEERROR, '__module__' : 'volcengine.base.base_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Base.Models.Base.ResponseError) }) _sym_db.RegisterMessage(ResponseError) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n&com.volcengine.service.base.model.baseB\004BaseP\001Z>github.com/volcengine/volc-sdk-golang/service/base/models/base\240\001\001\330\001\001\302\002\000\312\002\035Volc\\Service\\Base\\Models\\Base\342\002$Volc\\Service\\Base\\Models\\GPBMetadata' _RESPONSEMETADATA._serialized_start=94 _RESPONSEMETADATA._serialized_end=256 _RESPONSEERROR._serialized_start=258 _RESPONSEERROR._serialized_end=304 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/VQScore_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/VQScore.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1blive/business/VQScore.proto\x12\x1fVolcengine.Live.Models.Business\"\x17\n\tVQScoreID\x12\n\n\x02ID\x18\x01 \x01(\t\"-\n\tScoreInfo\x12\x11\n\tPointTime\x18\x01 \x01(\t\x12\r\n\x05Score\x18\x02 \x01(\x02\"d\n\rAddrScoreInfo\x12\x10\n\x08\x41\x64\x64rType\x18\x01 \x01(\x03\x12\x41\n\rScoreInfoList\x18\x02 \x03(\x0b\x32*.Volcengine.Live.Models.Business.ScoreInfo\"\x88\x02\n\x0bVQScoreInfo\x12\x10\n\x08MainAddr\x18\x01 \x01(\t\x12\x14\n\x0c\x43ontrastAddr\x18\x02 \x01(\t\x12\x10\n\x08\x44uration\x18\x03 \x01(\x03\x12\x15\n\rTotalPointNum\x18\x04 \x01(\x03\x12\x18\n\x10MainAverageScore\x18\x05 \x01(\x02\x12\x1c\n\x14\x43ontrastAverageScore\x18\x06 \x01(\x02\x12\x12\n\nDifference\x18\x07 \x01(\x02\x12\x15\n\rDifferencePer\x18\x08 \x01(\x02\x12\x45\n\rAddrScoreList\x18\t \x03(\x0b\x32..Volcengine.Live.Models.Business.AddrScoreInfo\"R\n\x0fVQScoreTaskInfo\x12\n\n\x02ID\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\x12\x0e\n\x06Status\x18\x03 \x01(\x03\x12\x11\n\tAccountID\x18\x04 \x01(\t\"\x8c\x01\n\x13VQScoreTaskListInfo\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\r\n\x05Total\x18\x04 \x01(\x03\x12\x42\n\x08TaskList\x18\x05 \x03(\x0b\x32\x30.Volcengine.Live.Models.Business.VQScoreTaskInfoB\xcf\x01\n*com.volcengine.service.live.model.businessB\x07VQScoreP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _VQSCOREID = DESCRIPTOR.message_types_by_name['VQScoreID'] _SCOREINFO = DESCRIPTOR.message_types_by_name['ScoreInfo'] _ADDRSCOREINFO = DESCRIPTOR.message_types_by_name['AddrScoreInfo'] _VQSCOREINFO = DESCRIPTOR.message_types_by_name['VQScoreInfo'] _VQSCORETASKINFO = DESCRIPTOR.message_types_by_name['VQScoreTaskInfo'] _VQSCORETASKLISTINFO = DESCRIPTOR.message_types_by_name['VQScoreTaskListInfo'] VQScoreID = _reflection.GeneratedProtocolMessageType('VQScoreID', (_message.Message,), { 'DESCRIPTOR' : _VQSCOREID, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreID) }) _sym_db.RegisterMessage(VQScoreID) ScoreInfo = _reflection.GeneratedProtocolMessageType('ScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _SCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ScoreInfo) }) _sym_db.RegisterMessage(ScoreInfo) AddrScoreInfo = _reflection.GeneratedProtocolMessageType('AddrScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _ADDRSCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.AddrScoreInfo) }) _sym_db.RegisterMessage(AddrScoreInfo) VQScoreInfo = _reflection.GeneratedProtocolMessageType('VQScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreInfo) }) _sym_db.RegisterMessage(VQScoreInfo) VQScoreTaskInfo = _reflection.GeneratedProtocolMessageType('VQScoreTaskInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCORETASKINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreTaskInfo) }) _sym_db.RegisterMessage(VQScoreTaskInfo) VQScoreTaskListInfo = _reflection.GeneratedProtocolMessageType('VQScoreTaskListInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCORETASKLISTINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreTaskListInfo) }) _sym_db.RegisterMessage(VQScoreTaskListInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\007VQScoreP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _VQSCOREID._serialized_start=64 _VQSCOREID._serialized_end=87 _SCOREINFO._serialized_start=89 _SCOREINFO._serialized_end=134 _ADDRSCOREINFO._serialized_start=136 _ADDRSCOREINFO._serialized_end=236 _VQSCOREINFO._serialized_start=239 _VQSCOREINFO._serialized_end=503 _VQSCORETASKINFO._serialized_start=505 _VQSCORETASKINFO._serialized_end=587 _VQSCORETASKLISTINFO._serialized_start=590 _VQSCORETASKLISTINFO._serialized_end=730 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/__init__.py ================================================ ================================================ FILE: volcengine/base/models/business/addr_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/addr.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18live/business/addr.proto\x12\x1fVolcengine.Live.Models.Business\"R\n\x15GeneratePlayURLResult\x12\x39\n\x07URLList\x18\x01 \x03(\x0b\x32(.Volcengine.Live.Models.Business.PlayURL\"C\n\x07PlayURL\x12\x0b\n\x03URL\x18\x01 \x01(\t\x12\x0b\n\x03\x43\x44N\x18\x02 \x01(\t\x12\x10\n\x08Protocol\x18\x03 \x01(\t\x12\x0c\n\x04Type\x18\x04 \x01(\t\"\xbf\x01\n\x15GeneratePushURLResult\x12\x13\n\x0bPushURLList\x18\x01 \x03(\t\x12G\n\x11PushURLListDetail\x18\x02 \x03(\x0b\x32,.Volcengine.Live.Models.Business.PushURLItem\x12\x18\n\x10TsOverSrtURLList\x18\x03 \x03(\t\x12\x1a\n\x12RtmpOverSrtURLList\x18\x04 \x03(\t\x12\x12\n\nRtmURLList\x18\x05 \x03(\t\"A\n\x0bPushURLItem\x12\x0b\n\x03URL\x18\x01 \x01(\t\x12\x11\n\tDomainApp\x18\x02 \x01(\t\x12\x12\n\nStreamSign\x18\x03 \x01(\tB\xcc\x01\n*com.volcengine.service.live.model.businessB\x04\x41\x64\x64rP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _GENERATEPLAYURLRESULT = DESCRIPTOR.message_types_by_name['GeneratePlayURLResult'] _PLAYURL = DESCRIPTOR.message_types_by_name['PlayURL'] _GENERATEPUSHURLRESULT = DESCRIPTOR.message_types_by_name['GeneratePushURLResult'] _PUSHURLITEM = DESCRIPTOR.message_types_by_name['PushURLItem'] GeneratePlayURLResult = _reflection.GeneratedProtocolMessageType('GeneratePlayURLResult', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPLAYURLRESULT, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.GeneratePlayURLResult) }) _sym_db.RegisterMessage(GeneratePlayURLResult) PlayURL = _reflection.GeneratedProtocolMessageType('PlayURL', (_message.Message,), { 'DESCRIPTOR' : _PLAYURL, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.PlayURL) }) _sym_db.RegisterMessage(PlayURL) GeneratePushURLResult = _reflection.GeneratedProtocolMessageType('GeneratePushURLResult', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPUSHURLRESULT, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.GeneratePushURLResult) }) _sym_db.RegisterMessage(GeneratePushURLResult) PushURLItem = _reflection.GeneratedProtocolMessageType('PushURLItem', (_message.Message,), { 'DESCRIPTOR' : _PUSHURLITEM, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.PushURLItem) }) _sym_db.RegisterMessage(PushURLItem) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\004AddrP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _GENERATEPLAYURLRESULT._serialized_start=61 _GENERATEPLAYURLRESULT._serialized_end=143 _PLAYURL._serialized_start=145 _PLAYURL._serialized_end=212 _GENERATEPUSHURLRESULT._serialized_start=215 _GENERATEPUSHURLRESULT._serialized_end=406 _PUSHURLITEM._serialized_start=408 _PUSHURLITEM._serialized_end=473 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/deny_config_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/deny_config.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1flive/business/deny_config.proto\x12\x1fVolcengine.Live.Models.Business\"\xa8\x01\n\x10\x44\x65nyConfigDetail\x12\x0f\n\x07ProType\x18\x01 \x03(\t\x12\x0f\n\x07\x46mtType\x18\x02 \x03(\t\x12\x11\n\tContinent\x18\x03 \x01(\t\x12\x0f\n\x07\x43ountry\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\x0c\n\x04\x43ity\x18\x06 \x01(\t\x12\x0b\n\x03ISP\x18\x07 \x01(\t\x12\x10\n\x08\x44\x65nyList\x18\x08 \x03(\t\x12\x11\n\tAllowList\x18\t \x03(\t\"b\n\x18\x44\x65scribeDenyConfigResult\x12\x46\n\x08\x44\x65nyList\x18\x01 \x03(\x0b\x32\x34.Volcengine.Live.Models.Business.VhostWithDenyConfig\"\x88\x01\n\x13VhostWithDenyConfig\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x45\n\nDenyConfig\x18\x04 \x03(\x0b\x32\x31.Volcengine.Live.Models.Business.DenyConfigDetailB\xd2\x01\n*com.volcengine.service.live.model.businessB\nDenyConfigP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _DENYCONFIGDETAIL = DESCRIPTOR.message_types_by_name['DenyConfigDetail'] _DESCRIBEDENYCONFIGRESULT = DESCRIPTOR.message_types_by_name['DescribeDenyConfigResult'] _VHOSTWITHDENYCONFIG = DESCRIPTOR.message_types_by_name['VhostWithDenyConfig'] DenyConfigDetail = _reflection.GeneratedProtocolMessageType('DenyConfigDetail', (_message.Message,), { 'DESCRIPTOR' : _DENYCONFIGDETAIL, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DenyConfigDetail) }) _sym_db.RegisterMessage(DenyConfigDetail) DescribeDenyConfigResult = _reflection.GeneratedProtocolMessageType('DescribeDenyConfigResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDENYCONFIGRESULT, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DescribeDenyConfigResult) }) _sym_db.RegisterMessage(DescribeDenyConfigResult) VhostWithDenyConfig = _reflection.GeneratedProtocolMessageType('VhostWithDenyConfig', (_message.Message,), { 'DESCRIPTOR' : _VHOSTWITHDENYCONFIG, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VhostWithDenyConfig) }) _sym_db.RegisterMessage(VhostWithDenyConfig) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\nDenyConfigP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _DENYCONFIGDETAIL._serialized_start=69 _DENYCONFIGDETAIL._serialized_end=237 _DESCRIBEDENYCONFIGRESULT._serialized_start=239 _DESCRIBEDENYCONFIGRESULT._serialized_end=337 _VHOSTWITHDENYCONFIG._serialized_start=340 _VHOSTWITHDENYCONFIG._serialized_end=476 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/domain_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/domain.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1alive/business/domain.proto\x12\x1fVolcengine.Live.Models.Business\"\x82\x02\n\nDomainList\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\x03\x12\x0c\n\x04Type\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\r\n\x05\x43Name\x18\x06 \x01(\t\x12\x12\n\nCnameCheck\x18\x07 \x01(\x03\x12\x13\n\x0b\x44omainCheck\x18\x08 \x01(\x03\x12\x10\n\x08ICPCheck\x18\t \x01(\x03\x12\x12\n\nCreateTime\x18\n \x01(\t\x12\x12\n\nCertDomain\x18\x0b \x01(\t\x12\x0f\n\x07\x43hainID\x18\x0c \x01(\t\x12\x10\n\x08\x43\x65rtName\x18\r \x01(\t\x12\x12\n\nPushDomain\x18\x0e \x01(\t\"`\n\x0e\x44omainListInfo\x12?\n\nDomainList\x18\x01 \x03(\x0b\x32+.Volcengine.Live.Models.Business.DomainList\x12\r\n\x05Total\x18\x02 \x01(\x03\x42\xce\x01\n*com.volcengine.service.live.model.businessB\x06\x44omainP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _DOMAINLIST = DESCRIPTOR.message_types_by_name['DomainList'] _DOMAINLISTINFO = DESCRIPTOR.message_types_by_name['DomainListInfo'] DomainList = _reflection.GeneratedProtocolMessageType('DomainList', (_message.Message,), { 'DESCRIPTOR' : _DOMAINLIST, '__module__' : 'live.business.domain_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DomainList) }) _sym_db.RegisterMessage(DomainList) DomainListInfo = _reflection.GeneratedProtocolMessageType('DomainListInfo', (_message.Message,), { 'DESCRIPTOR' : _DOMAINLISTINFO, '__module__' : 'live.business.domain_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DomainListInfo) }) _sym_db.RegisterMessage(DomainListInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\006DomainP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _DOMAINLIST._serialized_start=64 _DOMAINLIST._serialized_end=322 _DOMAINLISTINFO._serialized_start=324 _DOMAINLISTINFO._serialized_end=420 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/pull_to_push_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/pull_to_push.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.live.models.business import snapshot_manage_pb2 as live_dot_business_dot_snapshot__manage__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n live/business/pull_to_push.proto\x12\x1fVolcengine.Live.Models.Business\x1a#live/business/snapshot_manage.proto\",\n\x1a\x43reatePullToPushTaskResult\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"\x98\x01\n\x18ListPullToPushTaskResult\x12;\n\x04List\x18\x01 \x03(\x0b\x32-.Volcengine.Live.Models.Business.TaskInfoItem\x12?\n\nPagination\x18\x02 \x01(\x0b\x32+.Volcengine.Live.Models.Business.Pagination\"\xdf\x01\n\x0cTaskInfoItem\x12\r\n\x05Title\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x43\x61llbackURL\x18\x05 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\x05\x12\x11\n\tCycleMode\x18\x07 \x01(\x05\x12\x0f\n\x07\x44stAddr\x18\x08 \x01(\t\x12\x0f\n\x07SrcAddr\x18\t \x01(\t\x12\x10\n\x08SrcAddrS\x18\n \x03(\t\x12\x0e\n\x06Status\x18\x0b \x01(\t\x12\x12\n\nTaskStatus\x18\x0c \x01(\x05\x42\xd6\x01\n*com.volcengine.service.live.model.businessB\x0ePullToPushTaskP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CREATEPULLTOPUSHTASKRESULT = DESCRIPTOR.message_types_by_name['CreatePullToPushTaskResult'] _LISTPULLTOPUSHTASKRESULT = DESCRIPTOR.message_types_by_name['ListPullToPushTaskResult'] _TASKINFOITEM = DESCRIPTOR.message_types_by_name['TaskInfoItem'] CreatePullToPushTaskResult = _reflection.GeneratedProtocolMessageType('CreatePullToPushTaskResult', (_message.Message,), { 'DESCRIPTOR' : _CREATEPULLTOPUSHTASKRESULT, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CreatePullToPushTaskResult) }) _sym_db.RegisterMessage(CreatePullToPushTaskResult) ListPullToPushTaskResult = _reflection.GeneratedProtocolMessageType('ListPullToPushTaskResult', (_message.Message,), { 'DESCRIPTOR' : _LISTPULLTOPUSHTASKRESULT, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ListPullToPushTaskResult) }) _sym_db.RegisterMessage(ListPullToPushTaskResult) TaskInfoItem = _reflection.GeneratedProtocolMessageType('TaskInfoItem', (_message.Message,), { 'DESCRIPTOR' : _TASKINFOITEM, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.TaskInfoItem) }) _sym_db.RegisterMessage(TaskInfoItem) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\016PullToPushTaskP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CREATEPULLTOPUSHTASKRESULT._serialized_start=106 _CREATEPULLTOPUSHTASKRESULT._serialized_end=150 _LISTPULLTOPUSHTASKRESULT._serialized_start=153 _LISTPULLTOPUSHTASKRESULT._serialized_end=305 _TASKINFOITEM._serialized_start=308 _TASKINFOITEM._serialized_end=531 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/record_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/record_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.live.models.business import snapshot_manage_pb2 as live_dot_business_dot_snapshot__manage__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!live/business/record_manage.proto\x12\x1fVolcengine.Live.Models.Business\x1a#live/business/snapshot_manage.proto\"\xbf\x01\n\x0eRecordTaskFile\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x0e\n\x06\x42ucket\x18\x04 \x01(\t\x12\x0c\n\x04Path\x18\x05 \x01(\t\x12\x10\n\x08\x44uration\x18\x06 \x01(\t\x12\x11\n\tStartTime\x18\x07 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x08 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\t \x01(\t\x12\x10\n\x08\x46ileName\x18\n \x01(\t\x12\x0b\n\x03Vid\x18\x0b \x01(\t\"\x93\x01\n\x11RecordHistoryInfo\x12=\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32/.Volcengine.Live.Models.Business.RecordTaskFile\x12?\n\nPagination\x18\x02 \x03(\x0b\x32+.Volcengine.Live.Models.Business.PaginationB\xd4\x01\n*com.volcengine.service.live.model.businessB\x0cRecordManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _RECORDTASKFILE = DESCRIPTOR.message_types_by_name['RecordTaskFile'] _RECORDHISTORYINFO = DESCRIPTOR.message_types_by_name['RecordHistoryInfo'] RecordTaskFile = _reflection.GeneratedProtocolMessageType('RecordTaskFile', (_message.Message,), { 'DESCRIPTOR' : _RECORDTASKFILE, '__module__' : 'live.business.record_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RecordTaskFile) }) _sym_db.RegisterMessage(RecordTaskFile) RecordHistoryInfo = _reflection.GeneratedProtocolMessageType('RecordHistoryInfo', (_message.Message,), { 'DESCRIPTOR' : _RECORDHISTORYINFO, '__module__' : 'live.business.record_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RecordHistoryInfo) }) _sym_db.RegisterMessage(RecordHistoryInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\014RecordManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _RECORDTASKFILE._serialized_start=108 _RECORDTASKFILE._serialized_end=299 _RECORDHISTORYINFO._serialized_start=302 _RECORDHISTORYINFO._serialized_end=449 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/relay_source_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/relay_source.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n live/business/relay_source.proto\x12\x1fVolcengine.Live.Models.Business\"\xf9\x01\n\x16RelaySourceGroupItemV2\x12\x1d\n\x15RelaySourceDomainList\x18\x01 \x03(\t\x12i\n\x11RelaySourceParams\x18\x02 \x03(\x0b\x32N.Volcengine.Live.Models.Business.RelaySourceGroupItemV2.RelaySourceParamsEntry\x12\x1b\n\x13RelaySourceProtocol\x18\x03 \x01(\t\x1a\x38\n\x16RelaySourceParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x11RelaySourceConfig\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12J\n\tGroupList\x18\x03 \x03(\x0b\x32\x37.Volcengine.Live.Models.Business.RelaySourceGroupItemV2\"f\n\x15RelaySourceConfigList\x12M\n\x11RelaySourceConfig\x18\x01 \x03(\x0b\x32\x32.Volcengine.Live.Models.Business.RelaySourceConfigB\xd3\x01\n*com.volcengine.service.live.model.businessB\x0bRelaySourceP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _RELAYSOURCEGROUPITEMV2 = DESCRIPTOR.message_types_by_name['RelaySourceGroupItemV2'] _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY = _RELAYSOURCEGROUPITEMV2.nested_types_by_name['RelaySourceParamsEntry'] _RELAYSOURCECONFIG = DESCRIPTOR.message_types_by_name['RelaySourceConfig'] _RELAYSOURCECONFIGLIST = DESCRIPTOR.message_types_by_name['RelaySourceConfigList'] RelaySourceGroupItemV2 = _reflection.GeneratedProtocolMessageType('RelaySourceGroupItemV2', (_message.Message,), { 'RelaySourceParamsEntry' : _reflection.GeneratedProtocolMessageType('RelaySourceParamsEntry', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceGroupItemV2.RelaySourceParamsEntry) }) , 'DESCRIPTOR' : _RELAYSOURCEGROUPITEMV2, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceGroupItemV2) }) _sym_db.RegisterMessage(RelaySourceGroupItemV2) _sym_db.RegisterMessage(RelaySourceGroupItemV2.RelaySourceParamsEntry) RelaySourceConfig = _reflection.GeneratedProtocolMessageType('RelaySourceConfig', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCECONFIG, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceConfig) }) _sym_db.RegisterMessage(RelaySourceConfig) RelaySourceConfigList = _reflection.GeneratedProtocolMessageType('RelaySourceConfigList', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCECONFIGLIST, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceConfigList) }) _sym_db.RegisterMessage(RelaySourceConfigList) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\013RelaySourceP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._options = None _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_options = b'8\001' _RELAYSOURCEGROUPITEMV2._serialized_start=70 _RELAYSOURCEGROUPITEMV2._serialized_end=319 _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_start=263 _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_end=319 _RELAYSOURCECONFIG._serialized_start=321 _RELAYSOURCECONFIG._serialized_end=444 _RELAYSOURCECONFIGLIST._serialized_start=446 _RELAYSOURCECONFIGLIST._serialized_end=548 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/snapshot_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/snapshot_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#live/business/snapshot_manage.proto\x12\x1fVolcengine.Live.Models.Business\"\x92\x01\n\x12\x43\x44NSnapshotHistory\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x0c\n\x04Path\x18\x04 \x01(\t\x12\x10\n\x08\x46ileSize\x18\x05 \x01(\x02\x12\x11\n\tTimeStamp\x18\x06 \x01(\t\x12\r\n\x05Width\x18\x07 \x01(\x03\x12\x0e\n\x06Height\x18\x08 \x01(\x03\"V\n\nPagination\x12\x0f\n\x07PageCur\x18\x01 \x01(\x03\x12\x10\n\x08PageSize\x18\x02 \x01(\x03\x12\x11\n\tPageTotal\x18\x03 \x01(\x03\x12\x12\n\nTotalCount\x18\x04 \x01(\x03\"\x9c\x01\n\x16\x43\x44NSnapshotHistoryInfo\x12\x41\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32\x33.Volcengine.Live.Models.Business.CDNSnapshotHistory\x12?\n\nPagination\x18\x02 \x03(\x0b\x32+.Volcengine.Live.Models.Business.PaginationB\xd6\x01\n*com.volcengine.service.live.model.businessB\x0eSnapshotManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CDNSNAPSHOTHISTORY = DESCRIPTOR.message_types_by_name['CDNSnapshotHistory'] _PAGINATION = DESCRIPTOR.message_types_by_name['Pagination'] _CDNSNAPSHOTHISTORYINFO = DESCRIPTOR.message_types_by_name['CDNSnapshotHistoryInfo'] CDNSnapshotHistory = _reflection.GeneratedProtocolMessageType('CDNSnapshotHistory', (_message.Message,), { 'DESCRIPTOR' : _CDNSNAPSHOTHISTORY, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CDNSnapshotHistory) }) _sym_db.RegisterMessage(CDNSnapshotHistory) Pagination = _reflection.GeneratedProtocolMessageType('Pagination', (_message.Message,), { 'DESCRIPTOR' : _PAGINATION, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.Pagination) }) _sym_db.RegisterMessage(Pagination) CDNSnapshotHistoryInfo = _reflection.GeneratedProtocolMessageType('CDNSnapshotHistoryInfo', (_message.Message,), { 'DESCRIPTOR' : _CDNSNAPSHOTHISTORYINFO, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CDNSnapshotHistoryInfo) }) _sym_db.RegisterMessage(CDNSnapshotHistoryInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\016SnapshotManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CDNSNAPSHOTHISTORY._serialized_start=73 _CDNSNAPSHOTHISTORY._serialized_end=219 _PAGINATION._serialized_start=221 _PAGINATION._serialized_end=307 _CDNSNAPSHOTHISTORYINFO._serialized_start=310 _CDNSNAPSHOTHISTORYINFO._serialized_end=466 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/base/models/business/stream_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/stream_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!live/business/stream_manage.proto\x12\x1fVolcengine.Live.Models.Business\"\xd1\x01\n\x0eStreamInfoList\x12\n\n\x02ID\x18\x01 \x01(\x03\x12\r\n\x05Vhost\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x0b\n\x03\x41pp\x18\x04 \x01(\t\x12\x0e\n\x06Stream\x18\x05 \x01(\t\x12\x18\n\x10SessionStartTime\x18\x06 \x01(\t\x12\x12\n\nOnlineUser\x18\x07 \x01(\x03\x12\x11\n\tBandWidth\x18\x08 \x01(\x03\x12\x0f\n\x07\x42itrate\x18\t \x01(\x03\x12\x11\n\tFramerate\x18\n \x01(\x03\x12\x12\n\nPreviewURL\x18\x0b \x01(\t\"v\n\x14\x43losedStreamInfoList\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x11\n\tStartTime\x18\x05 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x06 \x01(\x03\"\x88\x01\n\x17\x46orbiddenStreamInfoList\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x12\n\nCreateTime\x18\x05 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x06 \x01(\x03\x12\x0c\n\x04type\x18\x07 \x01(\t\"m\n\x0eLiveStreamInfo\x12G\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32/.Volcengine.Live.Models.Business.StreamInfoList\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\"u\n\x10\x43losedStreamInfo\x12M\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32\x35.Volcengine.Live.Models.Business.ClosedStreamInfoList\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\"5\n\x0fStreamStateInfo\x12\x14\n\x0cstream_state\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"{\n\x13\x46orbiddenStreamInfo\x12P\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32\x38.Volcengine.Live.Models.Business.ForbiddenStreamInfoList\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\x42\xd4\x01\n*com.volcengine.service.live.model.businessB\x0cStreamManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _STREAMINFOLIST = DESCRIPTOR.message_types_by_name['StreamInfoList'] _CLOSEDSTREAMINFOLIST = DESCRIPTOR.message_types_by_name['ClosedStreamInfoList'] _FORBIDDENSTREAMINFOLIST = DESCRIPTOR.message_types_by_name['ForbiddenStreamInfoList'] _LIVESTREAMINFO = DESCRIPTOR.message_types_by_name['LiveStreamInfo'] _CLOSEDSTREAMINFO = DESCRIPTOR.message_types_by_name['ClosedStreamInfo'] _STREAMSTATEINFO = DESCRIPTOR.message_types_by_name['StreamStateInfo'] _FORBIDDENSTREAMINFO = DESCRIPTOR.message_types_by_name['ForbiddenStreamInfo'] StreamInfoList = _reflection.GeneratedProtocolMessageType('StreamInfoList', (_message.Message,), { 'DESCRIPTOR' : _STREAMINFOLIST, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.StreamInfoList) }) _sym_db.RegisterMessage(StreamInfoList) ClosedStreamInfoList = _reflection.GeneratedProtocolMessageType('ClosedStreamInfoList', (_message.Message,), { 'DESCRIPTOR' : _CLOSEDSTREAMINFOLIST, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ClosedStreamInfoList) }) _sym_db.RegisterMessage(ClosedStreamInfoList) ForbiddenStreamInfoList = _reflection.GeneratedProtocolMessageType('ForbiddenStreamInfoList', (_message.Message,), { 'DESCRIPTOR' : _FORBIDDENSTREAMINFOLIST, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ForbiddenStreamInfoList) }) _sym_db.RegisterMessage(ForbiddenStreamInfoList) LiveStreamInfo = _reflection.GeneratedProtocolMessageType('LiveStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _LIVESTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.LiveStreamInfo) }) _sym_db.RegisterMessage(LiveStreamInfo) ClosedStreamInfo = _reflection.GeneratedProtocolMessageType('ClosedStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _CLOSEDSTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ClosedStreamInfo) }) _sym_db.RegisterMessage(ClosedStreamInfo) StreamStateInfo = _reflection.GeneratedProtocolMessageType('StreamStateInfo', (_message.Message,), { 'DESCRIPTOR' : _STREAMSTATEINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.StreamStateInfo) }) _sym_db.RegisterMessage(StreamStateInfo) ForbiddenStreamInfo = _reflection.GeneratedProtocolMessageType('ForbiddenStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _FORBIDDENSTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ForbiddenStreamInfo) }) _sym_db.RegisterMessage(ForbiddenStreamInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\014StreamManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _STREAMINFOLIST._serialized_start=71 _STREAMINFOLIST._serialized_end=280 _CLOSEDSTREAMINFOLIST._serialized_start=282 _CLOSEDSTREAMINFOLIST._serialized_end=400 _FORBIDDENSTREAMINFOLIST._serialized_start=403 _FORBIDDENSTREAMINFOLIST._serialized_end=539 _LIVESTREAMINFO._serialized_start=541 _LIVESTREAMINFO._serialized_end=650 _CLOSEDSTREAMINFO._serialized_start=652 _CLOSEDSTREAMINFO._serialized_end=769 _STREAMSTATEINFO._serialized_start=771 _STREAMSTATEINFO._serialized_end=824 _FORBIDDENSTREAMINFO._serialized_start=826 _FORBIDDENSTREAMINFO._serialized_end=949 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/billing/BillingService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo SERVICE_VERSION = "2022-01-01" class BillingService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(BillingService, "_instance"): with BillingService._instance_lock: if not hasattr(BillingService, "_instance"): BillingService._instance = object.__new__(cls) return BillingService._instance def __init__(self): self.service_info = BillingService.get_service_info() self.api_info = BillingService.get_api_info() super(BillingService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("billing.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'billing', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = {"ListBill": ApiInfo("POST", "/", {"Action": "ListBill", "Version": SERVICE_VERSION}, {}, {}), "ListBillDetail": ApiInfo("POST", "/", {"Action": "ListBillDetail", "Version": SERVICE_VERSION}, {}, {}), "ListBillOverviewByProd": ApiInfo("POST", "/", {"Action": "ListBillOverviewByProd", "Version": SERVICE_VERSION}, {}, {}), "ListSplitBillDetail": ApiInfo("POST", "/", {"Action": "ListSplitBillDetail", "Version": SERVICE_VERSION}, {}, {}), "ListAmortizedCostBillDetail": ApiInfo("POST", "/", {"Action": "ListAmortizedCostBillDetail", "Version": SERVICE_VERSION}, {}, {}), "ListAmortizedCostBillMonthly": ApiInfo("POST", "/", {"Action": "ListAmortizedCostBillMonthly", "Version": SERVICE_VERSION}, {}, {})} return api_info def list_bill(self, params, body): res = self.post("ListBill", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_bill_detail(self, params, body): res = self.post("ListBillDetail", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_bill_overview_by_prod(self, params, body): res = self.post("ListBillOverviewByProd", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_split_bill_detail(self, params, body): res = self.post("ListSplitBillDetail", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_amortized_cost_bill_detail(self, params, body): res = self.post("ListAmortizedCostBillDetail", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_amortized_cost_bill_monthly(self, params, body): res = self.post("ListAmortizedCostBillMonthly", params, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/billing/__init__.py ================================================ ================================================ FILE: volcengine/bioos/BioOsService.py ================================================ # coding:utf-8 import json import threading from urllib.parse import urlparse from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service class BioOsService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(BioOsService, '_instance'): with BioOsService._instance_lock: if not hasattr(BioOsService, '_instance'): BioOsService._instance = object.__new__(cls) return BioOsService._instance def __init__(self, endpoint='https://open.volcengineapi.com', region='cn-beijing'): self.service_info = BioOsService.get_service_info(endpoint, region) self.api_info = BioOsService.get_api_info() super(BioOsService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(endpoint, region): parsed = urlparse(endpoint) scheme, hostname = parsed.scheme, parsed.hostname if not scheme or not hostname: raise Exception(f'invalid endpoint format: {endpoint}') service_info = ServiceInfo(hostname, {'Accept': 'application/json'}, Credentials('', '', 'bio', region), 5, 5, scheme=scheme) return service_info @staticmethod def get_api_info(): api_info = { 'CreateWorkspace': ApiInfo('POST', '/', {'Action': 'CreateWorkspace', 'Version': '2021-03-04'}, {}, {}), 'ListWorkspaces': ApiInfo('POST', '/', {'Action': 'ListWorkspaces', 'Version': '2021-03-04'}, {}, {}), 'UpdateWorkspace': ApiInfo('POST', '/', {'Action': 'UpdateWorkspace', 'Version': '2021-03-04'}, {}, {}), 'DeleteWorkspace': ApiInfo('POST', '/', {'Action': 'DeleteWorkspace', 'Version': '2021-03-04'}, {}, {}), 'BindClusterToWorkspace': ApiInfo('POST', '/', {'Action': 'BindClusterToWorkspace', 'Version': '2021-03-04'}, {}, {}), 'UnbindClusterAndWorkspace': ApiInfo('POST', '/', {'Action': 'UnbindClusterAndWorkspace', 'Version': '2021-03-04'}, {}, {}), 'ListClustersOfWorkspace': ApiInfo('POST', '/', {'Action': 'ListClustersOfWorkspace', 'Version': '2021-03-04'}, {}, {}), 'ListWorkspaceLabels': ApiInfo('POST', '/', {'Action': "ListWorkspaceLabels", 'Version': '2021-03-04'}, {}, {}), 'ListClusters': ApiInfo('POST', '/', {'Action': 'ListClusters', 'Version': '2021-03-04'}, {}, {}), 'DeleteCluster': ApiInfo('POST', '/', {'Action': 'DeleteCluster', 'Version': '2021-03-04'}, {}, {}), 'UpdateAPIAccessKey': ApiInfo('POST', '/', {'Action': 'UpdateAPIAccessKey', 'Version': '2021-03-04'}, {}, {}), 'GetAPIAccessKey': ApiInfo('POST', '/', {'Action': 'GetAPIAccessKey', 'Version': '2021-03-04'}, {}, {}), 'CreateDataModel': ApiInfo('POST', '/', {'Action': 'CreateDataModel', 'Version': '2021-03-04'}, {}, {}), 'ListDataModels': ApiInfo('POST', '/', {'Action': 'ListDataModels', 'Version': '2021-03-04'}, {}, {}), 'ListDataModelRows': ApiInfo('POST', '/', {'Action': 'ListDataModelRows', 'Version': '2021-03-04'}, {}, {}), 'DeleteDataModelRowsAndHeaders': ApiInfo('POST', '/', {'Action': 'DeleteDataModelRowsAndHeaders', 'Version': '2021-03-04'}, {}, {}), 'CreateSubmission': ApiInfo('POST', '/', {'Action': 'CreateSubmission', 'Version': '2021-03-04'}, {}, {}), 'ListSubmissions': ApiInfo('POST', '/', {'Action': 'ListSubmissions', 'Version': '2021-03-04'}, {}, {}), 'ListOverviewSubmissions': ApiInfo('POST', '/', {'Action': 'ListOverviewSubmissions', 'Version': '2021-03-04'}, {}, {}), 'DeleteSubmission': ApiInfo('POST', '/', {'Action': 'DeleteSubmission', 'Version': '2021-03-04'}, {}, {}), 'CancelSubmission': ApiInfo('POST', '/', {'Action': 'CancelSubmission', 'Version': '2021-03-04'}, {}, {}), 'ListRuns': ApiInfo('POST', '/', {'Action': 'ListRuns', 'Version': '2021-03-04'}, {}, {}), 'CancelRun': ApiInfo('POST', '/', {'Action': 'CancelRun', 'Version': '2021-03-04'}, {}, {}), 'ListTasks': ApiInfo('POST', '/', {'Action': 'ListTasks', 'Version': '2021-03-04'}, {}, {}), 'CreateWorkflow': ApiInfo('POST', '/', {'Action': 'CreateWorkflow', 'Version': '2021-03-04'}, {}, {}), 'ListWorkflows': ApiInfo('POST', '/', {'Action': 'ListWorkflows', 'Version': '2021-03-04'}, {}, {}), 'UpdateWorkflow': ApiInfo('POST', '/', {'Action': 'UpdateWorkflow', 'Version': '2021-03-04'}, {}, {}), 'DeleteWorkflow': ApiInfo('POST', '/', {'Action': 'DeleteWorkflow', 'Version': '2021-03-04'}, {}, {}), 'GetNotebookEditInfo': ApiInfo('POST', '/', {'Action': 'GetNotebookEditInfo', 'Version': '2021-03-04'}, {}, {}), 'GetNotebookServerSettings': ApiInfo('POST', '/', {'Action': 'GetNotebookServerSettings', 'Version': '2021-03-04'}, {}, {}), 'GetNotebookServerStat': ApiInfo('POST', '/', {'Action': 'GetNotebookServerStat', 'Version': '2021-03-04'}, {}, {}), 'ListNotebookServerImages': ApiInfo('POST', '/', {'Action': 'ListNotebookServerImages', 'Version': '2021-03-04'}, {}, {}), 'ListNotebookServerResourceOpts': ApiInfo('POST', '/', {'Action': 'ListNotebookServerResourceOpts', 'Version': '2021-03-04'}, {}, {}), 'StopNotebookServer': ApiInfo('POST', '/', {'Action': 'StopNotebookServer', 'Version': '2021-03-04'}, {}, {}), 'UpdateNotebookServerSettings': ApiInfo('POST', '/', {'Action': 'UpdateNotebookServerSettings', 'Version': '2021-03-04'}, {}, {}), 'CreateNotebookServerImage': ApiInfo('POST', '/', {'Action': 'CreateNotebookServerImage', 'Version': '2021-03-04'}, {}, {}), 'ListNotebookServers': ApiInfo('POST', '/', {'Action': 'ListNotebookServers', 'Version': '2021-03-04'}, {}, {}), 'DeleteNotebookServer': ApiInfo('POST', '/', {'Action': 'DeleteNotebookServer', 'Version': '2021-03-04'}, {}, {}), 'DeleteNotebookServerSettings': ApiInfo('POST', '/', {'Action': 'DeleteNotebookServerSettings', 'Version': '2021-03-04'}, {}, {}), 'GetNotebookServerExtraPackages': ApiInfo('POST', '/', {'Action': 'GetNotebookServerExtraPackages', 'Version': '2021-03-04'}, {}, {}), 'ListDataFiles': ApiInfo('POST', '/', {'Action': 'ListDataFiles', 'Version': '2021-03-04'}, {}, {}), 'ListDataSets': ApiInfo('POST', '/', {'Action': 'ListDataSets', 'Version': '2021-03-04'}, {}, {}), 'CreateDataSet': ApiInfo('POST', '/', {'Action': 'CreateDataSet', 'Version': '2021-03-04'}, {}, {}), 'DeleteDataSet': ApiInfo('POST', '/', {'Action': 'DeleteDataSet', 'Version': '2021-03-04'}, {}, {}), 'GetTRSWorkflowInfo': ApiInfo('POST', '/', {'Action': 'GetTRSWorkflowInfo', 'Version': '2021-03-04'}, {}, {}), } return api_info def create_workspace(self, params): """ 创建workspace Args: params (Dict): `Name (str)`: 必选, 工作空间名称 示例值: name `Description (str)`: 必选, 工作空间描述 示例值: description `S3Bucket (str)`: 选填, 对象存储的存储桶名称, 为空表示自动创建 示例值: bioos-wcfxxxxxxxxxxx `CopyPublicWorkspaceID (str)`: 选填, 需要复制其内容的公共工作空间ID 示例值: wcxxxxxxxxxxxxxxxxxxx `CoverPath (str)`: 选填, 封面位于存储桶的路径, 为空表明使用官方第一张图片 示例值: template-cover/pic1.png `Labels (List[str])`: 选填, 工作空间标签 示例值: ["DNA"] Returns: Dict: `ID (str)`: 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx """ return self.__request('CreateWorkspace', params) def list_workspaces(self, params): """ 查询符合条件的workspace列表 Args: params (Dict): `PageNumber (int)`: 选填, 分页页码 示例值: 1 `PageSize (int)`: 选填, 分页页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `Keyword (str)`: 选填, 根据名称筛选 示例值: test `IDs (List[str])`: 选填, ID列表 示例值: ["test"] `IsPublic (bool)`: 选填, 是否公开 示例值: False `Labels (List[str])`: 选填, workspace标签 示例值: ["DNA"] `SortBy (str)`: 选填, 按字段排序 取值有Name CreateTime VisitTime 示例值: CreateTime `SortOrder (str)`: 选填, 指定排序顺序 取值有Asc Desc 示例值: Desc Returns: Dict: `Items (List[Dict])`: Workspace列表 `ID (str)`: 工作空间ID 示例值: wcxxxxxxxxxxxxxxxxxxx `Name (str)`: 工作空间名称 示例值: name `Description (str)`: 工作空间描述 示例值: description `CreateTime (int)`: 工作空间创建时间 示例值: 1673525239 `UpdateTime (int)`: 工作空间更新时间 示例值: 1673525239 `OwnerName (str)`: 创建者名字 示例值: owner `CoverDownloadURL (str)`: 封面地址 示例值: template-cover/pic1.png `Role (str)`: 当前用户对于工作空间角色 示例值: Admin `S3Bucket (str)`: 当前工作空间存储桶 示例值: bioos-wcxxxxxxxxxxxx `PublicMeta (Dict)`: 公共 Workspace 元数据 `TosBucketTotalStorage (int)`: 公共工作空间桶存储占用信息(Gb) 示例值: 20 `Labels (List[str])`: 工作空间标签 示例值: ["DNA"] `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListWorkspaces', params) def update_workspace(self, params): """ 更新workspace Args: params (Dict): `ID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `Name (str)`: 必选, 工作空间名称 示例值: name `Description (str)`: 必选, 工作空间描述 示例值: description `CoverPath (str)`: 选填, 图片位于存储桶的位置, 为空表明使用官方第一张图片 示例值: template-cover/pic1.png `Labels (List[str])`: 选填, 标签全量更新 示例值: ["DNA"] Returns: Dict: `Updated (bool)`: 是否存在内容更新 示例值: False """ return self.__request('UpdateWorkspace', params) def delete_workspace(self, params): """ 删除workspace Args: params (Dict): `ID (str)`: 必选, workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteWorkspace', params) def bind_cluster_to_workspace(self, params): """ 如果workspace内运行工作流,则需要绑定已纳管的集群,已被纳管的集群可通过ListClusters接口查询。 Args: params (Dict): `ID (str)`: 必选, workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `ClusterID (str)`: 必选, 已纳管集群的ID 示例值: ucxxxxxxxxxxxxxxxxxxx `Type (str)`: 必选, 关联类型(workflow、notebook) 示例值: workspace Returns: Dict: empty dictionary """ return self.__request('BindClusterToWorkspace', params) def unbind_cluster_and_workspace(self, params): """ 该接口对已绑定的workspace和cluster进行解绑操作 Args: params (Dict): `ID (str)`: 必选, workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `ClusterID (str)`: 必选, 已纳管集群的ID 示例值: ucxxxxxxxxxxxxxxxxxxx `Type (str)`: 必选, 关联类型(workflow、notebook) 示例值: workspace Returns: Dict: empty dictionary """ return self.__request('UnbindClusterAndWorkspace', params) def list_clusters_of_workspace(self, params): """ 查看workspace所绑定的集群列表 Args: params (Dict): ID (str): 必选, workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx Type (str): 必选, 关联类型(workflow、notebook) 示例值: workflow Returns: Dict: `Items (List[Dict])`: cluster列表 `ClusterInfo (Dict)`: 集群信息 `ID (str)`: 纳管集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx `Name (str)`: 纳管集群名称 示例值: name `Status (str)`: 集群纳管状态(Creating、CreateFailed、Running、Error、Deleting、DeleteFailed、Updating、Stopped) 示例值: Creating `StartTime (int)`: 起始时间 示例值: 1673525239 `Description (str)`: 投递记录描述 示例值: description `ErrorMessage (str)`: 集群纳管过程中出现问题时的错误信息 示例值: err message `Bound (bool)`: 是否存在绑定的 workspace 示例值: False `Public (bool)`: 是否是公共集群 示例值: True `VKEConfig (Dict)`: vke 集群信息 `ClusterID (str)`: vke集群的clusterID,通过https://www.volcengine.com/docs/6460/115190查询 示例值: ccexxxxxxxxxxxxxxxxxx `StorageClass (str)`: vke集群已安装的 StorageClass 的名称 示例值: ebs-ssd `VCIEnabled (bool)`: vke集群是否运行VCI 示例值: True `ExternalConfig (Dict)`: 外部集群配置 `WESEndpoint (str)`: WES 地址 示例值: http://192.168.0.1:8002/ga4gh/wes/v1 `JupyterhubEndpoint (str)`: jupyterhub 地址 示例值: http://jupyterhub-hub:8081/jupyterhub `ResourceScheduler (str)`: 外部资源调度程序 示例值: SGE `Filesystem (str)`: 工作流计算引擎依赖的文件系统(tos, local) 示例值: tos `ExecutionRootDir (str)`: 工作流计算引擎执行根路径, 当且仅当工作流计算引擎依赖的文件系统为 `local` 时会有 示例值: /root `S3ProxyConfig (Dict)`: 文件系统存储的s3proxy代理信息 `Endpoint (str)`: 访问地址 示例值: http://192.168.0.3:8000 `Region (str)`: 区域 示例值: cn-beijing `AccessKey (str)`: 访问s3proxy的AccessKey 示例值: AKxxxx `SecretKey (str)`: 访问s3proxy的SecretKey 示例值: xxxxxx `ForcePathStyle (bool)`: 是否强制使用path style, 还是使用virtual style 示例值: True `SharedConfig (Dict)`: 共享集群配置,暂无具体配置信息 示例值: {} `StoppedTime (int)`: 截止时间 示例值: 1673525239 `Type (str)`: 关联类型(workflow、notebook) 示例值: workflow `BindTime (int)`: 绑定是时间 示例值: 1673525239 `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListClustersOfWorkspace', params) def list_workspace_labels(self, params): """ 获取工作空间的标签列表 Args: params (Dict): `Filter (Dict)`: 选填, 筛选条件 `Exact (bool)`: 选填, 是否精准匹配 示例值: True `MatchPreset (bool)`: 选填, 是否匹配预设标签 示例值: True `IsPublic (bool)`: 选填, 是否查询公开workspace 示例值: True `Keywords (List[str])`: 选填, 匹配列表 示例值: ["DNA"] Returns: Dict: `Items (List[Dict])`: 标签列表 `Name (str)`: 标签名称 示例值: name `Count (int)`: 标签对应的workspace数目 示例值: 10 `TotalCount (int)`: 标签总数 示例值: 10 """ return self.__request('ListWorkspaceLabels', params) def list_clusters(self, params): """ 查看所有集群 Args: params (Dict): `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `IDs (List[str])`: 选填, ID列表 示例值: ["ucxxxxxxxxxxxxxxxxxxx"] `Status (List[str])`: 选填, 集群状态列表 示例值: ["Running"] `Type (List[str])`: 选填, 集群类型(volc-vke, external, shared) 示例值: ["shared"] `Public (bool)`: 选填, 默认为False,若为True,则集群对所有人可见 示例值: True `Keyword (str)`: 选填, 名称模糊匹配 示例值: "test" Returns: Dict: `Items (List[Dict])`: cluster列表 `ID (str)`: 纳管集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx `Name (str)`: 纳管集群名称 示例值: name `Status (str)`: 集群纳管状态(Creating、CreateFailed、Running、Error、Deleting、DeleteFailed、Updating、Stopped) 示例值: Creating `StartTime (int)`: 起始时间 示例值: 1673525239 `Description (str)`: 投递记录描述 示例值: description `ErrorMessage (str)`: 集群纳管过程中出现问题时的错误信息 示例值: err message `Bound (bool)`: 是否存在绑定的 workspace 示例值: False `Public (bool)`: 是否是公共集群 示例值: True `VKEConfig (Dict)`: vke 集群信息 `ClusterID (str)`: vke集群的clusterID,通过https://www.volcengine.com/docs/6460/115190查询 示例值: ccexxxxxxxxxxxxxxxxxx `StorageClass (str)`: vke集群已安装的 StorageClass 的名称 示例值: ebs-ssd `VCIEnabled (bool)`: vke集群是否运行VCI 示例值: True `ExternalConfig (Dict)`: 外部集群配置 `WESEndpoint (str)`: WES 地址 示例值: http://192.168.0.1:8002/ga4gh/wes/v1 `JupyterhubEndpoint (str)`: jupyterhub 地址 示例值: http://jupyterhub-hub:8081/jupyterhub `ResourceScheduler (str)`: 外部资源调度程序 示例值: SGE `Filesystem (str)`: 工作流计算引擎依赖的文件系统(tos, local) 示例值: tos `ExecutionRootDir (str)`: 工作流计算引擎执行根路径, 当且仅当工作流计算引擎依赖的文件系统为 `local` 时会有 示例值: /root `S3ProxyConfig (Dict)`: 文件系统存储的s3proxy代理信息 `Endpoint (str)`: 访问地址 示例值: http://192.168.0.3:8000 `Region (str)`: 区域 示例值: cn-beijing `AccessKey (str)`: 访问s3proxy的AccessKey 示例值: AKxxxx `SecretKey (str)`: 访问s3proxy的SecretKey 示例值: xxxxxx `ForcePathStyle (bool)`: 是否强制使用path style, 还是使用virtual style 示例值: True `SharedConfig (Dict)`: 共享集群配置,暂无具体配置信息 示例值: {} `StoppedTime (int)`: 截止时间 示例值: 1673525239 `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListClusters', params) def delete_cluster(self, params): """ 删除集群 Args: params (Dict): `ID (str)`: 必选, 集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteCluster', params) def update_api_accesskey(self, params): """ 创建或更新集群的API aksk Args: params (Dict): `ClusterID (str)`: 必选, 集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx `AccessKeyID (str)`: 必选, 创建或更新的Access Key ID 示例值: AKxxxxxxxx `SecretAccessKey (str)`: 必选, 创建或更新的Secret Access Key 示例值: xxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('UpdateAPIAccessKey', params) def get_api_accesskey(self, params): """ 获取集群配置的API aksk Args: params (Dict): `ClusterID (str)`: 必选, 集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx Returns: Dict: `AccessKeyID (str)`: 已经配置的Access Key ID, 未配置则为空 """ return self.__request('GetAPIAccessKey', params) def create_data_model(self, params): """ 创建数据模型 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `Name (str)`: 必选, 数据模型文件名 示例值: my_entity `Headers (List[str])`: 必选, 表头列表 示例值: ["my_entity_id","aaa","bbb"] `Rows (List[List[str]])`: 必选, 对象列表 示例值: [["your-sample-3-id","AAA","BBB"]] Returns: Dict: `ID (str)`: 数据模型 ID 示例值: dcxxxxxxxxxxxxxxxxxxx """ return self.__request('CreateDataModel', params) def list_data_models(self, params): """ 查询实体数据模型列表 Args: params (Dict): `WorkspaceID (str)`: 必选, 数据模型所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: `TotalCount (int)`: 数据模型总数 示例值: 10 `Items (List[Dict])`: 列表项 `ID (str)`: 数据模型ID 示例值: dccc0ne5eig41ascop420 `Name (str)`: 数据模型文件名 示例值: test-datamodel `RowCount (int)`: 数据模型行数 示例值: 100 `Type (str)`: 数据模型类型(normal、set、workspace) 示例值: normal """ return self.__request('ListDataModels', params) def list_data_model_rows(self, params): """ 分页查询实体数据模型的详细信息(行和列) Args: params (Dict): `WorkspaceID (str)`: 必选, 数据模型所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `ID (str)`: 必选, Datamodel ID 示例值: dcxxxxxxxxxxxxxxxxxxx `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `Keyword (str)`: 选填, 筛选数据查询 示例值: key `InSetIDs (List[str])`: 选填, 集合表中的实体ID 示例值: ["dcxxxxxxxxxxxxxxxxxxx"] `SortBy (str)`: 选填, 排序字段(默认为id) 示例值: CreateTime `SortOrder (str)`: 选填, 排序顺序(Desc Asc) 示例值: Desc Returns: Dict: `Headers (List[str])`: 表头列表 示例值: ["my_entity_id","aaa","bbb"] `Rows (List[List[str]])`: 对象列表 示例值: [["your-sample-3-id","AAA","BBB"]] `PageNumber (int)`: 分页页码 示例值: 1 `PageSize (int)`: 分页页长 示例值: 10 `TotalCount (int)`: 总条数 示例值: 100 """ return self.__request('ListDataModelRows', params) def delete_data_model_rows_and_headers(self, params): """ 删除实体数据模型的具体行和列 Args: params (Dict): `WorkspaceID (str)`: 必选, 数据模型所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `ID (str)`: 必选, Datamodel ID 示例值: dcxxxxxxxxxxxxxxxxxxx `RowIDs (List[siring])`: 选填, 需要删除的数据模型行ID 示例值: ["0cafd453-e9fd-4147-bc39-0a16e3d4fedd"] `Headers (List[str])`: 选填, 需要删除的数据模型列名 示例值: ["sample_id"] Returns: Dict: empty dictionary """ return self.__request('DeleteDataModelRowsAndHeaders', params) def create_submission(self, params): """ 投递工作流 Args: params (Dict): `WorkspaceID (str)`: 必选, 提交submussion的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `WorkflowID (str)`: 必选, 提交submission所使用的workflow的ID 示例值: fcxxxxxxxxxxxxxxxxxxx `Name (str)`: 必选, 投递名称 示例值: name `Description (str)`: 选填, 投递描述 示例值: description `DataModelID (str)`: 选填, 数据模型ID 示例值: dcxxxxxxxxxxxxxxxxxxx `DataModelRowIDs (List[str])`: 选填, 数据模型行ID 示例值: ["0cafd453-e9fd-4147-bc39-0a16e3d4fedd"] `Inputs (str)`: 必选, 输入配置,json序列化后的string 示例值: {"test.name1":"this.name1","test.name2":"this.name2","test.request":"this.requestFile"} `Outputs (str)`: 必选, 输出配置,json序列化后的string 示例值: {"test.response1":"this.response1","test.response2":"this.response2"} `ExposedOptions (Dict)`: 必选, 平台暴露的Workflow Options `ReadFromCache (bool)`: 必选, 是否开启call-cache 示例值: True `ExecutionRootDir (str)`: 必选, 工作流执行根路径,若为vke集群,则为s3:// + workspace所绑定的桶名,若为外部hpc集群,则为共享文件存储路径,如/share/data 示例值: s3://bioos-wcxxxxxxxxxxxxxxxxxxx `ClusterID (str)`: 必选, 运行集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx Returns: Dict: `ID (str)`: Submission ID 示例值: scxxxxxxxxxxxxxxxxxxx """ return self.__request('CreateSubmission', params) def list_submissions(self, params): """ 查询工作流投递记录列表 Args: params (Dict): `WorkspaceID (str)`: 必选, submission所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `Filter (Dict)`: 选填, 筛选条件 `WorkflowID (str)`: 选填, 根据工作流ID筛选 示例值: fcxxxxxxxxxxxxxxxxxxx `Status (List[str])`: 选填, 根据状态筛选(Succeeded、Failed、Running、Cancelled、Cancelling) 示例值: ["Running","Cancelling"] `ClusterID (str)`: 选填, 根据集群ID筛选 示例值: ucxxxxxxxxxxxxxxxxxxx `Keyword (str)`: 选填, 根据名称筛选 示例值: key `IDs (List[str])`: 选填, 根据submission ID筛选 示例值: ["scxxxxxxxxxxxxxxxxxxx"] `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 Returns: Dict: `Items (List[Dict])`: Workflow 列表 `ID (str)`: 投递记录ID 示例值: scxxxxxxxxxxxxxxxxxxx `Name (str)`: 投递记录名称 示例值: name `Description (str)`: 投递记录描述 示例值: description `Status (str)`: 投递记录状态(Succeeded、Failed、Running、Cancelled、Cancelling) 示例值: Running `RunStatus (Dict)`: 工作流运行状态 `Count (int)`: 工作流运行统计 示例值: 120 `Succeeded (int)`: 运行成功的工作流运行总数 示例值: 90 `Failed (int)`: 运行失败的工作流运行总数 示例值: 5 `Running (int)`: 运行中的工作流运行总数 示例值: 5 `Pending (int)`: 启动中的工作流运行总数 示例值: 5 `Cancelling (int)`: 终止中的工作流运行总数 示例值: 5 `Cancelled (int)`: 已终止的工作流运行总数 示例值: 10 `StartTime(int)`: 起始时间 示例值: 1673525239 `FinishTime(int)`: 截止时间 示例值: 1673525239 `Duration(int)`: 分析耗时(单位为s) 示例值: 10 `WorkflowID (str)`: 工作流ID 示例值: fcxxxxxxxxxxxxxxxxxxx `ClusterID (str)`: 集群ID 示例值: ucxxxxxxxxxxxxxxxxxxx `ClusterType (str)`: 集群类型(volc-vke、external、shared)若集群不存在则为空 示例值: shared `DataModelID (str)`: 数据实体ID 示例值: dcxxxxxxxxxxxxxxxxxxx `Inputs (str)`: 输入配置, json序列化后的字符串 示例值: {"test.name1":"this.name1", "test.name2":"this.name2", "test.request":"this.requestFile"} `Outputs (str)`: 输出配置, json序列化后的字符串 示例值: {"test.response1":"this.response1", "test.response2":"this.response2"} `ExposeOptions (Dict)`: 平台暴露的Workflow Options `ReadFromCache (bool)`: 是否开启读call-cache功能 示例值: False `ExecutionRootDir (str)`: 工作流执行根路径 示例值: /root `OwnerName (str)`: 创建者名称 示例值: name `DataEntity (Dict)`: 数据实体统计 `ID (str)`: 数据实体ID 示例值: dcxxxxxxxxxxxxxxxxxxx `Name (str)`: 数据实体名称 示例值: name `RowIDs (List[str])`: 数据实体行IDs 示例值: ["1"] `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListSubmissions', params) def list_overview_submissions(self, params): """ 获取全局投递列表 Args: params (Dict): `PageNumber (int)`: 选填, 分页页码 示例值: 1 `PageSize (int)`: 选填, 分页页长 示例值: 10 `SortBy (str)`: 选填, 按字段排序(OwnerName StartTime) 示例值: OwnerName `SortOrder (str)`: 选填, 排序顺序 示例值: Desc Returns: Dict: `Items (List[Dict])`: 投递记录列表 `ID (str)`: 投递记录 ID 示例值: scxxxxxxxxxxxxxxxxxxx `Name (str)`: 投递记录名称 示例值: name `WorkspaceID (str)`: 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `WorkspaceName (str)`: 工作空间名称 示例值: name `OwnerUserID (int)`: 创建者用户ID 仅子账号有值 示例值: 123456 `OwnerName (str)`: 创建者名称 示例值: name `Description (str)`: 投递记录描述 示例值: description `Status (str)`: 投递记录状态 Succeeded,Failed,Running,Cancelled,Cancelling 示例值: Succeeded `StartTime (int)`: 起始时间 示例值: 1673525239 `Duration (int)`: 分析耗时(单位为s) 示例值: 10 `WorkflowID (str)`: 工作流 ID 示例值: fcxxxxxxxxxxxxxxxxxxx `PageNumber (int)`: 分页页码 示例值: 1 `PageSize (int)`: 分页页长 示例值: 10 `TotalCount (int)`: 总条数 示例值: 100 """ return self.__request('ListOverviewSubmissions', params) def delete_submission(self, params): """ 删除工作流投递记录 Args: params (Dict): `ID (str)`: 必选, 投递记录 ID 示例值: scxxxxxxxxxxxxxxxxxxx `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteSubmission', params) def cancel_submission(self, params): """ 终止工作流投递记录 Args: params (Dict): `ID (str)`: 必选, 投递记录 ID 示例值: scxxxxxxxxxxxxxxxxxxx `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('CancelSubmission', params) def list_runs(self, params): """ 查询工作流运行列表 Args: params (Dict): `WorkspaceID (str)`: 必选, submission所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `SubmissionID (str)`: 必选, submission的ID 示例值: scxxxxxxxxxxxxxxxxxxx `Filter (Dict)`: 选填, 筛选条件 `Keyword (str)`: 选填, 运行记录关键字 示例值: key `IDs (List[str])`: 选填, 运行记录ID列表 示例值: ["rcxxxxxxxxxxxxxxxxxxx"] `Status (List[str])`: 选填, 根据状态筛选(Pending、Running、Succeeded、Failed、Cancelling、Cancelled) 示例值: ["Pending","Running"] `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 Returns: Dict: `Items (List[Dict])`: Run列表 `ID (str)`: 运行记录ID 示例值: rcxxxxxxxxxxxxxxxxxxx `DataEntityRowID (str)`: 数据实体 RowID 示例值: 1 `Status (str)`: 投递记录状态(Succeeded、Failed、Running、Pending、Cancelling、Cancelled) 示例值: Running `StartTime (int)`: 起始时间 示例值: 1673525239 `FinishTime (int)`: 截止时间 示例值: 1673525239 `Duration (int)`: 分析耗时(单位为s) 示例值: 10 `SubmissionID (str)`: 投递记录ID 示例值: scxxxxxxxxxxxxxxxxxxx `EngineRunID (str)`: 工作流引擎内运行记录 ID 示例值: 05693535-dcf4-404f-8d18-2d3cac29916b `Inputs (str)`: 运行记录输入参数,json 序列化后的 string 示例值: {"test.name1":"world","test.name2":"hello","test.request":"s3://vci-dev/jxc-test/aaa.txt"} `Outpus (str)`: 运行记录输出参数,json 序列化后的 string 示例值: {"test.resp":"abc", "test.response1":"s3://bioos-dev-wcb1e3v5eig4635iurevg/analysis/scb8gbtleig4f4jqjbtlg/test/d9ea2df5-b8d8-4603-9f62-496229e922c9/call-step21/execution/resp.txt", "test.response2":"s3://bioos-dev-wcb1e3v5eig4635iurevg/analysis/scb8gbtleig4f4jqjbtlg/test/d9ea2df5-b8d8-4603-9f62-496229e922c9/call-step22/execution/resp.txt"} `TaskStatus (Dict)`: 工作流运行详情状态统计 `Count (int)`: 任务运行统计 示例值: 120 `Succeeded (int)`: 运行成功的工作流运行总数 示例值: 90 `Failed (int)`: 运行失败的工作流运行总数 示例值: 5 `Running (int)`: 运行中的工作流运行总数 示例值: 5 `Queued (int)`: 排队中的工作流运行总数 示例值: 5 `Initializing (int)`: 启动中的工作流运行总数 示例值: 5 `Cancelled (int)`: 已终止的工作流运行总数 示例值: 10 `Log (str)`: 运行记录日志存储路径 示例值: s3://bioos-wcxxxxxxxxxxxxxxxxxxx/analysis/scxxxxxxxxxxxxxxxxxxx/workflow.941846fb-158d-4d49-82e0-f2f39372e9e3.log `Message (str)`: 运行记录错误详情 示例值: error message `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListRuns', params) def cancel_run(self, params): """ 取消工作流运行 Args: params (Dict): `ID (str)`: 必选, 运行记录 ID 示例值: `WorkspaceID (str)`: 必选, 工作空间ID 示例值: Returns: Dict: empty dictionary """ return self.__request('CancelRun', params) def list_tasks(self, params): """ 查询工作流的task任务列表 Args: params (Dict): `WorkspaceID (str)`: 必选, submission所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `RunID (str)`: 必选, 运行记录ID 示例值: rcxxxxxxxxxxxxxxxxxxx `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 Returns: Dict: `Items (List[Dict])`: Task列表 `Name (str)`: 任务名称 示例值: name `RunID (str)`: 运行记录 ID 示例值: rcxxxxxxxxxxxxxxxxxxx `Status (str)`: 任务状态,Succeeded -> 分析成功, Failed -> 分析失败, Running -> 分析中, Queued -> 排队中, Initializing -> 启动中, Cancelled -> 已终止 示例值: Succeeded `StartTime (int)`: 起始时间 示例值: 1687143483 `FinishTime (int)`: 截止时间 示例值: 1687143668 `Duration (int)`: 分析耗时(单位为s) 示例值: 185 `Log (str)`: 任务日志存储路径 示例值: s3://bioos-wcxxxxxxxxxxxxxxxxxxx/analysis/scxxxxxxxxxxxxxxxxxxx/workflow.941846fb-158d-4d49-82e0-f2f39372e9e3.log `Stdout (str)`: 任务输出存储路径 示例值: s3://bioos-wcxxxxxxxxxxxxxxxxxxx/analysis/scxxxxxxxxxxxxxxxxxxx/melt/cd28ec5b-75df-4981-a7f5-90f1deba8a94/call-step1/shard-0/execution/stdout `Stderr (str)`: 任务错误存储路径 示例值: s3://bioos-wcxxxxxxxxxxxxxxxxxxx/analysis/scxxxxxxxxxxxxxxxxxxx/melt/cd28ec5b-75df-4981-a7f5-90f1deba8a94/call-step1/shard-0/execution/stderr `ExecuteDuration (int)`: 实际运行分析耗时(单位为s) 示例值: 0 `JobName (str)`: job名称 示例值: task-xxxxxxxx-ex-00 `resourceClaimed (Dict)`: 资源申领 `CPUCore (int)`: CPU 核数 示例值: 1 `MemoryGiB (int)`: 内存大小,单位GiB 示例值: 2 `StorageGiB (int)`: 存储大小,单位GiB 示例值: 2 `GPUGiB (int)`: GPU显存大小,单位GiB 示例值: 2 `resourceUsed (Dict)`: 资源消耗 `CPUCore (int)`: CPU 核数 示例值: 1 `MemoryGiB (int)`: 内存大小,单位GiB 示例值: 2 `StorageGiB (int)`: 存储大小,单位GiB 示例值: 2 `GPUGiB (int)`: GPU显存大小,单位GiB 示例值: 2 `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListTasks', params) def create_workflow(self, params): """ 此接口为异步接口,当此接口返回成功时,会返回导入的workflowID信息,此时并不代表workflow导入成功, 需要调用ListWorkflows接口查看workflow导入情况,其返回的参数WorkflowImportStatus如果为Succeeded则为导入成功。 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `Name (str)`: 必选, 工作流名称 示例值: name `Description (str)`: 选填, 工作流描述 示例值: description `Language (str)`: 必选, 语言类型, 包括 WDL/CWL/Nextflow 示例值: WDL `Source (str)`: 选填, 来源, http(s) 开头的地址, 为 file 来源类型时不填 示例值: https://aaa.bbb.git `Tag (str)`: 选填, tag, 为 dockstore 来源类型时对应 version, 为 file 来源类型时不填 示例值: v1.0.0 `Token (str)`: 选填, git token, 为 dockstore/file 来源类型时不填 示例值: `MainWorkflowPath (str)`: 选填, 主工作流文件路径, 为 dockstore 来源时不填 示例值: main.wdl `SourceType (str)`: 必选, 来源类型, 包括 git dockstore file 示例值: git `Content (bytes)`: 选填, 文件导入的二进制 zip 包 base64 编码 示例值: Returns: Dict: `ID (str)`: WorkflowID 示例值: wcxxxxxxxxxxxxxxxxxxx """ return self.__request('CreateWorkflow', params) def list_workflows(self, params): """ 查询符合条件的workflows列表 Args: params (Dict): `WorkspaceID (str)`: 必选, workflow所在的workspaceID 示例值: wcxxxxxxxxxxxxxxxxxxx `PageNumber (int)`: 选填, 页码 示例值: 1 `PageSize (int)`: 选填, 页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `Keyword (str)`: 选填, 根据名称筛选 示例值: key `IDs (List[str])`: 选填, ID列表 示例值: ["wcxxxxxxxxxxxxxxxxxxx"] `SortBy (str)`: 选填, 排序字段(Name CreateTime) 示例值: CreateTime `SortOrder (str)`: 选填, 排序顺序(Desc Asc) 示例值: Desc Returns: Dict: `Items (List[Dict])`: Workflow 列表 `ID (str)`: 工作流 ID 示例值: fcxxxxxxxxxxxxxxxxxxx `Name (str)`: 工作流名称 示例值: name `Description (str)`: 工作流描述 示例值: description `CreateTime (int)`: 创建时间 示例值: 1673525239 `UpdateTime (int)`: 更新时间 示例值: 1673525239 `Language (str)`: 语言类型 示例值: WDL `Source (str)`: 来源, http(s) 开头的地址 示例值: https://aaa.bbb.git `Tag (str)`: tag 示例值: master `Token (str)`: token 示例值: `MainWorkflowPath (str)`: 主工作流文件路径 示例值: main.wdl `Status (Dict)`: workflow导入状态 `Phase (str)`: workflow导入状态(Importing、Succeeded、Failed) 示例值: Succeeded `Message (str)`: 导入失败原因,Phase为Failed时有效 示例值: `Inputs (Dict)`: wdl的intput信息 `Name (str)`: 参数名称 示例值: test `Type (str)`: 参数类型 示例值: String `Optional (bool)`: 是否是可选参数 示例值: True `Default (str)`: 默认值 示例值: test `Outputs (Dict)`: wdl的output信息 `Name (str)`: 参数名称 示例值: test `Type (str)`: 参数类型 示例值: String `Optional (bool)`: 是否是可选参数 示例值: True `Default (str)`: 默认值 示例值: test `OwnerName (str)`: 创建者名称 示例值: name `Graph (str)`: wdl graph 示例值: `SourceType (str)`: 来源类型, 包括git dockstore 示例值: git `PageNumber (int)`: 页码 示例值: 1 `PageSize (int)`: 页长 示例值: 10 `TotalCount (int)`: 总数量 示例值: 10 """ return self.__request('ListWorkflows', params) def update_workflow(self, params): """ 该接口的使用方式与CreateWorkflow类型一样,都需要ListWorkflows接口查看状态 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `ID (str)`: 必选, 工作流 ID 示例值: fcxxxxxxxxxxxxxxxxxxx `Name (str)`: 必选, 工作流名称 示例值: name `Description (str)`: 选填, 工作流描述 示例值: description `Source (str)`: 选填, 来源, http(s) 开头的地址, 为 file 来源类型时不填 示例值: https://aaa.bbb.git `Tag (str)`: 选填, tag, 为 dockstore 来源类型时对应 version, 为 file 来源类型时不填 示例值: master `Token (str)`: 选填, token, 为 dockstore/file 来源类型时不填 示例值: `MainWorkflowPath (str)`: 选填, 主工作流文件路径, 为 dockstore 来源时不填 示例值: main.wdl `Content (bytes)`: 选填, 文件导入的二进制 zip 包 示例值: Returns: Dict: empty dictionary """ return self.__request('UpdateWorkflow', params) def delete_workflow(self, params): """ 删除工作流 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `ID (str)`: 必选, 工作流 ID 示例值: fcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteWorkflow', params) def get_notebook_edit_info(self, params): """ 启动Notebook Server并获取访问链接 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `Name (str)`: 选填, Notebook文件名 对于Dashboard则为__dashboard__ 示例值: __dashboard__ Returns: Dict: `URL (str)`: jupyter访问链接 示例值: https://bioos-xxx.xxx.volcanicengine.com/notebook-01/user/ucxxxxxxxxxxxxxxxxxxx/wcxxxxxxxxxxxxxxxxxxx """ return self.__request('GetNotebookEditInfo', params) def get_notebook_server_settings(self, params): """ 获取当前Notebook Server配置信息 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: `ResourceSize (str)`: 资源规格,如果从未配置过返回"" small,middle,large等 示例值: small `ImageID (str)`: 镜像 ID,如果从未配置过返回"" 示例值: 1 `TempImageName (str)`: 临时镜像名,如果从未配置过返回"" 示例值: jupyter/minimal-notebook `MountTOSEnabled (bool)`: 是否挂载TOS桶 示例值: True `StorageCapacity (int)`: 存储容量(byte) 示例值: 107374182400 """ return self.__request('GetNotebookServerSettings', params) def get_notebook_server_stat(self, params): """ 获取当前Notebook Server状态 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: `Status (str)`: Server当前状态, spawn,ready,stop,absent 示例值: spawn `TOSAccessible (str)`: TOS挂载生效状态 取值有 OK ClusterNotSupport AccessKeyNotSet AccessKeyInvalid CSINotInstall CSINotReady BucketNotExist 示例值: OK """ return self.__request('GetNotebookServerStat', params) def list_notebook_server_images(self, params): """ 列举Notebook Server镜像信息 Args: params (Dict): `ImageIDs (List[str])`: 选填, 镜像ID,不传则返回所有 示例值: ["1","2"] `Source (str)`: 选填, 镜像来源 official,customized 示例值: official `Status (str)`: 选填, 镜像审核状态 pending,approve,reject 示例值: pending `DisplayName (str)`: 选填, 镜像名 示例值: `ImageName (str)`: 选填, 镜像地址 示例值: python:latest `OwnByMe (bool)`: 选填, 是否仅查看当前登录者所建镜像 示例值: True `PageNumber (int)`: 分页页码 示例值: 1 `PageSize (int)`: 分页页长 示例值: 10 `SortBy (str)`: 按字段排序, 取值有CreateTime ID 示例值: CreateTime `SortOrder (str)`: 排序顺序, Desc Asc 示例值: Desc Returns: Dict: `Images (List[Dict])`: 镜像信息列表 `ImageID (str)`: 镜像 ID 示例值: 1 `DisplayName (str)`: 镜像名称(展示用) 示例值: minimal-notebook `ImageName (str)`: 镜像名称 示例值: jupyter/minimal-notebook `Description (str)`: 描述 示例值: description `AccountID (int)`: 创建者主账户ID 示例值: 0 `UserID (int)`: 创建者租户ID 示例值: 0 `Status (str)`: 镜像状态 pending,approve,building,failure 示例值: pending `Source (str)`: 镜像来源 official,building 示例值: official `Packages (Dict)`: 工具包 `Pip (Dict[str, str])`: pip工具包 示例值: {"numpy":"1.22.2"} `Conda (Dict[str, str])`: conda工具包 示例值: {"numpy":"1.22.2"} `R (Dict[str, str])`: R工具包 示例值: {"ggplot2":"3.4.4"} `APT (Dict[str, str])`: apt工具包 示例值: {"python3-dev":"1.22.2"} `BasicEnv (List[str])`: 基础环境参数,如python3.8等 示例值: ["Python3.9.10", "R 4.1.2", "Julia 1.7.2"] `ImageVersion (str)`: 镜像版本 示例值: 1.0.0 `CreateTime (int)`: 创建时间 示例值: 1680554098 `UpdateTime (int)`: 更新时间 示例值: 1680554098 """ return self.__request('ListNotebookServerImages', params) def list_notebook_server_resource_opts(self, params): """ 列举Notebook Server可用资源配置 Args: params (Dict): empty dictionary Returns: Dict: `ResourceSize (List[Dict])`: 资源规格 `ResourceSize (str)`: 资源规格枚举 small,middle,large等 示例值: small `Cpu (int)`: 资源规格内容 cpu内核数(个) 示例值: 2 `Memory (int)`: 资源规格内容 memory大小(byte) 示例值: 8589934592 """ return self.__request('ListNotebookServerResourceOpts', params) def stop_notebook_server(self, params): """ 即时暂停当前Notebook Server Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('StopNotebookServer', params) def update_notebook_server_settings(self, params): """ 更新Notebook Server配置并异步暂停当前Notebook Server Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `ResourceSize (str)`: 选填, 资源规格,没变化则不传 small,middle,large 示例值: small `ImageID (str)`: 选填, 镜像 ID,没变化则不传,与临时镜像名字端互斥 示例值: 1 `MountTOSEnabled (bool)`: 选填, 是否挂载TOS桶,没变化则不传 示例值: False `TempImageName (str)`: 选填, 临时镜像名,没变化则不传,与镜像ID字段互斥 示例值: jupyter/minimal-notebook Returns: Dict: empty dictionary """ return self.__request('UpdateNotebookServerSettings', params) def create_notebook_server_image(self, params): """ 创建Notebook Server镜像 Args: params (Dict): `BaseImage (str)`: 必选, 基础镜像。仅building镜像需要 示例值: python:latest `ImageName (str)`: 必选, 镜像名称 示例值: custom:v1.0.0 `DisplayName (str)`: 必选, 镜像名称(展示用) 示例值: custom `Description (str)`: 选填, 镜像描述 示例值: description `BuildScript (str)`: 选填, 构建镜像中需要执行的shell脚本内容 示例值: `Source (str)`: 必选, 镜像来源, 取值为building 示例值: building `Packages (Dict)`: 必选, 工具包 `Pip (Dict[str, str])`: 选填, pip工具包 示例值: {"numpy":"1.22.2"} `Conda (Dict[str, str])`: 选填, conda工具包 示例值: {"numpy":"1.22.2"} `R (Dict[str, str])`: 选填, R工具包 示例值: {"ggplot2":"3.4.4"} `APT (Dict[str, str])`: 选填, apt工具包 示例值: {"python3-dev":"1.22.2"} `BasicEnv (List[str])`: 选填, 基础环境参数,如python3.8等 示例值: ["Python3.9.10", "R 4.1.2", "Julia 1.7.2"] `ImageVersion (str)`: 必选, 镜像版本 示例值: 1.0.0 """ return self.__request('CreateNotebookServerImage', params) def list_notebook_servers(self, params): """ 获取全局Notebook Server列表 Args: params (Dict): `PageNumber (int)`: 选填, 分页页码 示例值: 1 `PageSize (int)`: 选填, 分页页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `Status (List[str])`: 选填, 筛选状态(spawn,ready,stop,absent) 示例值: spawn `WorkspaceID (str)`: 选填, 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `UserID (int)`: 选填, 创建者用户ID 查主账号时则填0 示例值: 123456 `SortBy (str)`: 选填, 按字段排序(OwnerName StartTime StorageCapacity LastActivityTime) 示例值: OwnerName `SortOrder (str)`: 选填, 排序顺序 示例值: Desc Returns: Dict: List[Dict]: Items, 列表 `Name (str)`: 名称 示例值: name `WorkspaceID (str)`: 工作空间 ID 示例值: wcxxxxxxxxxxxxxxxxxxx `WorkspaceName (str)`: 工作空间名称 示例值: name `UserID (int)`: 创建者用户ID 主账号则为空 示例值: 123456 `OwnerName (str)`: 创建者名称 示例值: ownerName `StorageCapacity (int)`: 存储容量(byte) 示例值: 107374182400 `Status (str)`: Server当前状态(spawn,ready,stop,absent) 示例值: spawn `LastActivityTime (int)`: 最近活跃时间 示例值: 1691493675 `StartTime (int)`: 创建时间 示例值: 1691493674 `Duration (int)`: 使用时长(单位为s) 示例值: 1 `TotalCount (int)`: 总条数 示例值: 10 """ return self.__request('ListNotebookServers', params) def delete_notebook_server(self, params): """ 删除当成Notebook Server Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间ID 示例值: wcxxxxxxxxxxxxxxxxxxx `UserID (int)`: 选填, 子用户ID,不传代表操作主账号 示例值: 123456 Returns: Dict: empty dictionary """ return self.__request('DeleteNotebookServer', params) def delete_notebook_server_settings(self, params): """ 删除当成Notebook Server配置信息 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteNotebookServerSettings', params) def get_notebook_server_extra_packages(self, params): """ 获取当前Notebook Server安装的额外包信息 Args: params (Dict): `WorkspaceID (str)`: 必选, 工作空间ID 示例值: wcxxxxxxxxxxxxxxxxxxx Returns: Dict: `ExtraPackages (Dict)`: 额外工具包 `Pip (Dict[str, str])`: 选填, pip工具包 示例值: {"numpy":"1.22.2"} `Conda (Dict[str, str])`: 选填, conda工具包 示例值: {"numpy":"1.22.2"} `R (Dict[str, str])`: 选填, R工具包 示例值: {"ggplot2":"3.4.4"} `APT (Dict[str, str])`: 选填, apt工具包 示例值: {"python3-dev":"1.22.2"} """ return self.__request('GetNotebookServerExtraPackages', params) def list_data_files(self, params): """ 获取数据集文件列表 Args: params (Dict): `DataSetID (str)`: 必选, 数据集ID 示例值: tcxxxxxxxxxxxxxxxxxxx `PageNumber (int)`: 选填, 分页页码 示例值: 1 `PageSize (int)`: 选填, 分页页长 示例值: 10 `Filter (Dict)`: 选填, 筛选条件 `IDs (List[str])`: 选填, 数据集ID 示例值: ["tcxxxxxxxxxxxxxxxxxxx"] `FileType (List[str])`: 选填, 文件类型列表 示例值: ["csv"] `Keyword (str)`: 选填, 模糊匹配名称/描述 示例值: key `SortBy (str)`: 选填, 按字段排序(Name CreateTime UpdateTime FileSize) 示例值: Name `SortOrder (str)`: 选填, 排序顺序 示例值: Desc Returns: Dict: `Items (List[Dict])`: 数据文件列表 `ID (str)`: 数据文件ID 示例值: ecxxxxxxxxxxxxxxxxxxx `Name (str)`: 名称 示例值: name `Description (str)`: 描述 示例值: description `CreateTime (int)`: 创建时间 示例值: 1691493674 `UpdateTime (int)`: 更新时间 示例值: 1691493674 `FileType (str)`: 文件类型 示例值: csv `FileSize (int)`: 文件大小(byte) 示例值: 123 `Source (str)`: 数据来源 示例值: https://cromwell.tos-xxx.volces.com/xxx.csv `DRSURL (str)`: DRS 路径 示例值: drs://drs.xxx.xxx.com/ecxxxxxxxxxxxxxxxxxxx `SampleRow (List[str])`: 数据文件样本信息 示例值: ["test", "测试", "2011-01-02", "2011-01-02", "txt", "", "s3://xxx/test.txt"] `PageNumber (int)`: 分页页码 示例值: 1 `PageSize (int)`: 分页页长 示例值: 10 `TotalCount (int)`: 总条数 示例值: 100 """ return self.__request('ListDataFiles', params) def list_data_sets(self, params): """ 获取数据集列表 Args: params (Dict): `PageNumber (int)`: 选填, 分页页码 示例值: 1 `PageSize (int)`: 选填, 分页页长 示例值: 10 `Filter (Dict)`: 选填, 过滤条件 `IDs (List[str])`: 选填, 数据集ID 示例值: ["tcxxxxxxxxxxxxxxxxxxx"] `ProjectDataTypes (List[str])`: 选填, 项目数据类型列表 ID 示例值: `Categories (List[str])`: 选填, 项目数据类型 ID 列表 示例值: ["示例数据"] `Keyword (str)`: 选填, 模糊匹配名称/描述/所有者 示例值: key `Owner (str)`: 选填, 模糊匹配数据所有者 示例值: ownerName `Catalogues (List[str])`: 选填, 数据集编目列表 ID 示例值: 【“OMICSDATA”】 `SortBy (str)`: 选填, 按字段排序(Name CreateTime) 示例值: Name `SortOrder (str)`: 选填, 排序顺序 示例值: Desc Returns: Dict: `Items (List[Dict])`: 数据集列表 `ID (str)`: 数据集ID 示例值: tcxxxxxxxxxxxxxxxxxxx `Name (str)`: 名称 示例值: name `Description (str)`: 描述 示例值: desc `CreateTime (int)`: 创建时间 示例值: 1691493674 `UpdateTime (int)`: 更新时间 示例值: 1691493674 `Owners (List[str])`: 数据集所有者 示例值: ["owner1", "owner2"] `Admin (str)`: 数据集管理员 示例值: admin `Category (str)`: 领域 ID 列表 示例值: 示例数据 `Labels (List[str])`: 标签 ID 列表 示例值: ["demo"] `DocURL (str)`: 帮助文档链接 示例值: https://console.volcengine.com/bioos/region:bioos+cn-beijing/public-workspace/wcxxxxxxxxxxxxxxxxxxx/dashboard `Email (str)`: email 示例值: bioos@xxx.xxx `Licence (str)`: 许可/使用条款 示例值: MIT `ProjectDataTypes (List[str])`: 项目数据类型列表 ID 示例值: `SampleScope (str)`: 样本范围 示例值: 111 `ExternalLink (str)`: 外部链接 示例值: https://bytedance.feishu.cn/docx/Mcxxxxxxxxxxxxxxxxxxxx `ExternalLinkDescription (str)`: 外部链接描述 示例值: description `ExampleTutorial (str)`: 示例教程 示例值: 111 `Tools (str)`: 工具/应用 示例值: https://bytedance.feishu.cn/docx/Mcxxxxxxxxxxxxxxxxxxxx `Publications (List[Dict])`: 出版物 `ID (str)`: 出版物 ID 示例值: pcxxxxxxxxxxxxxxxxxxx `Name (str)`: 名称 示例值: name `AccessURL (str)`: 在线地址 示例值: http://222.com `Authors (List[str])`: 作者 示例值: ["author1", "author2"] `Quotation (str)`: 引文 示例值: `SampleHeaders (List[str])`: 数据文件样本信息表头 示例值: ["文件名", "文件描述", "建立时间", "更新时间", "文件类型", "数据来源", "数据路径"] `CustomHeaderOrders (Dict[str, str])`: 数据文件自定义表头顺序 示例值: `CollectedBy (str)`: 被收藏的数据项目 ID 示例值: ocxxxxxxxxxxxxxxxxxxx `Catalogue (str)`: 数据集编目 ID 示例值: OMICSDATA `PageNumber (int)`: 分页页码 示例值: 1 `PageSize (int)`: 分页页长 示例值: 10 `TotalCount (int)`: 总条数 示例值: 100 """ return self.__request('ListDataSets', params) def create_data_set(self, params): """ 创建数据集 Args: params (Dict): `Name (str)`: 必选, 名称 示例值: name `Description (str)`: 必选, 描述 示例值: description `CreateTime (int)`: 必选, 创建时间 示例值: 1691493674 `UpdateTime (int)`: 必选, 更新时间 示例值: 1691493674 `Owners (List[str])`: 必选, 用户 示例值: ["user1", "user2"] `Category (str)`: 必选, 领域 ID 列表 示例值: 示例数据 `Labels (List[str])`: 选填, 标签 ID 列表 示例值: ["demo"] `DocURL (str)`: 必选, 帮助文档链接 示例值: https://console.volcengine.com/bioos/region:bioos+cn-beijing/public-workspace/wcxxxxxxxxxxxxxxxxxxx/dashboard `Email (str)`: 必选, email 示例值: bioos `Licence (str)`: 选填, 许可/使用条款 示例值: MIT `ProjectDataTypes (List[str])`: 选填, 项目数据类型列表 示例值: `SampleScope (str)`: 选填, 样本范围 示例值: 111 `ExternalLink (str)`: 选填, 外部链接 示例值: https://bytedance.feishu.cn/docx/Mcxxxxxxxxxxxxxxxxxxxx `ExternalLinkDescription (str)`: 选填, 外部链接描述 示例值: description `ExampleTutorial (str)`: 选填, 示例教程 示例值: `Tools (str)`: 选填, 工具/应用 示例值: `Catalogue (str)`: 必选, 数据集编目 ID 示例值: OMICSDATA `Publications (List[Dict])`: 选填, 出版物 `Name (str)`: 必选, 名称 示例值: name `AccessURL (str)`: 选填, 在线地址 示例值: http://222.com `Authors (List[str})`: 选填, 作者 示例值: ["author1", "author2"] `Quotation (str)`: 选填, 引文 示例值: `DataFilesAccessURL (str)`: 选填, 数据文件 csv 下载路径 示例值: `DataFileSamplesAccessURL (str)`: 选填, 数据文件样本信息 csv 下载路径 示例值: `DataFileAccessMethodURL (str)`: 选填, 数据文件访问方法文件下载路径 示例值: Returns: Dict: `ID (str)`: 数据集ID 示例值: tcxxxxxxxxxxxxxxxxxxx """ return self.__request('CreateDataSet', params) def delete_data_set(self, params): """ 删除数据集 Args: params (Dict): `ID (str)`: 必选, 数据集 ID 示例值: tcxxxxxxxxxxxxxxxxxxx Returns: Dict: empty dictionary """ return self.__request('DeleteDataSet', params) def get_trs_workflow_info(self, params): """ 查询trs工作流信息 Args: params (Dict): `TRSServer (str)`: 必选, trs Server地址 示例值: https://dockstore.org `ID (str)`: 必选, trs ID 示例值: #workflow/github.com/aaa/bbb/ccc Returns: Dict: `Name (str)`: trs工作流名称 示例值: name `Description (str)`: trs工作流描述 示例值: description `VersionsInfo (List[Dict])`: trs工作流具体版本信息 `Name (str)`: 版本名称 示例值: master `Language (str)`: 语言类型, 包括 WDL/CWL/Nextflow 示例值: WDL """ return self.__request('GetTRSWorkflowInfo', params) def __request(self, action, params): res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception('empty response') res_json = json.loads(res) if 'Result' not in res_json.keys(): return res_json return res_json['Result'] ================================================ FILE: volcengine/bioos/README.md ================================================ ## Example 调用代码示例均在`volcengine/example/bioos`文件夹下 运行代码方式为在根目录下执行 ```bash python volcengine/example/bioos/example_xxx_xxx.py ``` ## Sphinx文档 在**volcengine/bioos/doc**目录下执行下列命令生成html文件 ```bash make html ``` 接着进入生成的build/html目录执行下列命令启动服务 ```bash python -m http.server ${port} ``` 最后在偏好的浏览器中输入`127.0.0.1:${port}`查看文档 ## 接口文档 文档链接请点击[这里](https://www.volcengine.com/docs/6971) ================================================ FILE: volcengine/bioos/__init__.py ================================================ ================================================ FILE: volcengine/bioos/doc/Makefile ================================================ # Minimal makefile for Sphinx documentation # # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) ================================================ FILE: volcengine/bioos/doc/__init__.py ================================================ ================================================ FILE: volcengine/bioos/doc/make.bat ================================================ @ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source set BUILDDIR=build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.https://www.sphinx-doc.org/ exit /b 1 ) if "%1" == "" goto help %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd ================================================ FILE: volcengine/bioos/doc/source/__init__.py ================================================ ================================================ FILE: volcengine/bioos/doc/source/bioos.rst ================================================ bioos =============================== 工作空间 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.create_workspace .. autofunction:: bioos.BioOsService.BioOsService.list_workspaces .. autofunction:: bioos.BioOsService.BioOsService.update_workspace .. autofunction:: bioos.BioOsService.BioOsService.delete_workspace .. autofunction:: bioos.BioOsService.BioOsService.bind_cluster_to_workspace .. autofunction:: bioos.BioOsService.BioOsService.unbind_cluster_and_workspace .. autofunction:: bioos.BioOsService.BioOsService.list_clusters_of_workspace .. autofunction:: bioos.BioOsService.BioOsService.list_workspace_labels 集群 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.list_clusters .. autofunction:: bioos.BioOsService.BioOsService.delete_cluster .. autofunction:: bioos.BioOsService.BioOsService.update_api_accesskey .. autofunction:: bioos.BioOsService.BioOsService.get_api_accesskey 工作流 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.create_workflow .. autofunction:: bioos.BioOsService.BioOsService.list_workflows .. autofunction:: bioos.BioOsService.BioOsService.update_workflow .. autofunction:: bioos.BioOsService.BioOsService.delete_workflow .. autofunction:: bioos.BioOsService.BioOsService.get_trs_workflow_info 数据模型 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.create_data_model .. autofunction:: bioos.BioOsService.BioOsService.list_data_models .. autofunction:: bioos.BioOsService.BioOsService.list_data_model_rows .. autofunction:: bioos.BioOsService.BioOsService.delete_data_model_rows_and_headers 数据集 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.list_data_files .. autofunction:: bioos.BioOsService.BioOsService.list_data_sets .. autofunction:: bioos.BioOsService.BioOsService.create_data_set .. autofunction:: bioos.BioOsService.BioOsService.delete_data_set 投递 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.create_submission .. autofunction:: bioos.BioOsService.BioOsService.list_submissions .. autofunction:: bioos.BioOsService.BioOsService.delete_submission .. autofunction:: bioos.BioOsService.BioOsService.cancel_submission .. autofunction:: bioos.BioOsService.BioOsService.list_overview_submissions 运行 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.list_runs .. autofunction:: bioos.BioOsService.BioOsService.cancel_run 任务 ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.list_tasks Notebook server ------------------------------- .. autofunction:: bioos.BioOsService.BioOsService.get_notebook_edit_info .. autofunction:: bioos.BioOsService.BioOsService.get_notebook_server_settings .. autofunction:: bioos.BioOsService.BioOsService.get_notebook_server_stat .. autofunction:: bioos.BioOsService.BioOsService.list_notebook_server_images .. autofunction:: bioos.BioOsService.BioOsService.list_notebook_server_resource_opts .. autofunction:: bioos.BioOsService.BioOsService.stop_notebook_server .. autofunction:: bioos.BioOsService.BioOsService.update_notebook_server_settings .. autofunction:: bioos.BioOsService.BioOsService.create_notebook_server_image .. autofunction:: bioos.BioOsService.BioOsService.list_notebook_servers .. autofunction:: bioos.BioOsService.BioOsService.delete_notebook_server .. autofunction:: bioos.BioOsService.BioOsService.delete_notebook_server_settings .. autofunction:: bioos.BioOsService.BioOsService.get_notebook_server_extra_packages ================================================ FILE: volcengine/bioos/doc/source/conf.py ================================================ # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import os import sys # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'bioos' copyright = '2023, jixinchi' author = 'jixinchi' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] templates_path = ['_templates'] exclude_patterns = [] language = '[en]' # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = 'sphinxdoc' html_static_path = ['_static'] autodoc_default_options = { 'members': True, 'member-order': 'bysource', 'special-members': '__init__', } sys.path.insert(0, os.path.abspath(os.path.join('..', '../..'))) ================================================ FILE: volcengine/bioos/doc/source/index.rst ================================================ .. bioos documentation master file, created by sphinx-quickstart on Thu Mar 16 15:15:05 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to bioos's documentation! ================================= .. toctree:: :maxdepth: 2 :caption: Contents: bioos Installation ================== Python 版本需要不低于2.7,可以直接通过pip进行安装 Example ------------------ :: pip install volcengine Quickstart ================== 密钥使用授权 ------------------ *仅子账号需要关注* 1. 登录控制台,点击右上角头像,在下拉菜单中选择「访问控制」。 2. 点击左侧边的「策略管理」,确认本子账户拥有「AccessKeyFullAccess」权限或包含此权限的更高级权限,例如「AdministratorAccess」,若没有则用 主账号 登录控制台为子账户添加相关权限。 Example ------------------ :: from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = {} resp = bioos_service.list_workspaces(params) print(resp) Indices and tables ================== * :ref:`genindex` * :ref:`search` ================================================ FILE: volcengine/business_security/RiskDetectionService.py ================================================ import json import threading import redo from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from requests import exceptions class RiskDetectService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(RiskDetectService, "_instance"): with RiskDetectService._instance_lock: if not hasattr(RiskDetectService, "_instance"): RiskDetectService._instance = object.__new__(cls) return RiskDetectService._instance def __init__(self): self.service_info = RiskDetectService.get_service_info() self.api_info = RiskDetectService.get_api_info() super(RiskDetectService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("riskcontrol.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'BusinessSecurity', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = {"RiskDetection": ApiInfo("POST", "/", {"Action": "RiskDetection", "Version": "2021-02-02"}, {}, {}), "AsyncRiskDetection": ApiInfo("POST", "/", {"Action": "AsyncRiskDetection", "Version": "2021-02-25"}, {}, {}), "RiskResult": ApiInfo("GET", "/", {"Action": "RiskResult", "Version": "2021-03-10"}, {}, {}), "AccountRisk": ApiInfo("POST", "/", {"Action": "AccountRisk", "Version": "2020-12-25"}, {}, {}), "MobileStatus": ApiInfo("POST", "/", {"Action": "MobileStatus", "Version": "2020-12-25"}, {}, {}), "ElementVerify": ApiInfo("POST", "/", {"Action": "ElementVerify", "Version": "2021-11-23"}, {}, {}), "MobileStatusV2": ApiInfo("POST", "/", {"Action": "MobileStatus", "Version": "2022-04-13"}, {}, {}), "ElementVerifyV2": ApiInfo("POST", "/", {"Action": "ElementVerify", "Version": "2022-04-13"}, {}, {}), "SimpleRiskStat": ApiInfo("GET", "/", {"Action": "SimpleRiskStat", "Version": "2022-12-23"}, {}, {}), "ContentRiskStat": ApiInfo("GET", "/", {"Action": "ContentRiskStat", "Version": "2022-12-23"}, {}, {}), } return api_info def set_socket_timeout(self, timeout): self.service_info.socket_timeout = timeout def set_connection_timeout(self, timeout): self.service_info.connection_timeout = timeout @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def risk_detect(self, params, body): res = self.json("RiskDetection", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_risk_detect(self, params, body): res = self.json("AsyncRiskDetection", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def risk_result(self, params, body): res = self.get("RiskResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def account_risk(self, params, body): res = self.json("AccountRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def mobile_status_v2(self, params, body): res = self.json("MobileStatusV2", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def element_verify_v2(self, params, body): res = self.json("ElementVerifyV2", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def simple_risk_stat(self, params, body): res = self.get("SimpleRiskStat", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def content_risk_stat(self, params, body): res = self.get("ContentRiskStat", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/business_security/__init__.py ================================================ ================================================ FILE: volcengine/cdn/__init__.py ================================================ ================================================ FILE: volcengine/cdn/service.py ================================================ # -*- coding: utf-8 -*- import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo GET = "GET" POST = "POST" SERVICE_VERSION = "2021-03-01" service_info_map = { "cn-north-1": ServiceInfo("cdn.volcengineapi.com", {'accept': 'application/json', }, Credentials('', '', "CDN", "cn-north-1"), 60 * 5, 60 * 5, "https"), } api_info = { # 添加加速域名: https://www.volcengine.com/docs/6454/97340 "AddCdnDomain": ApiInfo("POST", "/", { "Action": "AddCdnDomain", "Version": SERVICE_VERSION}, {}, {}), # 上线加速域名: https://www.volcengine.com/docs/6454/74667 "StartCdnDomain": ApiInfo("POST", "/", { "Action": "StartCdnDomain", "Version": SERVICE_VERSION}, {}, {}), # 下线加速域名: https://www.volcengine.com/docs/6454/75129 "StopCdnDomain": ApiInfo("POST", "/", { "Action": "StopCdnDomain", "Version": SERVICE_VERSION}, {}, {}), # 删除加速域名: https://www.volcengine.com/docs/6454/75130 "DeleteCdnDomain": ApiInfo("POST", "/", { "Action": "DeleteCdnDomain", "Version": SERVICE_VERSION}, {}, {}), # 获取域名列表: https://www.volcengine.com/docs/6454/75269 "ListCdnDomains": ApiInfo("POST", "/", { "Action": "ListCdnDomains", "Version": SERVICE_VERSION}, {}, {}), # 获取域名配置详情: https://www.volcengine.com/docs/6454/80320 "DescribeCdnConfig": ApiInfo("POST", "/", { "Action": "DescribeCdnConfig", "Version": SERVICE_VERSION}, {}, {}), # 修改加速域名配置: https://www.volcengine.com/docs/6454/97266 "UpdateCdnConfig": ApiInfo("POST", "/", { "Action": "UpdateCdnConfig", "Version": SERVICE_VERSION}, {}, {}), # 获取访问统计的细分数据: https://www.volcengine.com/docs/6454/70442 "DescribeCdnData": ApiInfo("POST", "/", { "Action": "DescribeCdnData", "Version": SERVICE_VERSION}, {}, {}), # 获取访问统计的汇总数据: https://www.volcengine.com/docs/6454/96132 "DescribeEdgeNrtDataSummary": ApiInfo("POST", "/", { "Action": "DescribeEdgeNrtDataSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取回源统计的细分数据: https://www.volcengine.com/docs/6454/70443 "DescribeCdnOriginData": ApiInfo("POST", "/", { "Action": "DescribeCdnOriginData", "Version": SERVICE_VERSION}, {}, {}), # 获取回源统计的汇总数据: https://www.volcengine.com/docs/6454/96133 "DescribeOriginNrtDataSummary": ApiInfo("POST", "/", { "Action": "DescribeOriginNrtDataSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取省份运营商的细分数据: https://www.volcengine.com/docs/6454/75159 "DescribeCdnDataDetail": ApiInfo("POST", "/", { "Action": "DescribeCdnDataDetail", "Version": SERVICE_VERSION}, {}, {}), # 获取多个域名的省份和运营商的细分数据: https://www.volcengine.com/docs/6454/145577 "DescribeDistrictIspData": ApiInfo("POST", "/", { "Action": "DescribeDistrictIspData", "Version": SERVICE_VERSION}, {}, {}), # 获取独立访客的细分数据: https://www.volcengine.com/docs/6454/79321 "DescribeEdgeStatisticalData": ApiInfo("POST", "/", { "Action": "DescribeEdgeStatisticalData", "Version": SERVICE_VERSION}, {}, {}), # 获取访问统计的排行数据: https://www.volcengine.com/docs/6454/96145 "DescribeEdgeTopNrtData": ApiInfo("POST", "/", { "Action": "DescribeEdgeTopNrtData", "Version": SERVICE_VERSION}, {}, {}), # 获取回源数据的统计排序: https://www.volcengine.com/docs/6454/104892 "DescribeOriginTopNrtData": ApiInfo("POST", "/", { "Action": "DescribeOriginTopNrtData", "Version": SERVICE_VERSION}, {}, {}), # 获取访问状态码的统计排序: https://www.volcengine.com/docs/6454/104888 "DescribeEdgeTopStatusCode": ApiInfo("POST", "/", { "Action": "DescribeEdgeTopStatusCode", "Version": SERVICE_VERSION}, {}, {}), # 获取回源状态码的统计排序: https://www.volcengine.com/docs/6454/104891 "DescribeOriginTopStatusCode": ApiInfo("POST", "/", { "Action": "DescribeOriginTopStatusCode", "Version": SERVICE_VERSION}, {}, {}), # 获取热点及访客排行数据: https://www.volcengine.com/docs/6454/79322 "DescribeEdgeTopStatisticalData": ApiInfo("POST", "/", { "Action": "DescribeEdgeTopStatisticalData", "Version": SERVICE_VERSION}, {}, {}), # 获取区域和 ISP 列表: https://www.volcengine.com/docs/6454/70445 "DescribeCdnRegionAndIsp": ApiInfo("POST", "/", { "Action": "DescribeCdnRegionAndIsp", "Version": SERVICE_VERSION}, {}, {}), # 获取服务相关信息: https://www.volcengine.com/docs/6454/78999 "DescribeCdnService": ApiInfo("POST", "/", { "Action": "DescribeCdnService", "Version": SERVICE_VERSION}, {}, {}), # 获取计费指标的细分数据: https://www.volcengine.com/docs/6454/96167 "DescribeAccountingData": ApiInfo("POST", "/", { "Action": "DescribeAccountingData", "Version": SERVICE_VERSION}, {}, {}), # 提交刷新任务: https://www.volcengine.com/docs/6454/70438 "SubmitRefreshTask": ApiInfo("POST", "/", { "Action": "SubmitRefreshTask", "Version": SERVICE_VERSION}, {}, {}), # 提交预热任务: https://www.volcengine.com/docs/6454/70436 "SubmitPreloadTask": ApiInfo("POST", "/", { "Action": "SubmitPreloadTask", "Version": SERVICE_VERSION}, {}, {}), # 获取刷新预热任务信息: https://www.volcengine.com/docs/6454/70437 "DescribeContentTasks": ApiInfo("POST", "/", { "Action": "DescribeContentTasks", "Version": SERVICE_VERSION}, {}, {}), # 获取刷新预热配额信息: https://www.volcengine.com/docs/6454/70439 "DescribeContentQuota": ApiInfo("POST", "/", { "Action": "DescribeContentQuota", "Version": SERVICE_VERSION}, {}, {}), # 提交封禁任务: https://www.volcengine.com/docs/6454/79890 "SubmitBlockTask": ApiInfo("POST", "/", { "Action": "SubmitBlockTask", "Version": SERVICE_VERSION}, {}, {}), # 提交解封任务: https://www.volcengine.com/docs/6454/79893 "SubmitUnblockTask": ApiInfo("POST", "/", { "Action": "SubmitUnblockTask", "Version": SERVICE_VERSION}, {}, {}), # 获取封禁解封任务信息: https://www.volcengine.com/docs/6454/79906 "DescribeContentBlockTasks": ApiInfo("POST", "/", { "Action": "DescribeContentBlockTasks", "Version": SERVICE_VERSION}, {}, {}), # 获取访问日志下载链接: https://www.volcengine.com/docs/6454/70446 "DescribeCdnAccessLog": ApiInfo("POST", "/", { "Action": "DescribeCdnAccessLog", "Version": SERVICE_VERSION}, {}, {}), # 获取 IP 归属信息: https://www.volcengine.com/docs/6454/75233 "DescribeIPInfo": ApiInfo("POST", "/", { "Action": "DescribeIPInfo", "Version": SERVICE_VERSION}, {}, {}), # 批量获取 IP 归属信息: https://www.volcengine.com/docs/6454/106852 "DescribeIPListInfo": ApiInfo("POST", "/", { "Action": "DescribeIPListInfo", "Version": SERVICE_VERSION}, {}, {}), # 获取回源节点 IP 列表: https://www.volcengine.com/docs/6454/75273 "DescribeCdnUpperIp": ApiInfo("POST", "/", { "Action": "DescribeCdnUpperIp", "Version": SERVICE_VERSION}, {}, {}), # 添加资源标签: https://www.volcengine.com/docs/6454/80308 "AddResourceTags": ApiInfo("POST", "/", { "Action": "AddResourceTags", "Version": SERVICE_VERSION}, {}, {}), # 更新资源标签: https://www.volcengine.com/docs/6454/80313 "UpdateResourceTags": ApiInfo("POST", "/", { "Action": "UpdateResourceTags", "Version": SERVICE_VERSION}, {}, {}), # 查询标签清单: https://www.volcengine.com/docs/6454/80315 "ListResourceTags": ApiInfo("POST", "/", { "Action": "ListResourceTags", "Version": SERVICE_VERSION}, {}, {}), # 删除资源标签: https://www.volcengine.com/docs/6454/80316 "DeleteResourceTags": ApiInfo("POST", "/", { "Action": "DeleteResourceTags", "Version": SERVICE_VERSION}, {}, {}), # 上传证书: https://www.volcengine.com/docs/6454/125708 "AddCdnCertificate": ApiInfo("POST", "/", { "Action": "AddCdnCertificate", "Version": SERVICE_VERSION}, {}, {}), # 查询CDN证书列表: https://www.volcengine.com/docs/6454/125709 "ListCertInfo": ApiInfo("POST", "/", { "Action": "ListCertInfo", "Version": SERVICE_VERSION}, {}, {}), # 查询CDN有关联域名的证书列表: https://www.volcengine.com/docs/6454/125710 "ListCdnCertInfo": ApiInfo("POST", "/", { "Action": "ListCdnCertInfo", "Version": SERVICE_VERSION}, {}, {}), # 获取特定证书的域名关联信息: https://www.volcengine.com/docs/6454/125711 "DescribeCertConfig": ApiInfo("POST", "/", { "Action": "DescribeCertConfig", "Version": SERVICE_VERSION}, {}, {}), # 批量关联证书: https://www.volcengine.com/docs/6454/125712 "BatchDeployCert": ApiInfo("POST", "/", { "Action": "BatchDeployCert", "Version": SERVICE_VERSION}, {}, {}), # 删除托管在内容分发网络的证书: https://www.volcengine.com/docs/6454/597589 "DeleteCdnCertificate": ApiInfo("POST", "/", { "Action": "DeleteCdnCertificate", "Version": SERVICE_VERSION}, {}, {}), # 查询计费结果数据: "DescribeAccountingSummary": ApiInfo("POST", "/", { "Action": "DescribeAccountingSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取访问统计的细分数据: "DescribeDistrictData": ApiInfo("POST", "/", { "Action": "DescribeDistrictData", "Version": SERVICE_VERSION}, {}, {}), # 获取计费区域的细分数据: "DescribeEdgeData": ApiInfo("POST", "/", { "Action": "DescribeEdgeData", "Version": SERVICE_VERSION}, {}, {}), # 获取访问统计的汇总数据: "DescribeDistrictSummary": ApiInfo("POST", "/", { "Action": "DescribeDistrictSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取计费区域的汇总数据: "DescribeEdgeSummary": ApiInfo("POST", "/", { "Action": "DescribeEdgeSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取回源统计的细分数据: "DescribeOriginData": ApiInfo("POST", "/", { "Action": "DescribeOriginData", "Version": SERVICE_VERSION}, {}, {}), # 获取回源统计的汇总数据: "DescribeOriginSummary": ApiInfo("POST", "/", { "Action": "DescribeOriginSummary", "Version": SERVICE_VERSION}, {}, {}), # 获取独立访客的细分数据: "DescribeUserData": ApiInfo("POST", "/", { "Action": "DescribeUserData", "Version": SERVICE_VERSION}, {}, {}), # 获取访问数据的统计排名: "DescribeDistrictRanking": ApiInfo("POST", "/", { "Action": "DescribeDistrictRanking", "Version": SERVICE_VERSION}, {}, {}), # 获取计费区域的统计排名: "DescribeEdgeRanking": ApiInfo("POST", "/", { "Action": "DescribeEdgeRanking", "Version": SERVICE_VERSION}, {}, {}), # 获取回源数据的统计排名: "DescribeOriginRanking": ApiInfo("POST", "/", { "Action": "DescribeOriginRanking", "Version": SERVICE_VERSION}, {}, {}), # 获取访问状态码排名数据: "DescribeEdgeStatusCodeRanking": ApiInfo("POST", "/", { "Action": "DescribeEdgeStatusCodeRanking", "Version": SERVICE_VERSION}, {}, {}), # 获取回源状态码的统计排名: "DescribeOriginStatusCodeRanking": ApiInfo("POST", "/", { "Action": "DescribeOriginStatusCodeRanking", "Version": SERVICE_VERSION}, {}, {}), # 获取热门对象的统计排名: "DescribeStatisticalRanking": ApiInfo("POST", "/", { "Action": "DescribeStatisticalRanking", "Version": SERVICE_VERSION}, {}, {}), # 批量更新加速域名: "BatchUpdateCdnConfig": ApiInfo("POST", "/", { "Action": "BatchUpdateCdnConfig", "Version": SERVICE_VERSION}, {}, {}), # 上传证书新版: "AddCertificate": ApiInfo("POST", "/", { "Action": "AddCertificate", "Version": SERVICE_VERSION}, {}, {}), # 删除用量导出任务: "DeleteUsageReport": ApiInfo("POST", "/", { "Action": "DeleteUsageReport", "Version": SERVICE_VERSION}, {}, {}), # 创建用量导出任务: "CreateUsageReport": ApiInfo("POST", "/", { "Action": "CreateUsageReport", "Version": SERVICE_VERSION}, {}, {}), # 获取用量导出任务列表: "ListUsageReports": ApiInfo("POST", "/", { "Action": "ListUsageReports", "Version": SERVICE_VERSION}, {}, {}), # 查询全局配置: "DescribeSharedConfig": ApiInfo("POST", "/", { "Action": "DescribeSharedConfig", "Version": SERVICE_VERSION}, {}, {}), # 查询全局配置列表: "ListSharedConfig": ApiInfo("POST", "/", { "Action": "ListSharedConfig", "Version": SERVICE_VERSION}, {}, {}), # 删除全局配置: "DeleteSharedConfig": ApiInfo("POST", "/", { "Action": "DeleteSharedConfig", "Version": SERVICE_VERSION}, {}, {}), # 修改全局配置: "UpdateSharedConfig": ApiInfo("POST", "/", { "Action": "UpdateSharedConfig", "Version": SERVICE_VERSION}, {}, {}), # 新增全局配置: "AddSharedConfig": ApiInfo("POST", "/", { "Action": "AddSharedConfig", "Version": SERVICE_VERSION}, {}, {}), # 接入域名校验: "CheckDomain": ApiInfo("POST", "/", { "Action": "CheckDomain", "Version": SERVICE_VERSION}, {}, {}), # DNS校验信息生成: "DescribeRetrieveInfo": ApiInfo("POST", "/", { "Action": "DescribeRetrieveInfo", "Version": SERVICE_VERSION}, {}, {}), # 查询域名版本列表: "ListDomainVersions": ApiInfo("POST", "/", { "Action": "ListDomainVersions", "Version": SERVICE_VERSION}, {}, {}), # 查询域名环境版本: "DescribeDomainEnvVersion": ApiInfo("POST", "/", { "Action": "DescribeDomainEnvVersion", "Version": SERVICE_VERSION}, {}, {}), # 创建域名版本: "CreateDomainVersion": ApiInfo("POST", "/", { "Action": "CreateDomainVersion", "Version": SERVICE_VERSION}, {}, {}), # 删除域名版本: "DeleteDomainVersion": ApiInfo("POST", "/", { "Action": "DeleteDomainVersion", "Version": SERVICE_VERSION}, {}, {}), # 查询域名版本: "DescribeDomainVersion": ApiInfo("POST", "/", { "Action": "DescribeDomainVersion", "Version": SERVICE_VERSION}, {}, {}), # 修改域名版本: "UpdateDomainVersion": ApiInfo("POST", "/", { "Action": "UpdateDomainVersion", "Version": SERVICE_VERSION}, {}, {}), # 发布域名版本: "ReleaseDomainVersion": ApiInfo("POST", "/", { "Action": "ReleaseDomainVersion", "Version": SERVICE_VERSION}, {}, {}), } class CDNService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(CDNService, "_instance"): with CDNService._instance_lock: if not hasattr(CDNService, "_instance"): CDNService._instance = object.__new__(cls) return CDNService._instance def __init__(self, region="cn-north-1"): self.service_info = CDNService.get_service_info(region) self.api_info = CDNService.get_api_info() super(CDNService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region_name): service_info = service_info_map.get(region_name, None) if not service_info: raise Exception('do not support region %s' % region_name) return service_info @staticmethod def get_api_info(): return api_info @staticmethod def use_post(): return POST @staticmethod def use_get(): return GET def send_request(self, action, params, method=POST): method = str(method).upper() if method == 'POST': res = self.json(action, [], json.dumps(params)) elif method == "GET": self.get_api_info()[action].method = self.use_get() res = self.request(action, params, json.dumps({})) self.get_api_info()[action].method = self.use_post() else: raise Exception("not support method %s" % method) return res def add_cdn_domain(self, params=None): if params is None: params = {} action = "AddCdnDomain" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def start_cdn_domain(self, params=None): if params is None: params = {} action = "StartCdnDomain" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def stop_cdn_domain(self, params=None): if params is None: params = {} action = "StopCdnDomain" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_cdn_domain(self, params=None): if params is None: params = {} action = "DeleteCdnDomain" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_cdn_domains(self, params=None, method=POST): if params is None: params = {} action = "ListCdnDomains" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_config(self, params=None): if params is None: params = {} action = "DescribeCdnConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_cdn_config(self, params=None): if params is None: params = {} action = "UpdateCdnConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeCdnData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_nrt_data_summary(self, params=None, method=POST): if params is None: params = {} action = "DescribeEdgeNrtDataSummary" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_origin_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeCdnOriginData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_nrt_data_summary(self, params=None, method=POST): if params is None: params = {} action = "DescribeOriginNrtDataSummary" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_data_detail(self, params=None, method=POST): if params is None: params = {} action = "DescribeCdnDataDetail" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_district_isp_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeDistrictIspData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_statistical_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeEdgeStatisticalData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_top_nrt_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeEdgeTopNrtData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_top_nrt_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeOriginTopNrtData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_top_status_code(self, params=None, method=POST): if params is None: params = {} action = "DescribeEdgeTopStatusCode" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_top_status_code(self, params=None, method=POST): if params is None: params = {} action = "DescribeOriginTopStatusCode" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_top_statistical_data(self, params=None, method=POST): if params is None: params = {} action = "DescribeEdgeTopStatisticalData" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_region_and_isp(self, params=None, method=POST): if params is None: params = {} action = "DescribeCdnRegionAndIsp" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_service(self, params=None): if params is None: params = {} action = "DescribeCdnService" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_accounting_data(self, params=None): if params is None: params = {} action = "DescribeAccountingData" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def submit_refresh_task(self, params=None): if params is None: params = {} action = "SubmitRefreshTask" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def submit_preload_task(self, params=None): if params is None: params = {} action = "SubmitPreloadTask" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_content_tasks(self, params=None): if params is None: params = {} action = "DescribeContentTasks" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_content_quota(self, params=None, method=POST): if params is None: params = {} action = "DescribeContentQuota" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def submit_block_task(self, params=None): if params is None: params = {} action = "SubmitBlockTask" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def submit_unblock_task(self, params=None): if params is None: params = {} action = "SubmitUnblockTask" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_content_block_tasks(self, params=None): if params is None: params = {} action = "DescribeContentBlockTasks" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cdn_access_log(self, params=None, method=POST): if params is None: params = {} action = "DescribeCdnAccessLog" res = self.send_request(action, params, method) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_ip_info(self, params=None): if params is None: params = {} action = "DescribeIPInfo" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_ip_list_info(self, params=None): if params is None: params = {} action = "DescribeIPListInfo" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json # deprecated, use describe_ip_list_info instead def describe_iplist_info(self, params=None): return self.describe_ip_list_info(params) def describe_cdn_upper_ip(self, params=None): if params is None: params = {} action = "DescribeCdnUpperIp" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def add_resource_tags(self, params=None): if params is None: params = {} action = "AddResourceTags" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_resource_tags(self, params=None): if params is None: params = {} action = "UpdateResourceTags" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_resource_tags(self, params=None): if params is None: params = {} action = "ListResourceTags" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_resource_tags(self, params=None): if params is None: params = {} action = "DeleteResourceTags" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def add_cdn_certificate(self, params=None): if params is None: params = {} action = "AddCdnCertificate" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_cert_info(self, params=None): if params is None: params = {} action = "ListCertInfo" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_cdn_cert_info(self, params=None): if params is None: params = {} action = "ListCdnCertInfo" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_cert_config(self, params=None): if params is None: params = {} action = "DescribeCertConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def batch_deploy_cert(self, params=None): if params is None: params = {} action = "BatchDeployCert" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_cdn_certificate(self, params=None): if params is None: params = {} action = "DeleteCdnCertificate" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_accounting_summary(self, params=None): if params is None: params = {} action = "DescribeAccountingSummary" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_district_data(self, params=None): if params is None: params = {} action = "DescribeDistrictData" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_data(self, params=None): if params is None: params = {} action = "DescribeEdgeData" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_district_summary(self, params=None): if params is None: params = {} action = "DescribeDistrictSummary" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_summary(self, params=None): if params is None: params = {} action = "DescribeEdgeSummary" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_data(self, params=None): if params is None: params = {} action = "DescribeOriginData" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_summary(self, params=None): if params is None: params = {} action = "DescribeOriginSummary" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_user_data(self, params=None): if params is None: params = {} action = "DescribeUserData" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_district_ranking(self, params=None): if params is None: params = {} action = "DescribeDistrictRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_ranking(self, params=None): if params is None: params = {} action = "DescribeEdgeRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_ranking(self, params=None): if params is None: params = {} action = "DescribeOriginRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_edge_status_code_ranking(self, params=None): if params is None: params = {} action = "DescribeEdgeStatusCodeRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_status_code_ranking(self, params=None): if params is None: params = {} action = "DescribeOriginStatusCodeRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_statistical_ranking(self, params=None): if params is None: params = {} action = "DescribeStatisticalRanking" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def batch_update_cdn_config(self, params=None): if params is None: params = {} action = "BatchUpdateCdnConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def add_certificate(self, params=None): if params is None: params = {} action = "AddCertificate" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_usage_report(self, params=None): if params is None: params = {} action = "DeleteUsageReport" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_usage_report(self, params=None): if params is None: params = {} action = "CreateUsageReport" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_usage_reports(self, params=None): if params is None: params = {} action = "ListUsageReports" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_shared_config(self, params=None): if params is None: params = {} action = "DescribeSharedConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_shared_config(self, params=None): if params is None: params = {} action = "ListSharedConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_shared_config(self, params=None): if params is None: params = {} action = "DeleteSharedConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_shared_config(self, params=None): if params is None: params = {} action = "UpdateSharedConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def add_shared_config(self, params=None): if params is None: params = {} action = "AddSharedConfig" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def check_domain(self, params=None): if params is None: params = {} action = "CheckDomain" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_retrieve_info(self, params=None): if params is None: params = {} action = "DescribeRetrieveInfo" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_domain_versions(self, params=None): if params is None: params = {} action = "ListDomainVersions" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_env_version(self, params=None): if params is None: params = {} action = "DescribeDomainEnvVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_domain_version(self, params=None): if params is None: params = {} action = "CreateDomainVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_domain_version(self, params=None): if params is None: params = {} action = "DeleteDomainVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_version(self, params=None): if params is None: params = {} action = "DescribeDomainVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_domain_version(self, params=None): if params is None: params = {} action = "UpdateDomainVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def release_domain_version(self, params=None): if params is None: params = {} action = "ReleaseDomainVersion" res = self.send_request(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json ================================================ FILE: volcengine/code_pipeline/CodePipelineService.py ================================================ import json import threading import redo from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from requests import exceptions class CodePipelineService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(CodePipelineService, "_instance"): with CodePipelineService._instance_lock: if not hasattr(CodePipelineService, "_instance"): CodePipelineService._instance = object.__new__(cls) return CodePipelineService._instance def __init__(self): self.service_info = CodePipelineService.get_service_info() self.api_info = CodePipelineService.get_api_info() super(CodePipelineService, self).__init__( self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'cp', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = { "UpdateWorkspace": ApiInfo( "POST", "/", {"Action": "UpdateWorkspace", "Version": "2021-03-03"}, {}, {}), "DeleteWorkspace": ApiInfo( "POST", "/", {"Action": "DeleteWorkspace", "Version": "2021-03-03"}, {}, {}), "GetWorkspace": ApiInfo( "POST", "/", {"Action": "GetWorkspace", "Version": "2021-03-03"}, {}, {}), "CreateWorkspace": ApiInfo( "POST", "/", {"Action": "CreateWorkspace", "Version": "2021-03-03"}, {}, {}), "ListWorkspaces": ApiInfo( "POST", "/", {"Action": "ListWorkspaces", "Version": "2021-03-03"}, {}, {}), "CopyWorkspace": ApiInfo( "POST", "/", {"Action": "CopyWorkspace", "Version": "2021-03-03"}, {}, {}), "CreatePipeline": ApiInfo( "POST", "/", {"Action": "CreatePipeline", "Version": "2021-03-03"}, {}, {}), "ListPipelines": ApiInfo( "POST", "/", {"Action": "ListPipelines", "Version": "2021-03-03"}, {}, {}), "DeletePipeline": ApiInfo( "POST", "/", {"Action": "DeletePipeline", "Version": "2021-03-03"}, {}, {}), "UpdatePipeline": ApiInfo( "POST", "/", {"Action": "UpdatePipeline", "Version": "2021-03-03"}, {}, {}), "GetPipeline": ApiInfo( "POST", "/", {"Action": "GetPipeline", "Version": "2021-03-03"}, {}, {}), "UpdatePipelineProperties": ApiInfo( "POST", "/", {"Action": "UpdatePipelineProperties", "Version": "2021-03-03"}, {}, {}), "GetPipelineHookUrl": ApiInfo( "POST", "/", {"Action": "GetPipelineHookUrl", "Version": "2021-03-03"}, {}, {}), "RunPipeline": ApiInfo( "POST", "/", {"Action": "RunPipeline", "Version": "2021-03-03"}, {}, {}), "RunRollingUpdate": ApiInfo( "POST", "/", {"Action": "RunRollingUpdate", "Version": "2021-03-03"}, {}, {}), "DeletePipelineCache": ApiInfo( "POST", "/", {"Action": "DeletePipelineCache", "Version": "2021-03-03"}, {}, {}), "ListPipelineRecords": ApiInfo( "POST", "/", {"Action": "ListPipelineRecords", "Version": "2021-03-03"}, {}, {}), "GetPipelineRecord": ApiInfo( "POST", "/", {"Action": "GetPipelineRecord", "Version": "2021-03-03"}, {}, {}), "StopPipelineRecord": ApiInfo( "POST", "/", {"Action": "StopPipelineRecord", "Version": "2021-03-03"}, {}, {}), "RetryPipelineRecord": ApiInfo( "POST", "/", {"Action": "RetryPipelineRecord", "Version": "2021-03-03"}, {}, {}), "DeletePipelineRecord": ApiInfo( "POST", "/", {"Action": "DeletePipelineRecord", "Version": "2021-03-03"}, {}, {}), "ListPipelineTemplates": ApiInfo( "POST", "/", {"Action": "ListPipelineTemplates", "Version": "2021-03-03"}, {}, {}), "GetPipelineTemplate": ApiInfo( "POST", "/", {"Action": "GetPipelineTemplate", "Version": "2021-03-03"}, {}, {})} return api_info @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def update_workspace(self, params, body): res = self.json("UpdateWorkspace", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_workspace(self, params, body): res = self.json("DeleteWorkspace", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_workspace(self, params, body): res = self.json("GetWorkspace", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_workspace(self, params, body): res = self.json("CreateWorkspace", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_workspaces(self, params, body): res = self.json("ListWorkspaces", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def copy_workspace(self, params, body): res = self.json("CopyWorkspace", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_pipeline(self, params, body): res = self.json("CreatePipeline", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_pipelines(self, params, body): res = self.json("ListPipelines", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_pipeline(self, params, body): res = self.json("DeletePipeline", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def update_pipeline(self, params, body): res = self.json("UpdatePipeline", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_pipeline(self, params, body): res = self.json("GetPipeline", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def update_pipeline_properties(self, params, body): res = self.json("UpdatePipelineProperties", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_pipeline_hook_url(self, params, body): res = self.json("GetPipelineHookUrl", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def run_pipeline(self, params, body): res = self.json("RunPipeline", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def run_rolling_update(self, params, body): res = self.json("RunRollingUpdate", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_pipeline_cache(self, params, body): res = self.json("DeletePipelineCache", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_pipeline_records(self, params, body): res = self.json("ListPipelineRecords", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_pipeline_record(self, params, body): res = self.json("GetPipelineRecord", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def stop_pipeline_record(self, params, body): res = self.json("StopPipelineRecord", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def retry_pipeline_record(self, params, body): res = self.json("RetryPipelineRecord", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_pipeline_record(self, params, body): res = self.json("DeletePipelineRecord", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_pipeline_templates(self, params, body): res = self.json("ListPipelineTemplates", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_pipeline_template(self, params, body): res = self.json("GetPipelineTemplate", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/code_pipeline/__init__.py ================================================ ================================================ FILE: volcengine/const/Const.py ================================================ # coding: utf-8 REGION_CN_NORTH1 = "cn-north-1" REGION_US_EAST1 = "us-east-1" REGION_AP_SINGAPORE1 = "ap-singapore-1" INNER_REGION_CN_NORTH1 = "cn-north-1-inner" INNER_REGION_US_EAST1 = "us-east-1-inner" INNER_REGION_AP_SINGAPORE1 = "ap-singapore-1-inner" HTTP = 'http' HTTPS = 'https' FILE_TYPE_VIDEO = 'video' FILE_TYPE_MEDIA = 'media' FILE_TYPE_IMAGE = 'image' FILE_TYPE_OBJECT = 'object' UPLOAD_FORMAT_MP4 = 'mp4' UPLOAD_FORMAT_M3U8 = 'm3u8' FORMAT_JPEG = 'jpeg' FORMAT_PNG = 'png' FORMAT_WEBP = 'webp' FORMAT_AWEBP = 'awebp' FORMAT_GIF = 'gif' FORMAT_HEIC = 'heic' FORMAT_ORIGINAL = 'image' VOD_TPL_OBJ = 'tplv-vod-obj' VOD_TPL_NOOP = 'tplv-vod-noop' VOD_TPL_RESIZE = 'tplv-vod-rs' VOD_TPL_CENTER_CROP = 'tplv-vod-cc' VOD_TPL_SMART_CROP = 'tplv-vod-cs' VOD_TPL_SIG = 'tplv-bd-sig' LETTER_RUNES = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' RESOURCE_SPACE_FORMAT = "trn:vod:%s:*:space/%s" RESOURCE_VIDEO_FORMAT = 'trn:vod::*:video_id/%s' RESOURCE_STREAM_TYPE_FORMAT = 'trn:vod:::stream_type/%s' RESOURCE_WATERMARK_FORMAT = 'trn:vod::*:watermark/%s' ACTION_VOD_GET_PLAY_INFO = "vod:GetPlayInfo" STAR = '*' CATEGORY_VIDEO = "video" CATEGORY_AUDIO = "audio" CATEGORY_IMAGE = "image" CATEGORY_DYNAMICIMG = "dynamic_img" CATEGORY_SUBTITLE = "subtitle" CATEGORY_FONT = "font" SMS_CHANNEL_TYPE_CN_OTP = "CN_OTP" SMS_CHANNEL_TYPE_CN_NTC = "CN_NTC" SMS_CHANNEL_TYPE_CN_MKT = "CN_MKT" SMS_CHANNEL_TYPE_I18N_OTP = "I18N_OTP" SMS_CHANNEL_TYPE_I18N_MKT = "I18N_MKT" ENABLE_STATUS_NOT_ENABLE = "0" ENABLE_STATUS_ENABLE = "1" AREA_CN = "cn" AREA_OVERSEAS = "overseas" AREA_ALL = "all" SOURCE_TYPE_TEXT = "text/string" SOURCE_TYPE_VIDEO = "video/mp4" SOURCE_TYPE_IMAGE_JPG = "image/jpg" SOURCE_TYPE_IMAGE_PNG = "image/png " SOURCE_TYPE_IMAGE_GIF = "image/gif" SOURCE_TYPE_MP3 = "audio/mp3" DOC_TYPE_THREE_IN_ONE = 0 # 三证合一 DOC_TYPE_BUSINESS_LICENSE = 1 # 企业营业执照 DOC_TYPE_ORGANIZATION_CODE_CERTIFICATE = 2 # 组织机构代码证 DOC_TYPE_TAX_REGISTRATION_CERTIFICATE = 3 # 税务登记证 DOC_TYPE_SOCIAL_CREDIT_CODE_CERTIFICATE = 4 # 社会信用代码证书 DOC_TYPE_POWER_OF_ATTORNEY = 5 # 授权委托书 DOC_TYPE_OTHERS = 6 # 其他 / 更多 DOC_TYPE_INSTITUTION_LEGAL_PERSON_CERTIFICATE = 7 # 事业单位法人证书 DOC_TYPE_REPRESENTATIVE_ID_CARD_FRONT = 8 # 经办人身份证人像面 DOC_TYPE_REPRESENTATIVE_ID_CARD_BACK = 9 # 经办人身份证国徽面 DOC_TYPE_RESPONSIBLE_PERSON_ID_CARD_FRONT = 10 # 责任人身份证人像面 DOC_TYPE_RESPONSIBLE_PERSON_ID_CARD_BACK = 11 # 责任人身份证国徽面 DOC_TYPE_PASSPORT_CARD = 12 # 护照照片 DOC_TYPE_HKM_PASSPORT_CARD = 13 # 港澳居民来往内地通行证照片 DOC_TYPE_TW_PASSPORT_CARD = 14 # 台湾居民来往大陆通行证照片 DOC_TYPE_HMT_RESIDENCE_CARD = 15 # 港澳台居民居住证照片 DOC_TYPE_APP_ICP_CERTIFICATE = 16 # APPICP 证书 DOC_TYPE_TRADEMARK_CERTIFICATE = 17 # 商标证书 SIGN_SOURCE_TYPE_COMPANY = "公司全称/简称" SIGN_SOURCE_TYPE_SITE = "工信部备案网站全称/简称" SIGN_SOURCE_TYPE_APP = "APP全称/简称" SIGN_SOURCE_TYPE_OFFICIAL_ACCOUNTS = "公众号、小程序全称/简称" SIGN_SOURCE_TYPE_BRAND = "商标全称/简称" SIGN_SOURCE_TYPE_STORE = "电商平台店铺名的全称/简称" SIGN_PURPOSE_FOR_OWN = 1 SIGN_PURPOSE_FOR_OTHER = 2 SIGN_SOURCE_COMPANY = 1 # 公司全称/简称 SIGN_SOURCE_APP = 2 # APP全称 SIGN_SOURCE_BRAND = 3 # 商标全称 ================================================ FILE: volcengine/const/__init__.py ================================================ ================================================ FILE: volcengine/content_security/ContentSecurityService.py ================================================ import json import threading import redo from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from requests import exceptions class ContentSecurityService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(ContentSecurityService, "_instance"): with ContentSecurityService._instance_lock: if not hasattr(ContentSecurityService, "_instance"): ContentSecurityService._instance = object.__new__(cls) return ContentSecurityService._instance def __init__(self): self.service_info = ContentSecurityService.get_service_info() self.api_info = ContentSecurityService.get_api_info() super(ContentSecurityService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("riskcontrol.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'BusinessSecurity', 'cn-north-1'), 5, 5) return service_info def set_socket_timeout(self, timeout): self.service_info.socket_timeout = timeout def set_connection_timeout(self, timeout): self.service_info.connection_timeout = timeout @staticmethod def get_api_info(): api_info = {"AsyncVideoRisk": ApiInfo("POST", "/", {"Action": "AsyncVideoRisk", "Version": "2021-11-29"}, {}, {}), "VideoResult": ApiInfo("GET", "/", {"Action": "VideoResult", "Version": "2021-11-29"}, {}, {}), "ImageContentRisk": ApiInfo("POST", "/", {"Action": "ImageContentRisk", "Version": "2021-11-29"}, {}, {}), "ImageContentRiskV2": ApiInfo("POST", "/", {"Action": "ImageContentRiskV2", "Version": "2021-11-29"}, {}, {}), "AsyncImageRisk": ApiInfo("POST", "/", {"Action": "AsyncImageRisk", "Version": "2021-11-29"}, {}, {}), "ImageResult": ApiInfo("GET", "/", {"Action": "GetImageResult", "Version": "2021-11-29"}, {}, {}), "TextRisk": ApiInfo("POST", "/", {"Action": "TextRisk", "Version": "2022-01-26"}, {}, {}), "CreateCustomContents": ApiInfo("POST", "/", {"Action": "CreateCustomContents", "Version": "2022-01-22"}, {}, {}), "UploadCustomContents": ApiInfo("POST", "/", {"Action": "UploadCustomContents", "Version": "2022-02-07"}, {}, {}), "EnableCustomContents": ApiInfo("PUT", "/", {"Action": "EnableCustomContents", "Version": "2022-04-28"}, {}, {}), "DisableCustomContents": ApiInfo("PUT", "/", {"Action": "DisableCustomContents", "Version": "2022-04-28"}, {}, {}), "DeleteCustomContents": ApiInfo("PUT", "/", {"Action": "DeleteCustomContents", "Version": "2022-04-28"}, {}, {}), "AsyncAudioRisk": ApiInfo("POST", "/", {"Action": "AsyncAudioRisk", "Version": "2022-04-01"}, {}, {}), "GetAudioResult": ApiInfo("GET", "/", {"Action": "GetAudioResult", "Version": "2022-04-01"}, {}, {}), "AudioRisk": ApiInfo("POST", "/", {"Action": "AudioRisk", "Version": "2022-04-01"}, {}, {}), "AsyncLiveVideoRisk": ApiInfo("POST", "/", {"Action": "AsyncLiveVideoRisk", "Version": "2022-04-25"}, {}, {}), "GetVideoLiveResult": ApiInfo("GET", "/", {"Action": "GetVideoLiveResult", "Version": "2022-04-25"}, {}, {}), "AsyncLiveAudioRisk": ApiInfo("POST", "/", {"Action": "AsyncLiveAudioRisk", "Version": "2022-04-25"}, {}, {}), "GetAudioLiveResult": ApiInfo("GET", "/", {"Action": "GetAudioLiveResult", "Version": "2022-04-25"}, {}, {}), "TextSliceRisk": ApiInfo("POST", "/", {"Action": "TextSliceRisk", "Version": "2022-11-07"}, {}, {}), "AsyncImageRiskV2": ApiInfo("POST", "/", {"Action": "AsyncImageRisk", "Version": "2022-08-26"}, {}, {}), "ImageResultV2": ApiInfo("GET", "/", {"Action": "ImageResult", "Version": "2022-08-26"}, {}, {}), "CloseAudioLiveRisk": ApiInfo("POST", "/", {"Action": "CloseAudioLive", "Version": "2022-04-25"}, {}, {}), "CloseVideoLiveRisk": ApiInfo("POST", "/", {"Action": "CloseVideoLive", "Version": "2022-04-25"}, {}, {}), "CreateCustomLib": ApiInfo("POST", "/", {"Action": "CreateCustomLib", "Version": "2023-10-01"}, {}, {}), "UpdateCustomLib": ApiInfo("POST", "/", {"Action": "UpdateCustomLib", "Version": "2023-10-01"}, {}, {}), "ChangeCustomContentsStatus": ApiInfo("POST", "/", {"Action": "ChangeCustomContentsStatus", "Version": "2023-10-01"}, {}, {}), "DeleteCustomLib": ApiInfo("POST", "/", {"Action": "DeleteCustomLib", "Version": "2023-10-01"}, {}, {}), "GetCustomLib": ApiInfo("GET", "/", {"Action": "GetCustomLib", "Version": "2023-10-01"}, {}, {}), "GetTextLibContent": ApiInfo("GET", "/", {"Action": "GetTextLibContent", "Version": "2023-10-01"}, {}, {}), "UploadTextLibContent": ApiInfo("POST", "/", {"Action": "UploadTextLibContent", "Version": "2023-10-01"}, {}, {}), "DeleteTextLibContent": ApiInfo("POST", "/", {"Action": "DeleteTextLibContent", "Version": "2023-10-01"}, {}, {}), "GetImageLibContent": ApiInfo("GET", "/", {"Action": "GetImageLibContent", "Version": "2023-10-01"}, {}, {}), "DeleteImageLibContent": ApiInfo("POST", "/", {"Action": "DeleteImageLibContent", "Version": "2023-10-01"}, {}, {}), "UploadImageLibContent": ApiInfo("POST", "/", {"Action": "UploadImageLibContent", "Version": "2023-10-01"}, {}, {}), } return api_info @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_video_risk(self, params, body): res = self.json("AsyncVideoRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def video_result(self, params, body): res = self.get("VideoResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json # deprecated, use image_content_risk_v2 instead def image_content_risk(self, params, body): res = self.json("ImageContentRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def image_content_risk_v2(self, params, body): res = self.json("ImageContentRiskV2", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_image_risk(self, params, body): res = self.json("AsyncImageRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def image_result(self, params, body): res = self.get("ImageResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_image_risk_v2(self, params, body): res = self.json("AsyncImageRiskV2", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def image_result_v2(self, params, body): res = self.get("ImageResultV2", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) # deprecated, use text_slice_risk instead def text_risk(self, params, body): res = self.json("TextRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_custom_contents(self, params, body): res = self.json("CreateCustomContents", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def upload_custom_contents(self, params, body): res = self.json("UploadCustomContents", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def enable_custom_contents(self, params, body): res = self.json("EnableCustomContents", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def disable_custom_contents(self, params, body): res = self.json("DisableCustomContents", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_custom_contents(self, params, body): res = self.json("DeleteCustomContents", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def async_live_video_risk(self, params, body): res = self.json("AsyncLiveVideoRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def async_audio_risk(self, params, body): res = self.json("AsyncAudioRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def audio_result(self, params, body): res = self.get("GetAudioResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def audio_risk(self, params, body): res = self.json("AudioRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def async_live_audio_risk(self, params, body): res = self.json("AsyncLiveAudioRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def live_audio_result(self, params, body): res = self.get("GetAudioLiveResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def live_video_result(self, params, body): res = self.get("GetVideoLiveResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def text_slice_risk(self, params, body): res = self.json("TextSliceRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def close_video_live_risk(self, params, body): res = self.json("CloseVideoLiveRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def close_audio_live_risk(self, params, body): res = self.json("CloseAudioLiveRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_custom_lib(self, params, body): res = self.json("CreateCustomLib", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_custom_lib(self, params, body): res = self.json("UpdateCustomLib", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def change_custom_contents_status(self, params, body): res = self.json("ChangeCustomContentsStatus", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_custom_lib(self, params, body): res = self.json("DeleteCustomLib", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_custom_lib(self, params, body): res = self.get("GetCustomLib", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_text_lib_content(self, params, body): res = self.get("GetTextLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def upload_text_lib_content(self, params, body): res = self.json("UploadTextLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_text_lib_content(self, params, body): res = self.json("DeleteTextLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_image_lib_content(self, params, body): res = self.get("GetImageLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_image_lib_content(self, params, body): res = self.json("DeleteImageLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def upload_image_lib_content(self, params, body): res = self.json("UploadImageLibContent", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/content_security/RcLlmAgentService.py ================================================ import json import threading import redo from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from requests import exceptions class RcLlmAgentService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(RcLlmAgentService, "_instance"): with RcLlmAgentService._instance_lock: if not hasattr(RcLlmAgentService, "_instance"): RcLlmAgentService._instance = object.__new__(cls) return RcLlmAgentService._instance def __init__(self): self.service_info = RcLlmAgentService.get_service_info() self.api_info = RcLlmAgentService.get_api_info() super(RcLlmAgentService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("contentservice.zijieapi.com", {'Accept': 'application/json'}, Credentials('', '', 'BusinessSecurity', 'cn-north-1'), 5 * 60, 5 * 60, "https") return service_info @staticmethod def get_api_info(): api_info = { "LlmTextModeration": ApiInfo("POST", "/openapi/v1/rc_llm/text_moderation", {"Action": "LlmTextModeration", "Version": "2022-08-26"}, {}, {}), "AsyncLlmTextModeration": ApiInfo("POST", "/openapi/v1/rc_llm/async_text_moderation", {"Action": "AsyncLlmTextModeration", "Version": "2022-08-26"}, {}, {}), "GetTextModerationResult": ApiInfo("GET", "/openapi/v1/rc_llm/text_moderation_result", {"Action": "GetTextModerationResult", "Version": "2022-08-26"}, {}, {}), "LlmCustomizeRisk": ApiInfo("POST", "/openapi/v1/rc_llm/custom_risk", {"Action": "LlmCustomizeRisk", "Version": "2022-08-26"}, {}, {}), "AsyncLlmCustomizeRisk": ApiInfo("POST", "/openapi/v1/rc_llm/async_custom_risk", {"Action": "AsyncLlmCustomizeRisk", "Version": "2022-08-26"}, {}, {}), "GetCustomizeRiskResult": ApiInfo("GET", "/openapi/v1/rc_llm/custom_risk_result", {"Action": "GetCustomizeRiskResult", "Version": "2022-08-26"}, {},{}), "LlmMultiModeration": ApiInfo("POST", "/openapi/v1/rc_llm/multi_moderation", {"Action": "LlmMultiModeration", "Version": "2022-08-26"}, {}, {}), "AsyncLlmMultiModeration": ApiInfo("POST", "/openapi/v1/rc_llm/async_multi_moderation", {"Action": "AsyncLlmMultiModeration", "Version": "2022-08-26"}, {}, {}), "GetMultiModerationResult": ApiInfo("GET", "/openapi/v1/rc_llm/multi_moderation_result", {"Action": "GetMultiModerationResult", "Version": "2022-08-26"}, {}, {}), "ImageTextLiteModeration": ApiInfo("POST", "/openapi/v1/rc_llm/image_text_lite_moderation", {"Action": "ImageTextLiteModeration", "Version": "2022-08-26"}, {}, {}), "AudioLiteModeration": ApiInfo("POST", "/openapi/v1/rc_llm/audio_lite_moderation", {"Action": "AudioLiteModeration", "Version": "2022-08-26"}, {}, {}), "AsyncAudioLiteModeration": ApiInfo("POST", "/openapi/v1/rc_llm/async_audio_lite_moderation", {"Action": "AsyncAudioLiteModeration", "Version": "2022-08-26"}, {}, {}), "AudioLiteModerationResult": ApiInfo("GET", "/openapi/v1/rc_llm/audio_lite_moderation_result", {"Action": "AudioLiteModerationResult", "Version": "2022-08-26"}, {}, {}), "AsyncVideoLiteModeration": ApiInfo("POST", "/openapi/v1/rc_llm/async_video_lite_moderation", {"Action": "AsyncVideoLiteModeration", "Version": "2022-08-26"}, {}, {}), "VideoLiteModerationResult": ApiInfo("GET", "/openapi/v1/rc_llm/video_lite_moderation_result", {"Action": "VideoLiteModerationResult", "Version": "2022-08-26"}, {}, {}), } return api_info def set_socket_timeout(self, timeout): self.service_info.socket_timeout = timeout def set_connection_timeout(self, timeout): self.service_info.connection_timeout = timeout @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def llm_text_moderation(self, params, body): res = self.json("LlmTextModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_llm_text_moderation(self, params, body): res = self.json("AsyncLlmTextModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_text_moderation_result(self, params, body): res = self.get("GetTextModerationResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def llm_customize_risk(self, params, body): res = self.json("LlmCustomizeRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_llm_customize_risk(self, params, body): res = self.json("AsyncLlmCustomizeRisk", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_customize_risk_result(self, params, body): res = self.get("GetCustomizeRiskResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def llm_multi_moderation(self, params, body): res = self.json("LlmMultiModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_llm_multi_moderation(self, params, body): res = self.json("AsyncLlmMultiModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_multi_moderation_result(self, params, body): res = self.get("GetMultiModerationResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def image_text_lite_moderation(self, params, body): res = self.json("ImageTextLiteModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def audio_lite_moderation(self, params, body): res = self.json("AudioLiteModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def async_audio_lite_moderation(self, params, body): res = self.json("AsyncAudioLiteModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def audio_lite_moderation_result(self, params, body): res = self.get("AudioLiteModerationResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def async_video_lite_moderation(self, params, body): res = self.json("AsyncVideoLiteModeration", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def video_lite_moderation_result(self, params, body): res = self.get("VideoLiteModerationResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/content_security/__init__.py ================================================ ================================================ FILE: volcengine/dcdn/DCDNService.py ================================================ # -*- coding: utf-8 -*- import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo SERVICE_VERSION = "2021-04-01" SERVICE_VERSION_V2 = "2023-01-01" service_info = ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'dcdn', 'cn-north-1'), 60 * 5, 60 * 5, "https") api_info = { # 查询域名列表: https://www.volcengine.com/docs/6559/192391 "DescribeUserDomains": ApiInfo("POST", "/", { "Action": "DescribeUserDomains", "Version": SERVICE_VERSION_V2}, {}, {}), # 查询全站加速域名的详细配置: https://www.volcengine.com/docs/6559/94321 "DescribeDomainConfig": ApiInfo("POST", "/", { "Action": "DescribeDomainConfig", "Version": SERVICE_VERSION}, {}, {}), # 新增全站加速域名: https://www.volcengine.com/docs/6559/79725 "CreateDomain": ApiInfo("POST", "/", { "Action": "CreateDomain", "Version": SERVICE_VERSION}, {}, {}), # 新增全站加速域名V2,支持识别Project: https://www.volcengine.com/docs/6559/191870 "CreateDomainV2": ApiInfo("POST", "/", { "Action": "CreateDomain", "Version": SERVICE_VERSION_V2}, {}, {}), # 启动全站加速域名: https://www.volcengine.com/docs/6559/94320 "StartDomain": ApiInfo("POST", "/", { "Action": "StartDomain", "Version": SERVICE_VERSION}, {}, {}), # 停止全站加速域名: https://www.volcengine.com/docs/6559/94319 "StopDomain": ApiInfo("POST", "/", { "Action": "StopDomain", "Version": SERVICE_VERSION}, {}, {}), # 删除全站加速域名: https://www.volcengine.com/docs/6559/95181 "DeleteDomain": ApiInfo("POST", "/", { "Action": "DeleteDomain", "Version": SERVICE_VERSION}, {}, {}), # 变更域名配置: https://www.volcengine.com/docs/6559/95183 "UpdateDomainConfig": ApiInfo("POST", "/", { "Action": "UpdateDomainConfig", "Version": SERVICE_VERSION}, {}, {}), # 变更域名配置V2,支持识别Project: https://www.volcengine.com/docs/6559/191883 "UpdateDomainConfigV2": ApiInfo("POST", "/", { "Action": "UpdateDomainConfig", "Version": SERVICE_VERSION_V2}, {}, {}), # 查询域名的资源用量数据: https://www.volcengine.com/docs/6559/79733 "DescribeStatistics": ApiInfo("POST", "/", { "Action": "DescribeStatistics", "Version": SERVICE_VERSION}, {}, {}), # 查询域名的回源资源用量数据: https://www.volcengine.com/docs/6559/79734 "DescribeOriginStatistics": ApiInfo("POST", "/", { "Action": "DescribeOriginStatistics", "Version": SERVICE_VERSION}, {}, {}), # 查询域名的实时资源用量数据: https://www.volcengine.com/docs/6559/79735 "DescribeRealtimeData": ApiInfo("POST", "/", { "Action": "DescribeRealtimeData", "Version": SERVICE_VERSION}, {}, {}), # 查询域名的回源实时资源用量数据: https://www.volcengine.com/docs/6559/79737 "DescribeOriginRealtimeData": ApiInfo("POST", "/", { "Action": "DescribeOriginRealtimeData", "Version": SERVICE_VERSION}, {}, {}), # 统计域名的区域分布数据: https://www.volcengine.com/docs/6559/79738 "DescribeDomainRegionData": ApiInfo("POST", "/", { "Action": "DescribeDomainRegionData", "Version": SERVICE_VERSION}, {}, {}), # 统计域名的运营商分布数据: https://www.volcengine.com/docs/6559/79739 "DescribeDomainIspData": ApiInfo("POST", "/", { "Action": "DescribeDomainIspData", "Version": SERVICE_VERSION}, {}, {}), # 统计域名的排行数据: https://www.volcengine.com/docs/6559/79740 "DescribeTopDomains": ApiInfo("POST", "/", { "Action": "DescribeTopDomains", "Version": SERVICE_VERSION}, {}, {}), # 统计URL的排行数据: https://www.volcengine.com/docs/6559/79741 "DescribeTopURLs": ApiInfo("POST", "/", { "Action": "DescribeTopURLs", "Version": SERVICE_VERSION}, {}, {}), # 统计IP的排行数据: https://www.volcengine.com/docs/6559/79742 "DescribeTopIPs": ApiInfo("POST", "/", { "Action": "DescribeTopIPs", "Version": SERVICE_VERSION}, {}, {}), # 统计Referer的排行数据: https://www.volcengine.com/docs/6559/79743 "DescribeTopReferers": ApiInfo("POST", "/", { "Action": "DescribeTopReferers", "Version": SERVICE_VERSION}, {}, {}), # 查询域名的PV数据: https://www.volcengine.com/docs/6559/79747 "DescribeDomainPVData": ApiInfo("POST", "/", { "Action": "DescribeDomainPVData", "Version": SERVICE_VERSION}, {}, {}), # 查询域名的UV数据: https://www.volcengine.com/docs/6559/79749 "DescribeDomainUVData": ApiInfo("POST", "/", { "Action": "DescribeDomainUVData", "Version": SERVICE_VERSION}, {}, {}), # 查询地域和运营商信息: https://www.volcengine.com/docs/6559/126042 "DescribeDcdnRegionAndIsp": ApiInfo("GET", "/", { "Action": "DescribeDcdnRegionAndIsp", "Version": SERVICE_VERSION}, {}, {}), # 查询访问资源用量细节: https://www.volcengine.com/docs/6559/131240 "DescribeStatisticsDetail": ApiInfo("POST", "/", { "Action": "DescribeStatisticsDetail", "Version": SERVICE_VERSION}, {}, {}), # 查询访问回源资源用量细节: https://www.volcengine.com/docs/6559/131253 "DescribeOriginStatisticsDetail": ApiInfo("POST", "/", { "Action": "DescribeOriginStatisticsDetail", "Version": SERVICE_VERSION}, {}, {}), # 查询访问日志: https://www.volcengine.com/docs/6559/79745 "DescribeDomainLogs": ApiInfo("POST", "/", { "Action": "DescribeDomainLogs", "Version": SERVICE_VERSION}, {}, {}), # 新增全站加速预热刷新任务: https://www.volcengine.com/docs/6559/102400 "CreatePurgePrefetchTask": ApiInfo("POST", "/", { "Action": "CreatePurgePrefetchTask", "Version": SERVICE_VERSION}, {}, {}), # 查询全站加速预热刷新任务: https://www.volcengine.com/docs/6559/102401 "CheckPurgePrefetchTask": ApiInfo("POST", "/", { "Action": "CheckPurgePrefetchTask", "Version": SERVICE_VERSION}, {}, {}), # 查询全站加速预热刷新任务Quota: https://www.volcengine.com/docs/6559/102402 "GetPurgePrefetchTaskQuota": ApiInfo("GET", "/", { "Action": "GetPurgePrefetchTaskQuota", "Version": SERVICE_VERSION}, {}, {}), # 查询全站加速预热刷新任务Quota: https://www.volcengine.com/docs/6559/102403 "RetryPurgePrefetchTask": ApiInfo("POST", "/", { "Action": "RetryPurgePrefetchTask", "Version": SERVICE_VERSION}, {}, {}), # 更新全站加速域名拨测配置: "UpdateDomainProbeSetting": ApiInfo("POST", "/", { "Action": "UpdateDomainProbeSetting", "Version": SERVICE_VERSION}, {}, {}), # 查询全站加速域名拨测配置: "DescribeDomainProbeSetting": ApiInfo("POST", "/", { "Action": "DescribeDomainProbeSetting", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘层节点的所有 IP: "DescribeDcdnEdgeIp": ApiInfo("POST", "/", { "Action": "DescribeDcdnEdgeIp", "Version": SERVICE_VERSION}, {}, {}), # 查询封禁IP "DescribeBlockIP": ApiInfo("POST", "/", { "Action": "DescribeBlockIP", "Version": SERVICE_VERSION}, {}, {}), # 海量IP封禁 "BatchBlockIP": ApiInfo("POST", "/", { "Action": "BatchBlockIP", "Version": SERVICE_VERSION}, {}, {}), "DescribeDcdnOriginIp": ApiInfo("POST", "/", { "Action": "DescribeDcdnOriginIp", "Version": SERVICE_VERSION}, {}, {}), "DescribeL2IPs": ApiInfo("POST", "/", { "Action": "DescribeL2IPs", "Version": SERVICE_VERSION}, {}, {}), # 查询域名归属验证信息: https://www.volcengine.com/docs/6559/1339302 "DescribeVerifyContent": ApiInfo("GET", "/", { "Action": "DescribeVerifyContent", "Version": SERVICE_VERSION}, {}, {}), # 验证域名归属关系: https://www.volcengine.com/docs/6559/1339303 "VerifyDomainOwnership": ApiInfo("POST", "/", { "Action": "VerifyDomainOwnership", "Version": SERVICE_VERSION}, {}, {}), # 更新GA源站的回源策略: "UpdateGAOriginPolicy": ApiInfo("POST", "/", { "Action": "UpdateGAOriginPolicy", "Version": SERVICE_VERSION}, {}, {}), # 查询GA源站的回源策略: "DescribeGAOriginPolicy": ApiInfo("POST", "/", { "Action": "DescribeGAOriginPolicy", "Version": SERVICE_VERSION}, {}, {}), # 查询WS的监控数据: "DescribeWSStatistics": ApiInfo("POST", "/", { "Action": "DescribeWSStatistics", "Version": SERVICE_VERSION}, {}, {}), } class DCDNService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(DCDNService, "_instance"): with DCDNService._instance_lock: if not hasattr(DCDNService, "_instance"): DCDNService._instance = object.__new__(cls) return DCDNService._instance def __init__(self): self.service_info = DCDNService.get_service_info() self.api_info = DCDNService.get_api_info() super(DCDNService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): return service_info @staticmethod def get_api_info(): return api_info def describe_user_domains(self, params=None): if params is None: params = {} action = "DescribeUserDomains" res = self.json(action,[], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_config(self, params=None): if params is None: params = {} action = "DescribeDomainConfig" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_domain(self, params=None): if params is None: params = {} action = "CreateDomain" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_domain_v2(self, params=None): if params is None: params = {} action = "CreateDomainV2" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def start_domain(self, params=None): if params is None: params = {} action = "StartDomain" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def stop_domain(self, params=None): if params is None: params = {} action = "StopDomain" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_domain(self, params=None): if params is None: params = {} action = "DeleteDomain" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_domain_config(self, params=None): if params is None: params = {} action = "UpdateDomainConfig" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_domain_config_v2(self, params=None): if params is None: params = {} action = "UpdateDomainConfigV2" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_statistics(self, params=None): if params is None: params = {} action = "DescribeStatistics" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_ws_statistics(self, params=None): if params is None: params = {} action = "DescribeWSStatistics" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_statistics(self, params=None): if params is None: params = {} action = "DescribeOriginStatistics" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_realtime_data(self, params=None): if params is None: params = {} action = "DescribeRealtimeData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_realtime_data(self, params=None): if params is None: params = {} action = "DescribeOriginRealtimeData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_region_data(self, params=None): if params is None: params = {} action = "DescribeDomainRegionData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_isp_data(self, params=None): if params is None: params = {} action = "DescribeDomainIspData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_top_domains(self, params=None): if params is None: params = {} action = "DescribeTopDomains" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_top_urls(self, params=None): if params is None: params = {} action = "DescribeTopURLs" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_top_ips(self, params=None): if params is None: params = {} action = "DescribeTopIPs" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_top_referers(self, params=None): if params is None: params = {} action = "DescribeTopReferers" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_pv_data(self, params=None): if params is None: params = {} action = "DescribeDomainPVData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_uv_data(self, params=None): if params is None: params = {} action = "DescribeDomainUVData" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_dcdn_region_and_isp(self, params=None): if params is None: params = {} action = "DescribeDcdnRegionAndIsp" res = self.get(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_statistics_detail(self, params=None): if params is None: params = {} action = "DescribeStatisticsDetail" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_origin_statistics_detail(self, params=None): if params is None: params = {} action = "DescribeOriginStatisticsDetail" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_logs(self, params=None): if params is None: params = {} action = "DescribeDomainLogs" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_purge_prefetch_task(self, params=None): if params is None: params = {} action = "CreatePurgePrefetchTask" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def check_purge_prefetch_task(self, params=None): if params is None: params = {} action = "CheckPurgePrefetchTask" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def get_purge_prefetch_task_quota(self, params=None): if params is None: params = {} action = "GetPurgePrefetchTaskQuota" res = self.get(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def retry_purge_prefetch_task(self, params=None): if params is None: params = {} action = "RetryPurgePrefetchTask" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_domain_probe_setting(self, params=None): if params is None: params = {} action = "UpdateDomainProbeSetting" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain_probe_setting(self, params=None): if params is None: params = {} action = "DescribeDomainProbeSetting" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_dcdn_edge_ip(self, params=None): if params is None: params = {} action = "DescribeDcdnEdgeIp" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_block_ip(self, params=None): if params is None: params = {} action = "DescribeBlockIP" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def batch_block_ip(self, params=None): if params is None: params = {} action = "BatchBlockIP" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_ga_origin_policy(self, params=None): if params is None: params = {} action = "UpdateGAOriginPolicy" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_dcdn_origin_ip(self, params=None): if params is None: params = {} action = "DescribeDcdnOriginIp" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_ga_origin_policy(self, params=None): if params is None: params = {} action = "DescribeGAOriginPolicy" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_l2_ips(self, params=None): if params is None: params = {} action = "DescribeL2IPs" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_verify_content(self, params=None): if params is None: params = {} action = "DescribeVerifyContent" res = self.get(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def verify_domain_ownership(self, params=None): if params is None: params = {} action = "VerifyDomainOwnership" res = self.json(action, [], json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json ================================================ FILE: volcengine/dcdn/__init__.py ================================================ ================================================ FILE: volcengine/dts/__init__.py ================================================ ================================================ FILE: volcengine/dts/dts_service.py ================================================ import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service SERVICE_VERSION = "2022-10-01" PRE_SERVICE_VERSION = "2018-01-01" SERVICE_HOST = "dts.volcengineapi.com" SERVICE_NAME = "dts" REST_API_METHOD = "POST" service_info_map = { "cn-beijing": ServiceInfo(SERVICE_HOST, {'accept': 'application/json', }, Credentials('', '', SERVICE_NAME, "cn-beijing"), 60 * 5, 60 * 5, "https"), "cn-guangzhou": ServiceInfo(SERVICE_HOST, {'accept': 'application/json', }, Credentials('', '', SERVICE_NAME, "cn-guangzhou"), 60 * 5, 60 * 5, "https"), "cn-shanghai": ServiceInfo(SERVICE_HOST, {'accept': 'application/json', }, Credentials('', '', SERVICE_NAME, "cn-shanghai"), 60 * 5, 60 * 5, "https"), } api_info = { "StartTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "StartTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "CreateTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "CreateTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "StopTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "StopTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "SuspendTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "SuspendTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "ResumeTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "ResumeTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "RetryTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "RetryTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "DeleteTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "DeleteTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "ModifyTransmissionTask": ApiInfo(REST_API_METHOD, "/", {"Action": "ModifyTransmissionTask", "Version": SERVICE_VERSION}, {}, {}), "DescribeTransmissionTaskProgress": ApiInfo(REST_API_METHOD, "/", {"Action": "DescribeTransmissionTaskProgress", "Version": SERVICE_VERSION}, {}, {}), "DescribeTransmissionTaskInfo": ApiInfo(REST_API_METHOD, "/", {"Action": "DescribeTransmissionTaskInfo", "Version": SERVICE_VERSION}, {}, {}), "DescribeTransmissionTasks": ApiInfo(REST_API_METHOD, "/", {"Action": "DescribeTransmissionTasks", "Version": SERVICE_VERSION}, {}, {}), "PreCheckAsync": ApiInfo(REST_API_METHOD, "/", {"Action": "PreCheckAsync", "Version": PRE_SERVICE_VERSION}, {}, {}), "GetAsyncPreCheckResult": ApiInfo(REST_API_METHOD, "/", {"Action": "GetAsyncPreCheckResult", "Version": PRE_SERVICE_VERSION}, {}, {}), } class DtsService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(DtsService, "_instance"): with DtsService._instance_lock: if not hasattr(DtsService, "_instance"): DtsService._instance = object.__new__(cls) return DtsService._instance def __init__(self, region): self.service_info = DtsService.get_service_info(region) self.api_info = DtsService.get_api_info() super(DtsService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('do not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info def stop_transmission_task(self, params, body): res = self.json('StopTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def suspend_transmission_task(self, params, body): res = self.json('SuspendTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def resume_transmission_task(self, params, body): res = self.json('ResumeTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_transmission_task(self, params, body): res = self.json('CreateTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def start_transmission_task(self, params, body): res = self.json('StartTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def modify_transmission_task(self, params, body): res = self.json('ModifyTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_transmission_task(self, params, body): res = self.json('DeleteTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def retry_transmission_task(self, params, body): res = self.json('RetryTransmissionTask', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_transmission_tasks(self, params, body): res = self.json('DescribeTransmissionTasks', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_transmission_task_info(self, params, body): res = self.json('DescribeTransmissionTaskInfo', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_transmission_task_progress(self, params, body): res = self.json('DescribeTransmissionTaskProgress', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def pre_check_async(self, params, body): res = self.json('PreCheckAsync', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_async_pre_check_result(self, params, body): res = self.json('GetAsyncPreCheckResult', params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/emr/EMRService.py ================================================ # -*- coding: utf-8 -*- import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo service_info_map = { "cn-beijing": ServiceInfo("open.volcengineapi.com", {'accept': 'application/json', }, Credentials('', '', "emr", "cn-beijing"), 60 * 5, 60 * 5, "https"), "cn-guangzhou": ServiceInfo("open.volcengineapi.com", {'accept': 'application/json', }, Credentials('', '', "emr", "cn-guangzhou"), 60 * 5, 60 * 5, "https"), "cn-shanghai": ServiceInfo("open.volcengineapi.com", {'accept': 'application/json', }, Credentials('', '', "emr", "cn-shanghai"), 60 * 5, 60 * 5, "https"), } api_info = { # https://www.volcengine.com/docs/6491/145561 "CreateCluster": ApiInfo("POST", "/", { "Action": "CreateCluster", "Version": "2022-06-30"}, {}, {}), # https://www.volcengine.com/docs/6491/145562 "ResizeCluster": ApiInfo("GET", "/", { "Action": "ResizeCluster", "Version": "2022-04-15"}, {}, {}), # https://www.volcengine.com/docs/6491/145563 "DescribeCluster": ApiInfo("GET", "/", { "Action": "DescribeCluster", "Version": "2022-04-15"}, {}, {}), # https://www.volcengine.com/docs/6491/145564 "ListInstances": ApiInfo("POST", "/", { "Action": "ListInstances", "Version": "2022-06-30"}, {}, {}), # https://www.volcengine.com/docs/6491/145565 "ListClusters": ApiInfo("GET", "/", { "Action": "ListClusters", "Version": "2021-09-15"}, {}, {}), # https://www.volcengine.com/docs/6491/145566 "ListInstanceGroups": ApiInfo("POST", "/", { "Action": "ListInstanceGroups", "Version": "2022-06-30"}, {}, {}), # https://www.volcengine.com/docs/6491/145567 "ReleaseCluster": ApiInfo("POST", "/", { "Action": "ReleaseCluster", "Version": "2022-04-15"}, {}, {}), # https://www.volcengine.com/docs/6491/145568 "AddTags": ApiInfo("POST", "/", { "Action": "AddTags", "Version": "2022-06-30"}, {}, {}), # https://www.volcengine.com/docs/6491/145569 "RemoveTags": ApiInfo("POST", "/", { "Action": "RemoveTags", "Version": "2022-06-30"}, {}, {}), } class EMRService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(EMRService, "_instance"): with EMRService._instance_lock: if not hasattr(EMRService, "_instance"): EMRService._instance = object.__new__(cls) return EMRService._instance def __init__(self, region="cn-beijing"): self.service_info = EMRService.get_service_info(region) self.api_info = EMRService.get_api_info() super(EMRService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('do not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info def create_cluster(self, params, body): res = self.json("CreateCluster", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_cluster(self, params): res = self.get("DescribeCluster", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_instances(self, params, body): res = self.json("ListInstances", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_clusters(self, params): res = self.get("ListClusters", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_instance_groups(self, params, body): res = self.json("ListInstanceGroups", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def release_cluster(self, params, body): res = self.json("ReleaseCluster", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def add_tags(self, params, body): res = self.json("AddTags", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def remove_tags(self, params, body): res = self.json("RemoveTags", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/emr/__init__.py ================================================ ================================================ FILE: volcengine/example/DemoSignOnly.py ================================================ # coding: utf-8 import datetime from volcengine.auth.SignerV4 import SignerV4 from volcengine.auth.SignParam import SignParam from volcengine.Credentials import Credentials from collections import OrderedDict if __name__ == '__main__': sign = SignerV4() param = SignParam() param.path = '/' param.method = 'GET' param.host = 'open.volcengineapi.com' param.body = '' param.date = datetime.datetime.utcfromtimestamp(1640712206) query = OrderedDict() query['Action'] = 'ListUsers' query['Version'] = '2018-01-01' query['Limit'] = '5' query['Offset'] = '0' param.query = query header = OrderedDict() header['Host'] = 'open.volcengineapi.com' param.header_list = header cren = Credentials('ak','sk', 'iam', 'cn-north-1') result = sign.sign_only(param, cren) print(result) ================================================ FILE: volcengine/example/__init__.py ================================================ name = 'volc' ================================================ FILE: volcengine/example/adblocker/example_adblocker.py ================================================ from volcengine.adblocker.AdBlockerService import AdBlockService if __name__ == '__main__': adblocker = AdBlockService() # call below method if you dont set ak and sk in $HOME/.volc/config adblocker.set_ak('ak') adblocker.set_sk('sk') params = dict() req = { 'AppId': 1, 'Service': "chat", 'Parameters': '{"uid":123411, "operate_time":1609818934, "chat_text":"a"}' } resp = adblocker.ad_block(params, req) print(resp) ================================================ FILE: volcengine/example/billing/example_list_amortized_cost_bill_detail.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '' params['AmortizedMonth'] = '2023-06' params['AmortizedDay'] = '' params['Product'] = '' params['InstanceNo'] = '' params['BillingMode'] = '' params['BillCategory'] = '' params['AmortizedType'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 params['Offset'] = 0 params['Limit'] = 10 body = {} resp = billing_service.list_amortized_cost_bill_detail(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/billing/example_list_amortized_cost_bill_monthly.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '' params['AmortizedMonth'] = '2023-06' params['Product'] = '' params['InstanceNo'] = '' params['BillingMode'] = '' params['BillCategory'] = '' params['AmortizedType'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 params['Offset'] = 0 params['Limit'] = 10 body = {} resp = billing_service.list_amortized_cost_bill_monthly(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/billing/example_list_bill.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '2022-01' params['Limit'] = 10 params['Offset'] = 0 params['Product'] = '' params['BillingMode'] = '' params['BillCategoryParent'] = '' params['PayStatus'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 body = {} resp = billing_service.list_bill(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/billing/example_list_bill_detail.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '2022-01' params['Limit'] = 10 params['Offset'] = 0 params['GroupTerm'] = 0 params['GroupPeriod'] = 2 params['Product'] = '' params['BillingMode'] = '' params['BillCategory'] = '' params['InstanceNo'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 body = {} resp = billing_service.list_bill_detail(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/billing/example_list_bill_overview_by_prod.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '2022-01' params['Limit'] = 10 params['Offset'] = 0 params['Product'] = '' params['BillingMode'] = '' params['BillCategoryParent'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 body = {} resp = billing_service.list_bill_overview_by_prod(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/billing/example_list_split_bill_detail.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.billing.BillingService import BillingService if __name__ == '__main__': testAk = "" testSk = "" billing_service = BillingService() billing_service.set_ak(testAk) billing_service.set_sk(testSk) params = dict() params['BillPeriod'] = '2023-06' params['GroupPeriod'] = 2 params['Product'] = '' params['BillingMode'] = '' params['BillCategory'] = '' params['InstanceNo'] = '' params['SplitItemID'] = '' params['IgnoreZero'] = 0 params['NeedRecordNum'] = 0 params['Offset'] = 0 params['Limit'] = 10 body = {} resp = billing_service.list_split_bill_detail(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/bioos/__init__.py ================================================ ================================================ FILE: volcengine/example/bioos/example_bind_cluster_to_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ID': 'workspace_id', 'ClusterID': 'cluster_id', 'Type': 'workflow', } resp = bioos_service.bind_cluster_to_workspace(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_cancel_run.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'run_id', } resp = bioos_service.cancel_run(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_cancel_submission.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'submission_id', } resp = bioos_service.cancel_submission(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_data_model.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'Name': 'file_name', 'Headers': ['my_entity_id', 'column-1-file-CRAM', 'date'], 'Rows': [ ['your-sample-1-id', 'https:test.tos-cn-beijing.volces.com/file1.cram', '01/01/2022'], ['your-sample-2-id', 'https:test.tos-cn-beijing.volces.com/file2.cram', '01/01/2022'], ['your-sample-3-id', 'https:test.tos-cn-beijing.volces.com/file3.cram', '01/01/2022'] ], } resp = bioos_service.create_data_model(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_data_set.py ================================================ # coding:utf-8 from __future__ import print_function import datetime import time from typing import List import pytz import yaml from volcengine.bioos.BioOsService import BioOsService class YamlConverter: class Publications: def __init__(self, title: str, authors: List[str], access_url: str = None, quotation: str = None): self.Name = title self.Authors = authors if access_url is not None: self.AccessURL = access_url if quotation is not None: self.Quotation = quotation def __init__(self, yaml_file: str): with open(yaml_file, "r", encoding="UTF-8") as f: yaml_dict = yaml.load(f, Loader=yaml.FullLoader) self.Name = yaml_dict.get("Name", None) self.Description = yaml_dict.get("Description", None) self.DocURL = yaml_dict.get("Documentation", None) self.Email = yaml_dict.get("Contact", None) self.Owners = yaml_dict.get("Owners", None) self.Licence = yaml_dict.get("Licence", None) self.Category = yaml_dict.get("Relevance", None) createDate = yaml_dict.get("CreateDate", None) if createDate: self.check_time_format(str(createDate)) utc_date = datetime.datetime.combine(createDate, datetime.datetime.min.time()) utc_date = pytz.utc.localize(utc_date) self.CreateTime = int(time.mktime(utc_date.timetuple())) updateDate = yaml_dict.get("UpdateDate", None) if updateDate: self.check_time_format(str(updateDate)) utc_date = datetime.datetime.combine(updateDate, datetime.datetime.min.time()) utc_date = pytz.utc.localize(utc_date) self.UpdateTime = int(time.mktime(utc_date.timetuple())) self.Catalogue = yaml_dict.get("Catalogue", None) project_type = yaml_dict.get("ProjectType", None) if project_type: self.ProjectDataTypes = project_type.get("ProjectDataTypes", None) self.SampleScope = project_type.get("SampleScope", None) self.Labels = yaml_dict.get("Labels", None) other_info = yaml_dict.get("Other", None) if other_info: self.ExternalLink = other_info.get("ExternalLink", None) self.ExternalLinkDescription = other_info.get("ExternalLinkDescription", None) self.ExampleTutorial = other_info.get("Tutorial", None) self.Tools = other_info.get("Tools&applications", None) self.Publications = [] publications = yaml_dict.get("Publications", None) if publications is not None: for publication in publications: self.Publications.append(YamlConverter.Publications( publication.get("Title", None), publication.get("Authors", None), publication.get("URL", None), publication.get("Citation", None) ).__dict__) self.DataFilesAccessURL = yaml_dict.get("DataFilesURL", None) self.DataFileSamplesAccessURL = yaml_dict.get("DataFileSamplesURL", None) self.DataFileAccessMethodURL = yaml_dict.get("DataFileMethodURL", None) def build_create_params(self): return self.__dict__ @staticmethod def check_time_format(t): try: datetime.datetime.strptime(t, "%Y-%m-%d") except Exception as e: print("time format %Y-%m-%d not matched") raise e if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = YamlConverter("example_dataset.yaml").build_create_params() resp = bioos_service.create_data_set(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_notebook_server_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'BaseImage': 'base_image', 'ImageName': 'image_name', 'DisplayName': 'custom', 'Source': 'building', 'Packages': { 'Pip': {'numpy': '1.22.2'}, }, 'ImageVersion': '1.0.0', } resp = bioos_service.create_notebook_server_image(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_submission.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService import json if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ClusterID': 'cluster_id', 'WorkspaceID': 'workspace_id', 'WorkflowID': 'workflow_id', 'Name': 'submission_name', 'Description': 'submission_description', 'DataModelID': 'data_model_id', 'DataModelRowIDs': ['your-sample-3-id'], 'Inputs': json.dumps({ 'testname.hello.name': 'this.name1' }), 'ExposedOptions': {'ReadFromCache': True}, 'Outputs': json.dumps({ 'testname.hello.response': 'this.response1' }), } resp = bioos_service.create_submission(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_workflow.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'Name': 'workflow_name', 'Description': 'workflow_description', 'Language': 'WDL', 'Source': 'http://foo.git', 'Tag': 'baz', 'MainWorkflowPath': 'aaa/bbb.wdl', } resp = bioos_service.create_workflow(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_create_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'Name': 'workspace_name', 'Description': 'workspace_description' } resp = bioos_service.create_workspace(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_dataset.yaml ================================================ Name: GRCh37 Genome Reference Consortium Human Reference 37(hg19) Description: 'It contains the genome sequence files from the original release in 2009 by NCBI(GCA_000001405.1) and some related files. This original version and all subsequent changes are called "hg19" at UCSC. GRCh37 was produced and is updated by the Genome Reference Consortium: https://www.ncbi.nlm.nih.gov/grc' Documentation: http://sss.com Contact: genome@soe.ucsc.edu ManagedBy: "bio2s[Bio-OS]" Owners: - user1 - user2 Licence: http://sss.com Relevance: 组学基础研究 CreateDate: 2009-03-01 UpdateDate: 2020-03-01 Catalogue: OMICSDATA ProjectType: ProjectDataTypes: - Whole Genome sequencing SampleScope: Monoisolate Other: ExternalLink: https://hgdownload.soe.ucsc.edu/downloads.html ExternalLinkDescription: This page contains links to sequence and annotation downloads for the genome assemblies featured in the UCSC Genome Browser.Downloads are also available via our JSON API, MySQL server, or FTP server. Data filtering is available in the Table Browser or via the command-line utilities.For access to the most recent assembly of each genome, see the current genomes directory. Previous versions of certain data are available from our track archive. Data hosted in Public Hubs exists on external sites. GenArk (Genome Archive) species data can be found here. All data in the Genome Browser are freely usable for any purpose except as indicated in the README.txt files in the download directories. These data were contributed by many researchers, as listed on the Genome Browser credits page. Please acknowledge the contributor(s) of the data you use. Tutorial: http://sss.com Tools&applications: http://sss.com Publications: - Title: title URL: http://aaa.bbb.com Authors: - author1 - author2 Citation: http://111.222.com Labels: - human - genome reference DataFilesURL: null DataFileSamplesURL: null DataFileMethodURL: null ================================================ FILE: volcengine/example/bioos/example_delete_cluster.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { } resp = bioos_service.delete_cluster(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_data_model_rows_and_headers.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'data_model_id', 'RowIDs': ['your-sample-3-id'] } resp = bioos_service.delete_data_model_rows_and_headers(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_data_set.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "ID": "dataset_id" } resp = bioos_service.delete_data_set(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_notebook_server.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'UserID': 123456 } resp = bioos_service.delete_notebook_server(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_notebook_server_settings.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', } resp = bioos_service.delete_notebook_server_settings(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_submission.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'submission_id' } resp = bioos_service.delete_submission(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_workflow.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'workflow_id' } resp = bioos_service.delete_workflow(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_delete_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { } resp = bioos_service.delete_workspace(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_api_accesskey.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ClusterID': 'cluster_id', } resp = bioos_service.get_api_accesskey(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_notebook_edit_info.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "WorkspaceID": "workspace_id", "Name": "__dashboard__" }, resp = bioos_service.get_notebook_edit_info(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_notebook_server_extra_packages.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', } resp = bioos_service.get_notebook_server_extra_packages(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_notebook_server_settings.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "WorkspaceID": "workspace_id" }, resp = bioos_service.get_notebook_server_settings(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_notebook_server_stat.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "WorkspaceID": "workspace_id" }, resp = bioos_service.get_notebook_server_stat(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_get_trs_workflow_info.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "TRSServer": "https://dockstore.org", "ID": "#workflow/github.com/aaa/bbb/ccc" } resp = bioos_service.get_trs_workflow_info(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_clusters.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'PageNumber': 1, 'PageSize': 10, 'Filter': { 'IDs': ['test-workflow'], 'Status': ['Running'], 'Type': ['shared'], 'Public': True, }, } resp = bioos_service.list_clusters(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_clusters_of_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'Type': 'notebook', 'ID': 'workspace_id' } resp = bioos_service.list_clusters(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_data_files.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "DataSetID": "dataset_id", "PageNumber": 1, "PageSize": 10, "Filter": { "IDs": ["data_file_id1", "data_file_id2"], "FileType": ["csv"], "Keyword": "key" }, "SortBy": "Name", "SortOrder": "Desc" }, resp = bioos_service.list_data_files(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_data_model_rows.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'ID': 'data_model_id', 'PageNumber': 1, 'PageSize': 0, 'SortBy': 'id', 'SortOrder': 'DESC' } resp = bioos_service.list_data_model_rows(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_data_models.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', } resp = bioos_service.list_data_models(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_data_sets.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "PageNumber": 1, "PageSize": 10, "Filter": { "IDs": ["dataset_id1", "dataset_id2"], "ProjectDataTypes": ["data_type"], "Categories": ["示例数据"], "Keyword": "key", "Owner": "ownerName" }, "SortBy": "Name", "SortOrder": "Desc" }, resp = bioos_service.list_data_sets(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_notebook_server_images.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "ImageIDs": ["1", "2"], "Source": "official", "Status": "pending", "DisplayName": "xxxxxxxx" }, resp = bioos_service.list_notebook_server_images(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_notebook_server_resource_opts.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { } resp = bioos_service.list_notebook_server_resource_opts(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_notebook_servers.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "PageNumber": 1, "PageSize": 10, "Filter": { "Status": "spawn", "WorkspaceID": "workspace_id", "UserID": 123456 }, "SortBy": "OwnerName", "SortOrder": "Desc" } resp = bioos_service.list_notebook_servers(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_overview_submissions.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "PageNumber": 1, "PageSize": 10, "SortBy": "OwnerName", "SortOrder": "Desc" } resp = bioos_service.list_overview_submissions(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_runs.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'Filter': {'IDs': ['run_id1', 'run_id2']}, } resp = bioos_service.list_runs(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_submissions.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'Filter': {'IDs': ['submission_id1', 'submission_id2']}, } resp = bioos_service.list_submissions(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_tasks.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'RunID': 'run_id', 'WorkspaceID': 'workspace_id' } resp = bioos_service.list_tasks(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_workflows.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workspace_id', 'SortBy': 'CreateTime', 'PageNumber': 1, 'PageSize': 0, 'SortOrder': 'DESC', } resp = bioos_service.list_workflows(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_workspace_labels.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = {} resp = bioos_service.list_workspace_labels(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_list_workspaces.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = {} resp = bioos_service.list_workspaces(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_stop_notebook_server.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "WorkspaceID": "workspace_id" } resp = bioos_service.stop_notebook_server(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_unbind_cluster_and_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ID': 'workspace_id', 'ClusterID': 'cluster_id', 'Type': 'notebook' } resp = bioos_service.unbind_cluster_and_workspace(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_update_api_accesskey.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ClusterID': 'cluster_id', 'AccessKeyID': 'AKxxxxxxxx', 'SecretAccessKey': 'xxxxxxxxxx', } resp = bioos_service.update_api_accesskey(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_update_notebook_server_settings.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { "WorkspaceID": "workspace_id", "ResourceSize": "small", "ImageID": "1", "MountTOSEnabled": False, "TempImageName": "jupyter/minimal-notebook" } resp = bioos_service.update_notebook_server_settings(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_update_workflow.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'WorkspaceID': 'workflow_id', 'ID': 'workflow_id', 'Name': 'workflow_name', 'Description': 'workflow_description', 'Source': 'https://foo/wdl.git', 'Tag': 'git_tag', 'Token': 'git_token', 'MainWorkflowPath': 'hello.wdl' } resp = bioos_service.update_workflow(params) print(resp) ================================================ FILE: volcengine/example/bioos/example_update_workspace.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.bioos.BioOsService import BioOsService if __name__ == '__main__': # set endpoint/region here if the default value is unsatisfied bioos_service = BioOsService(endpoint='endpoint', region='region') # call below method if you don't set ak and sk in $HOME/.volc/config bioos_service.set_ak('ak') bioos_service.set_sk('sk') params = { 'ID': 'workspace_id', 'Name': 'workspace_name', 'Description': 'workspace_description', 'CoverPath': 'template-cover/pic1.png' } resp = bioos_service.update_workspace(params) print(resp) ================================================ FILE: volcengine/example/business_security/example_risk_detect.py ================================================ from volcengine.business_security.RiskDetectionService import RiskDetectService if __name__ == '__main__': riskDetector = RiskDetectService() # call below method if you dont set ak and sk in $HOME/.volc/config riskDetector.set_ak('AK') riskDetector.set_sk('SK') params = dict() req = { 'AppId': 0, 'Service': "", 'Parameters': '{}' } resp = riskDetector.risk_detect(params, req) ================================================ FILE: volcengine/example/cdn/__init__.py ================================================ ak = '' sk = '' ================================================ FILE: volcengine/example/cdn/add_cdn_certificate.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Certificate': { 'Certificate': '''-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----''', 'PrivateKey': '''-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----''' }, 'CertInfo': { 'Desc': 'remark', }, 'Source': 'volc_cert_center' } resp = svc.add_cdn_certificate(body) print(resp) ================================================ FILE: volcengine/example/cdn/add_cdn_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', 'ServiceType': 'web', 'Origin': [ { 'OriginAction': { 'OriginLines': [{ 'OriginType': 'primary', 'InstanceType': 'ip', 'Address': '1.1.1.1', 'HttpPort': '80', 'HttpsPort': '443', 'Weight': '100' }] } } ], 'OriginProtocol': 'HTTP' } resp = svc.add_cdn_domain(body) print(resp) ================================================ FILE: volcengine/example/cdn/add_resource_tags.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Resources': ['example.com', 'example1.com'], 'ResourceTags': [ {'Key': 'userKey', 'Value': 'userVal'} ] } resp = svc.add_resource_tags(body) print(resp) ================================================ FILE: volcengine/example/cdn/batch_deploy_cert.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'CertId': 'cert-xxx', 'Domain': 'xxx.com', } resp = svc.batch_deploy_cert(body) print(resp) ================================================ FILE: volcengine/example/cdn/delete_cdn_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', } resp = svc.delete_cdn_domain(body) print(resp) ================================================ FILE: volcengine/example/cdn/delete_resource_tags.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Resources': ['example.com', 'example1.com'], 'ResourceTags': [ {'Key': 'userKey', 'Value': 'userVal'} ] } resp = svc.delete_resource_tags(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_accounting_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Metric': 'flux', 'Domain': 'example.com', } resp = svc.describe_accounting_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_accounting_summary.py ================================================ # -*- coding: utf-8 -*- import os import sys import datetime sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Domain': 'example.com', } resp = svc.describe_accounting_summary(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_access_log.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Domain': 'example.com', } resp = svc.describe_cdn_access_log(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_config.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com' } resp = svc.describe_cdn_config(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'pv', 'Domain': 'example.com', 'Interval': '5min', 'Isp': 'CT', 'Region': 'BJ', 'Protocol': 'http', 'IpVersion': 'ipv4', "OnlyTotal": True } resp = svc.describe_cdn_data(body) print(resp) # use method GET resp = svc.describe_cdn_data(body, svc.use_get()) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_data_detail.py ================================================ # -*- coding: utf-8 -*- import os import sys import datetime sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Metric': 'pv', 'Domain': 'example.com', 'Interval': '5min', 'Protocol': 'http', 'IpVersion': 'ipv4' } resp = svc.describe_cdn_data_detail(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_origin_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Metric': 'pv', 'Domain': 'example.com', 'Interval': '5min', } resp = svc.describe_cdn_origin_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_region_and_isp.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Area': 'China' } print(body) resp = svc.describe_cdn_region_and_isp(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_service.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) resp = svc.describe_cdn_service() print(resp) ================================================ FILE: volcengine/example/cdn/describe_cdn_upper_ip.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', } resp = svc.describe_cdn_upper_ip(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_cert_config.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'CertId': 'cert-xxxx' } resp = svc.describe_cert_config(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_content_block_tasks.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'TaskType': 'block_url', 'StartTime': now - 86400, 'EndTime': now, } print(body) resp = svc.describe_content_block_tasks(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_content_quota.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) resp = svc.describe_content_quota() print(resp) # Get 请求 resp = svc.describe_content_quota(method=svc.use_get()) print(resp) ================================================ FILE: volcengine/example/cdn/describe_content_tasks.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { "PageNum": 1, 'PageSize': 10, 'TaskType': 'refresh_file' } resp = svc.describe_content_tasks(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_district_isp_data.py ================================================ # -*- coding: utf-8 -*- import os import sys import datetime sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 3600, 'EndTime': now, 'Metric': 'bandwidth', 'Domain': 'example.com', 'Interval': '5min', 'Protocol': 'http', 'IpVersion': 'ipv4' } resp = svc.describe_district_isp_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_edge_nrt_data_summary.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'pv', } print(body) resp = svc.describe_edge_nrt_data_summary(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_edge_statistical_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'clientIp', 'Domain': 'example.com', } print(body) resp = svc.describe_edge_statistical_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_edge_top_nrt_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'flux', 'Domain': 'example.com', 'Item': 'region' } print(body) resp = svc.describe_edge_top_nrt_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_edge_top_statistical_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'clientip', 'Domain': 'example.com', 'Item': 'region' } print(body) resp = svc.describe_edge_top_statistical_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_edge_top_status_code.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'Metric': 'status_5xx', 'Item': 'domain' } print(body) resp = svc.describe_edge_top_status_code(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_ip_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'IP': "1.1.1.1" } resp = svc.describe_ip_info(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_ip_list_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'IpList': "1.1.1.1,2.2.2.2" } resp = svc.describe_ip_list_info(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_origin_nrt_data_summary.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'pv', } print(body) resp = svc.describe_origin_nrt_data_summary(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_origin_top_nrt_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'StartTime': now - 86400, 'EndTime': now, 'Metric': 'flux', 'Item': 'domain' } print(body) resp = svc.describe_origin_top_nrt_data(body) print(resp) ================================================ FILE: volcengine/example/cdn/describe_origin_top_status_code.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") import datetime from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) now = int(datetime.datetime.now().strftime("%s")) body = { 'Metric': 'status_5xx', 'Item': 'domain' } print(body) resp = svc.describe_origin_top_status_code(body) print(resp) ================================================ FILE: volcengine/example/cdn/list_cdn_cert_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { } resp = svc.list_cdn_cert_info(body) print(resp) ================================================ FILE: volcengine/example/cdn/list_cdn_domains.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'ServiceType': 'web', 'PageNum': 1, 'PageSize': 100 } resp = svc.list_cdn_domains(body) print(resp) # use method GET resp = svc.list_cdn_domains(body, svc.use_get()) print(resp) ================================================ FILE: volcengine/example/cdn/list_cert_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Source': 'volc_cert_center' } resp = svc.list_cert_info(body) print(resp) ================================================ FILE: volcengine/example/cdn/list_resource_tags.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) resp = svc.list_resource_tags() print(resp) ================================================ FILE: volcengine/example/cdn/start_cdn_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', } resp = svc.start_cdn_domain(body) print(resp) ================================================ FILE: volcengine/example/cdn/stop_cdn_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', } resp = svc.stop_cdn_domain(body) print(resp) ================================================ FILE: volcengine/example/cdn/submit_block_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { "Urls": "http://example.com/1.txt\nhttp://example.com/2.jpg", } resp = svc.submit_block_task(body) print(resp) ================================================ FILE: volcengine/example/cdn/submit_preload_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { "Urls": "http://example.com/1.txt\nhttp://example.com/2.jpg", } resp = svc.submit_preload_task(body) print(resp) ================================================ FILE: volcengine/example/cdn/submit_refresh_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) print(ak, sk) body = { "Type": "file", "Urls": "http://example.com/1.txt\nhttp://example.com/2.jpg", } resp = svc.submit_refresh_task(body) print(resp) ================================================ FILE: volcengine/example/cdn/submit_unblock_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { "Urls": "http://example.com/1.txt\nhttp://example.com/2.jpg", } resp = svc.submit_unblock_task(body) print(resp) ================================================ FILE: volcengine/example/cdn/update_cdn_config.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Domain': 'example.com', 'Origin': [ { 'OriginAction': { 'OriginLines': [{ 'OriginType': 'primary', 'InstanceType': 'domain', 'Address': 'new-origin.com', 'HttpPort': '80', 'HttpsPort': '443', 'Weight': '100' }] } } ], } resp = svc.update_cdn_config(body) print(resp) ================================================ FILE: volcengine/example/cdn/update_resource_tags.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.cdn import ak, sk from volcengine.cdn.service import CDNService if __name__ == '__main__': svc = CDNService() svc.set_ak(ak) svc.set_sk(sk) body = { 'Resources': ['example.com', 'example1.com'], 'ResourceTags': [ {'Key': 'userKey', 'Value': 'userVal'} ] } resp = svc.update_resource_tags(body) print(resp) ================================================ FILE: volcengine/example/code_pipeline/example_list_workspaces.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.code_pipeline.CodePipelineService import CodePipelineService if __name__ == '__main__': cp_service = CodePipelineService() # call below method if you dont set ak and sk in $HOME/.volc/config cp_service.set_ak('ak') cp_service.set_sk('sk') params = {} body = {} resp = cp_service.list_workspaces(params, body) print(resp) ================================================ FILE: volcengine/example/content_security/example_video_risk.py ================================================ # coding=utf-8 from volcengine.content_security.ContentSecurityService import ContentSecurityService if __name__ == '__main__': riskDetector = ContentSecurityService() # call below method if you dont set ak and sk in $HOME/.volc/config riskDetector.set_ak('') riskDetector.set_sk('') params = dict() req = { 'AppId': 0, 'Service': "", 'Parameters': '{}' } resp = riskDetector.async_video_risk(params, req) ================================================ FILE: volcengine/example/dcdn/__init__.py ================================================ ak = '' sk = '' ================================================ FILE: volcengine/example/dcdn/batch_block_ip.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": [], "IPList": [ "2.2.2.2" ], "OperatorType": "block", "BlockInterval": 1440, "UpdateType": "cover", } resp = svc.batch_block_ip(body) print(resp) ================================================ FILE: volcengine/example/dcdn/check_purge_prefetch_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "TaskType": ["refresh_url"], "TaskStatus": ["running"], "Url": "www.test.com", "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Page": 1, "PageSize": 100, "OrderType": "OpTime_DESC" } resp = svc.check_purge_prefetch_task(body) print(resp) ================================================ FILE: volcengine/example/dcdn/create_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = [ { "Domain": "www.test.com", "StrategyType": "wrr", "Origin": { "Origins": [ { "Name": "1.1.1.2", "Weight": 1 } ], "OriginType": "IP", "OriginProtocolType": "http", }, "Cache": { "Enable": False, }, "EnableFailOver": False, } ] resp = svc.create_domain(body) print(resp) ================================================ FILE: volcengine/example/dcdn/create_domain_v2.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": ["www.test.top"], "StrategyType": "wrr", "ProjectName": "TEST", "Origin": { "Origins": [ { "Name": "1.1.1.2", "Weight": 1 } ], "OriginType": "IP", "OriginProtocolType": "http", }, "Cache": { "Enable": False, }, "EnableFailOver": False, } resp = svc.create_domain_v2(body) print(resp) ================================================ FILE: volcengine/example/dcdn/create_purge_prefetch_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "TaskType": "refresh_url", "Urls": [ "www.test.com" ] } resp = svc.create_purge_prefetch_task(body) print(resp) ================================================ FILE: volcengine/example/dcdn/delete_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": ["www.test.com"] } resp = svc.delete_domain(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_block_ip.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": [], "IPList": [], "PageNumber": 1, "PageSize": 10, } resp = svc.describe_block_ip(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_dcdn_edge_ip.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "IpVersion": "", "Isp": "", "Region": "", } resp = svc.describe_dcdn_edge_ip(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_dcdn_origin_ip.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = {} resp = svc.describe_dcdn_origin_ip(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_dcdn_region_and_isp.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = { "Area": "China" } resp = svc.describe_dcdn_region_and_isp(params) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_config.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": ["www.test.com"] } resp = svc.describe_domain_config(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_isp_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domain": "www.test.com" } resp = svc.describe_domain_isp_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_logs.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00" } resp = svc.describe_domain_logs(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_probe_setting.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "Fuzzy": False } resp = svc.describe_domain_probe_setting(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_pv_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00" } resp = svc.describe_domain_pv_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_region_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domain": "www.test.com", } resp = svc.describe_domain_region_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_domain_uv_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00" } resp = svc.describe_domain_uv_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_ga_origin_policy.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "ga.test.top" } resp = svc.describe_ga_origin_policy(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_l2_ips.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { " DomainName": "", } resp = svc.describe_l2_ips(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_origin_realtime_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domains": ["www.test.com"], "Metrics": ["all"], } resp = svc.describe_origin_realtime_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_origin_statistics.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domains": ["www.test.com"], "Metrics": ["all"], "Interval": 300, } resp = svc.describe_origin_statistics(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_origin_statistics_detail.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = { "StartTime": "2022-08-09 00:00:00", "EndTime": "2022-08-09 00:20:11", "Domains": [ "www.test1.com", "www.test2.com" ], "Metrics": [ "all" ], "Interval": 300 } resp = svc.describe_origin_statistics_detail(params) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_realtime_data.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domains": ["www.test.com"], "Metrics": ["all"] } resp = svc.describe_realtime_data(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_statistics.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domains": ["www.test.com"], "Metrics": ["all"], "Interval": 300 } resp = svc.describe_statistics(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_statistics_detail.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Domains": [ "www.test1.com", "www.test2.com" ], "Metrics": [ "all" ], "Interval": 300 } resp = svc.describe_statistics_detail(params) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_top_domains.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Sort": "request", } resp = svc.describe_top_domains(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_top_ips.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 00:00:00", "EndTime": "2022-12-15 18:59:00", "Sort": "request" } resp = svc.describe_top_ips(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_top_referers.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 18:50:00", "EndTime": "2022-12-15 18:59:00", "Sort": "traffic" } resp = svc.describe_top_referers(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_top_urls.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2022-12-15 18:50:00", "EndTime": "2022-12-15 18:59:00", "Sort": "traffic" } resp = svc.describe_top_urls(body) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_user_domains.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = { "PageNum": 1, "PageSize": 10, "ProjectName": ["TEST"], } resp = svc.describe_user_domains(params) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_verify_content.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() print(ak) print(sk) # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = { "DomainName":"aaa.www.volcengine22.com", } resp = svc.describe_verify_content(params) print(resp) ================================================ FILE: volcengine/example/dcdn/describe_ws_statistics.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "StartTime": "2024-08-09 16:00:00", "EndTime": "2024-08-09 17:00:00", "Interval": 300, "Domains": [ "xxxx.test.com" ], "GroupByDomain": False } resp = svc.describe_ws_statistics(body) print(resp) ================================================ FILE: volcengine/example/dcdn/get_purge_prefetch_task_quota.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) params = {} resp = svc.get_purge_prefetch_task_quota(params) print(resp) ================================================ FILE: volcengine/example/dcdn/retry_purge_prefetch_task.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "TaskId": "1001", "TaskType": "refresh_url" } resp = svc.retry_purge_prefetch_task(body) print(resp) ================================================ FILE: volcengine/example/dcdn/start_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": ["www.test.com"] } resp = svc.start_domain(body) print(resp) ================================================ FILE: volcengine/example/dcdn/stop_domain.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domains": ["www.test.com"] } resp = svc.stop_domain(body) print(resp) ================================================ FILE: volcengine/example/dcdn/update_domain_config.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = [ { "Domain": "www.test.com", "Origin": { "Origins": [ { "Name": "1.1.1.1", "Weight": 1 } ], "OriginType": "IP", "OriginProtocolType": "http", }, } ] resp = svc.update_domain_config(body) print(resp) ================================================ FILE: volcengine/example/dcdn/update_domain_config_v2.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "www.test.com", "Origin": { "Origins": [ { "Name": "3.3.3.3", "Weight": 1 } ], "OriginType": "IP", "OriginProtocolType": "http", }, } resp = svc.update_domain_config_v2(body) print(resp) ================================================ FILE: volcengine/example/dcdn/update_domain_probe_setting.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = [ { "Domain": "111.soultrial.top", "ProbeSetting": { "Host": "soultrial.top", "Url": "/jpg", "Switch": "on", "UnhealthyStatusList": [ "4xx" ] } }, { "Domain": "222.soultrial.top", "ProbeSetting": { "Host": "222.soultrial.to", "Url": "/text", "Switch": "on", "UnhealthyStatusList": [ "5xx" ] } } ] resp = svc.update_domain_probe_setting(body) print(resp) ================================================ FILE: volcengine/example/dcdn/update_ga_origin_policy.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "Domain": "ga.test.top", "OriginPolicy": [ { "Priority": 1, "Match": { "Value": [ "/hotel" ] }, "SplitClients": { "Policy": "mmh2", "HashVal": "${http_deviceid}", "Splits": [ { "DC": "accinstance-BTqmpvDufFSxNeyiu7vxYd", "Weight": 11 }, { "DC": "accinstance-SkDwncUQWnfTi7AdnvjvHa", "Weight": 14 } ] } }, { "Priority": 2, "Match": { "Value": [ "/", "/tool" ] }, "SplitClients": { "Policy": "random-rr", "HashVal": "", "Splits": [ { "DC": "accinstance-BTqmpvDufFSxNeyiu7vxYd", "Weight": 29 }, { "DC": "accinstance-SkDwncUQWnfTi7AdnvjvHa", "Weight": 4 } ] } } ] } resp = svc.update_ga_origin_policy(body) print(resp) ================================================ FILE: volcengine/example/dcdn/verify_domain_ownership.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.dcdn import ak, sk from volcengine.dcdn.DCDNService import DCDNService if __name__ == '__main__': svc = DCDNService() # call below method if you dont set ak and sk in $HOME/.volc/config svc.set_ak(ak) svc.set_sk(sk) body = { "DomainName": "www2222.soultrial.top", "VerifyType": "dns" } resp = svc.verify_domain_ownership(body) print(resp) ================================================ FILE: volcengine/example/dts/__init__.py ================================================ ================================================ FILE: volcengine/example/dts/create_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' task_name = 'task_name_str' task_type = 'task_type_here' region_str = 'region_str_here' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskName': task_name, 'TaskType': task_type, 'ChargeConfig': { 'ChargeType': 'PostPaid', 'OneStep': True }, 'SrcConfig': { 'EndpointType': 'Public_Redis', 'PublicRedisSettings': { 'Host': 'IP_str_here', 'Port': 6379, 'Username': 'default', 'Password': 'redis_password_here', 'RegionSettings': { 'Region': region_str } } }, 'DestConfig': { 'EndpointType': 'Volc_Redis', 'VolcRedisSettings': { 'DBInstanceId': 'redis-instanceID', 'Username': 'default', 'Password': 'redis_password_here', 'RegionSettings': { 'Region': region_str } } }, 'SolutionSettings': { 'SolutionType': 'Redis2Redis', 'Redis2RedisSettings': { 'ObjectMappings': [ { "DestObjName": "0", "ObjectType": "Database", "SrcObjName": "0" }, { "DestObjName": "6", "ObjectType": "Database", "SrcObjName": "6" } ], 'FullTransmissionSettings': { 'EnableFull': True }, 'IncrTransmissionSettings': { 'EnableIncr': True }, 'ErrorBehaviorSettings': { 'MaxRetrySeconds': 7200 } } } } resp = dts_service.create_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/delete_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.delete_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/describe_dts_task_progress.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str, 'ProgressType': 'Full', 'PageNumber': 1, 'PageSize': 10, 'TransferEstimateRowsDesc': True } resp = dts_service.describe_transmission_task_progress(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/describe_dts_tasks.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskType': 'task_type_str', 'PageNumber': 1, 'PageSize': 10, } resp = dts_service.describe_transmission_tasks(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/describe_task_info.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.describe_transmission_task_info(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/get_async_precheck_result.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' id_str = 'id_str' # we get id_str from precheck_async api dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'ID': id_str } resp = dts_service.get_async_pre_check_result(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/modify_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' task_name = 'task_name_str' task_type = 'task_type_here' region_str = 'region_str_here' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskName': task_name, 'TaskType': task_type, 'ChargeConfig': { 'ChargeType': 'PostPaid', 'OneStep': True }, 'SrcConfig': { 'EndpointType': 'Public_Redis', 'PublicRedisSettings': { 'Host': 'IP_str_here', 'Port': 6379, 'Username': 'default', 'Password': 'redis_password_here', 'RegionSettings': { 'Region': region_str } } }, 'DestConfig': { 'EndpointType': 'Volc_Redis', 'VolcRedisSettings': { 'DBInstanceId': 'redis-instanceID', 'Username': 'default', 'Password': 'redis_password_here', 'RegionSettings': { 'Region': region_str } } }, 'SolutionSettings': { 'SolutionType': 'Redis2Redis', 'Redis2RedisSettings': { 'ObjectMappings': [ { "DestObjName": "0", "ObjectType": "Database", "SrcObjName": "0" }, { "DestObjName": "6", "ObjectType": "Database", "SrcObjName": "6" } ], 'FullTransmissionSettings': { 'EnableFull': True }, 'IncrTransmissionSettings': { 'EnableIncr': True }, 'ErrorBehaviorSettings': { 'MaxRetrySeconds': 7200 } } } } resp = dts_service.modify_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/precheck_async.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.pre_check_async(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/resume_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.resume_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/retry_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.retry_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/start_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.start_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/stop_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.stop_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/dts/subscription/avro/deserializer.py ================================================ from io import BytesIO import avro.schema from avro.io import DatumReader, BinaryDecoder RecordSchema: str = "com.bytedance.dts.subscribe.avro.Record" class RecordDeserializer: # schema_file: path of schema file def __init__(self, schema_file: str): s = avro.schema.parse(open(schema_file, "rb").read()) self.all_schema = s for schema in self.all_schema.schemas: if isinstance(schema, avro.schema.RecordSchema) and schema.fullname == RecordSchema: self.record_schema = schema break def deserialize(self, data: bytes) -> dict: bio = BytesIO(initial_bytes=data) decoder = BinaryDecoder(bio) res = DatumReader(writers_schema=self.record_schema).read(decoder) return res ================================================ FILE: volcengine/example/dts/subscription/avro/dts_kafka_consumer_demo.py ================================================ from kafka import KafkaConsumer import deserializer import record_printer deserializer = deserializer.RecordDeserializer("record.avsc") if __name__ == '__main__': brokers = "your brokers address" topic = "your topic" group = "your group" username = "your username" password = "your password" # create consumer consumer = KafkaConsumer( topic, group_id=group, # init consume offset auto_offset_reset='latest', enable_auto_commit=True, # set up SASL authentication security_protocol="SASL_PLAINTEXT", sasl_mechanism="PLAIN", sasl_plain_username=username, sasl_plain_password=password, api_version=(2, 2, 2), bootstrap_servers=brokers.split(',')) for message in consumer: record = deserializer.deserialize(message.value) record_printer.print_record(record) ================================================ FILE: volcengine/example/dts/subscription/avro/record.avsc ================================================ [ { "namespace": "com.bytedance.dts.subscribe.avro", "name": "Field", "type": "record", "fields": [ { "name": "name", "type": "string" }, { "name": "dataTypeNumber", "type": "int" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Integer", "fields": [ { "name": "precision", "type": "int" }, { "name": "value", "type": "string" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Character", "fields": [ { "name": "charset", "type": "string" }, { "name": "value", "type": "bytes" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Float", "fields": [ { "name": "value", "type": "double" }, { "name": "precision", "type": "int" }, { "name": "scale", "type": "int" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Decimal", "fields": [ { "name": "value", "type": "string" }, { "name": "precision", "type": "int" }, { "name": "scale", "type": "int" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Timestamp", "fields": [ { "name": "timestamp", "type": "long" }, { "name": "millis", "type": "int" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "DateTime", "fields": [ { "name": "year", "default": null, "type": [ "null", "int" ] }, { "name": "month", "default": null, "type": [ "null", "int" ] }, { "name": "day", "default": null, "type": [ "null", "int" ] }, { "name": "hour", "default": null, "type": [ "null", "int" ] }, { "name": "minute", "default": null, "type": [ "null", "int" ] }, { "name": "second", "default": null, "type": [ "null", "int" ] }, { "name": "millis", "default": null, "type": [ "null", "int" ] } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "TimestampWithTimeZone", "fields": [ { "name": "value", "type": "DateTime" }, { "name": "timezone", "type": "string" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "BinaryGeometry", "fields": [ { "name": "type", "type": "string" }, { "name": "value", "type": "bytes" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "TextGeometry", "fields": [ { "name": "type", "type": "string" }, { "name": "value", "type": "string" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "BinaryObject", "fields": [ { "name": "type", "type": "string" }, { "name": "value", "type": "bytes" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "TextObject", "fields": [ { "name": "type", "type": "string" }, { "name": "value", "type": "string" } ] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "enum", "name": "EmptyObject", "symbols" : ["NULL", "NONE"] }, { "namespace": "com.bytedance.dts.subscribe.avro", "type": "record", "name": "Record", "fields": [ { "name": "version", "type": "int", "doc": "version infomation" }, { "name": "id", "type": "long", "doc": "unique id of this record in the whole stream" }, { "name": "sourceTimestamp", "type": "long", "doc": "record log timestamp" }, { "name": "sourcePosition", "type": "string", "doc": "record source location information" }, { "name": "safeSourcePosition", "type": "string", "default": "", "doc": "safe record source location information, use to recovery." }, { "name": "sourceTxid", "type": "string", "default": "", "doc": "record transation id" }, { "name": "source", "doc": "source dataource", "type": { "namespace": "com.bytedance.dts.subscribe.avro", "name": "Source", "type": "record", "fields": [ { "name": "sourceType", "type": { "namespace": "com.bytedance.dts.subscribe.avro", "name": "SourceType", "type": "enum", "symbols": [ "MySQL", "Oracle", "SQLServer", "PostgreSQL", "MongoDB", "Redis", "DB2", "PPAS", "DRDS", "HBASE", "HDFS", "FILE", "OTHER" ] } }, { "name": "version", "type": "string", "doc": "source datasource version information" } ] } }, { "namespace": "com.bytedance.dts.subscribe.avro", "name": "operation", "type": { "name": "Operation", "type": "enum", "symbols": [ "INSERT", "UPDATE", "DELETE", "DDL", "BEGIN", "COMMIT", "ROLLBACK", "ABORT", "HEARTBEAT", "CHECKPOINT", "COMMAND", "FILL", "FINISH", "CONTROL", "RDB", "NOOP", "INIT" ] } }, { "name": "objectName", "default": null, "type": [ "null", "string" ] }, { "name": "processTimestamps", "default": null, "type": [ "null", { "type": "array", "items": "long" } ], "doc": "time when this record is processed along the stream dataflow" }, { "name": "tags", "default": {}, "type": { "type": "map", "values": "string" }, "doc": "tags to identify properties of this record" }, { "name": "fields", "default": null, "type": [ "null", "string", { "type": "array", "items": "com.bytedance.dts.subscribe.avro.Field" } ] }, { "name": "beforeImages", "default": null, "type": [ "null", "string", { "type": "array", "items": [ "null", "com.bytedance.dts.subscribe.avro.Integer", "com.bytedance.dts.subscribe.avro.Character", "com.bytedance.dts.subscribe.avro.Decimal", "com.bytedance.dts.subscribe.avro.Float", "com.bytedance.dts.subscribe.avro.Timestamp", "com.bytedance.dts.subscribe.avro.DateTime", "com.bytedance.dts.subscribe.avro.TimestampWithTimeZone", "com.bytedance.dts.subscribe.avro.BinaryGeometry", "com.bytedance.dts.subscribe.avro.TextGeometry", "com.bytedance.dts.subscribe.avro.BinaryObject", "com.bytedance.dts.subscribe.avro.TextObject", "com.bytedance.dts.subscribe.avro.EmptyObject" ] } ] }, { "name": "afterImages", "default": null, "type": [ "null", "string", { "type": "array", "items": [ "null", "com.bytedance.dts.subscribe.avro.Integer", "com.bytedance.dts.subscribe.avro.Character", "com.bytedance.dts.subscribe.avro.Decimal", "com.bytedance.dts.subscribe.avro.Float", "com.bytedance.dts.subscribe.avro.Timestamp", "com.bytedance.dts.subscribe.avro.DateTime", "com.bytedance.dts.subscribe.avro.TimestampWithTimeZone", "com.bytedance.dts.subscribe.avro.BinaryGeometry", "com.bytedance.dts.subscribe.avro.TextGeometry", "com.bytedance.dts.subscribe.avro.BinaryObject", "com.bytedance.dts.subscribe.avro.TextObject", "com.bytedance.dts.subscribe.avro.EmptyObject" ] } ] }, { "name": "bornTimestamp", "default": 0, "type": "long", "doc": "the timestamp in unit of millisecond that record is born in source" } ] } ] ================================================ FILE: volcengine/example/dts/subscription/avro/record_printer.py ================================================ MYSQL_TYPE_TIMESTAMP = 7 MYSQL_TYPE_DATE = 10 MYSQL_TYPE_TIME = 11 MYSQL_TYPE_DATETIME = 12 MYSQL_TYPE_YEAR = 13 MYSQL_TYPE_DATE_NEW = 14 def print_record(record): operation = record["operation"] print("Operation[{}] ObjectName[{}] SourceTimestamp[{}] ID[{}]".format(record["operation"], record["objectName"], record["sourceTimestamp"], record["id"])) if operation == "DDL": print("DDL[{}]".format(record["afterImages"])) elif operation == "INSERT": for i in range(len(record["afterImages"])): print("Field[{}] After[{}]".format(record["fields"][i]["name"], getDataValue(record["fields"][i]["dataTypeNumber"], record["afterImages"][i]))) elif operation == "DELETE": for i in range(len(record["afterImages"])): print("Field[{}] BEFORE[{}]".format(record["fields"][i]["name"], getDataValue(record["fields"][i]["dataTypeNumber"], record["beforeImages"][i]))) elif operation == "UPDATE": for i in range(len(record["afterImages"])): print("Field[{}] BEFORE[{}] After[{}]".format(record["fields"][i]["name"], getDataValue(record["fields"][i]["dataTypeNumber"], record["beforeImages"][i]), getDataValue(record["fields"][i]["dataTypeNumber"], record["afterImages"][i]))) else: print(record) def getDataValue(dataType, data) -> str: if dataType == MYSQL_TYPE_TIMESTAMP: return "%d.%d" % (data["timestamp"], data["millis"]) elif dataType in (MYSQL_TYPE_DATE, MYSQL_TYPE_DATE_NEW): return "%d-%d-%d" % (data["year"], data["month"], data["day"]) elif dataType == MYSQL_TYPE_TIME: return "%02d:%02d:%02d" % (data["hour"], data["minute"], data["second"]) elif dataType == MYSQL_TYPE_DATETIME: return "%04d-%02d-%02d %02d:%02d:%02d" % (data["year"], data["month"], data["day"], data["hour"], data["minute"], data["second"]) elif dataType == MYSQL_TYPE_YEAR: return data["year"] else: return data["value"] ================================================ FILE: volcengine/example/dts/subscription/canal/canal.proto ================================================ syntax = "proto3"; option go_package="./;canal"; option optimize_for = SPEED; package canal; /**************************************************************** * message model *如果要在Enum中新增类型,确保以前的类型的下标值不变. ****************************************************************/ message Entry { /**协议头部信息**/ Header header = 1; ///**打散后的事件类型**/ [default = ROWDATA] oneof entryType_present{ EntryType entryType = 2; } /**传输的二进制数组**/ bytes storeValue = 3; } /**message Header**/ message Header { /**协议的版本号**/ //[default = 1] oneof version_present { int32 version = 1; } /**binlog/redolog 文件名**/ string logfileName = 2; /**binlog/redolog 文件的偏移位置**/ int64 logfileOffset = 3; /**服务端serverId**/ int64 serverId = 4; /** 变更数据的编码 **/ string serverenCode = 5; /**变更数据的执行时间 **/ int64 executeTime = 6; /** 变更数据的来源**/ //[default = MYSQL] oneof sourceType_present { Type sourceType = 7; } /** 变更数据的schemaname**/ string schemaName = 8; /**变更数据的tablename**/ string tableName = 9; /**每个event的长度**/ int64 eventLength = 10; /**数据变更类型**/ // [default = UPDATE] oneof eventType_present { EventType eventType = 11; } /**预留扩展**/ repeated Pair props = 12; /**当前事务的gitd**/ string gtid = 13; } /**每个字段的数据结构**/ message Column { /**字段下标**/ int32 index = 1; /**字段java中类型**/ int32 sqlType = 2; /**字段名称(忽略大小写),在mysql中是没有的**/ string name = 3; /**是否是主键**/ bool isKey = 4; /**如果EventType=UPDATE,用于标识这个字段值是否有修改**/ bool updated = 5; /** 标识是否为空 **/ //[default = false] oneof isNull_present { bool isNull = 6; } /**预留扩展**/ repeated Pair props = 7; /** 字段值,timestamp,Datetime是一个时间格式的文本 **/ string value = 8; /** 对应数据对象原始长度 **/ int32 length = 9; /**字段mysql类型**/ string mysqlType = 10; } message RowData { /** 字段信息,增量数据(修改前,删除前) **/ repeated Column beforeColumns = 1; /** 字段信息,增量数据(修改后,新增后) **/ repeated Column afterColumns = 2; /**预留扩展**/ repeated Pair props = 3; } /**message row 每行变更数据的数据结构**/ message RowChange { /**tableId,由数据库产生**/ int64 tableId = 1; /**数据变更类型**/ //[default = UPDATE] oneof eventType_present { EventType eventType = 2; } /** 标识是否是ddl语句 **/ // [default = false] oneof isDdl_present { bool isDdl = 10; } /** ddl/query的sql语句 **/ string sql = 11; /** 一次数据库变更可能存在多行 **/ repeated RowData rowDatas = 12; /**预留扩展**/ repeated Pair props = 13; /** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName **/ string ddlSchemaName = 14; } /**开始事务的一些信息**/ message TransactionBegin{ /**已废弃,请使用header里的executeTime**/ int64 executeTime = 1; /**已废弃,Begin里不提供事务id**/ string transactionId = 2; /**预留扩展**/ repeated Pair props = 3; /**执行的thread Id**/ int64 threadId = 4; } /**结束事务的一些信息**/ message TransactionEnd{ /**已废弃,请使用header里的executeTime**/ int64 executeTime = 1; /**事务号**/ string transactionId = 2; /**预留扩展**/ repeated Pair props = 3; } /**预留扩展**/ message Pair{ string key = 1; string value = 2; } /**打散后的事件类型,主要用于标识事务的开始,变更数据,结束**/ enum EntryType{ ENTRYTYPECOMPATIBLEPROTO2 = 0; TRANSACTIONBEGIN = 1; ROWDATA = 2; TRANSACTIONEND = 3; /** 心跳类型,内部使用,外部暂不可见,可忽略 **/ HEARTBEAT = 4; GTIDLOG = 5; } /** 事件类型 **/ enum EventType { EVENTTYPECOMPATIBLEPROTO2 = 0; INSERT = 1; UPDATE = 2; DELETE = 3; CREATE = 4; ALTER = 5; ERASE = 6; QUERY = 7; TRUNCATE = 8; RENAME = 9; /**CREATE INDEX**/ CINDEX = 10; DINDEX = 11; GTID = 12; /** XA **/ XACOMMIT = 13; XAROLLBACK = 14; /** MASTER HEARTBEAT **/ MHEARTBEAT = 15; } /**数据库类型**/ enum Type { TYPECOMPATIBLEPROTO2 = 0; ORACLE = 1; MYSQL = 2; PGSQL = 3; } ================================================ FILE: volcengine/example/dts/subscription/canal/canal_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: canal.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x63\x61nal.proto\x12\x05\x63\x61nal\"v\n\x05\x45ntry\x12\x1d\n\x06header\x18\x01 \x01(\x0b\x32\r.canal.Header\x12%\n\tentryType\x18\x02 \x01(\x0e\x32\x10.canal.EntryTypeH\x00\x12\x12\n\nstoreValue\x18\x03 \x01(\x0c\x42\x13\n\x11\x65ntryType_present\"\xf2\x02\n\x06Header\x12\x11\n\x07version\x18\x01 \x01(\x05H\x00\x12\x13\n\x0blogfileName\x18\x02 \x01(\t\x12\x15\n\rlogfileOffset\x18\x03 \x01(\x03\x12\x10\n\x08serverId\x18\x04 \x01(\x03\x12\x14\n\x0cserverenCode\x18\x05 \x01(\t\x12\x13\n\x0b\x65xecuteTime\x18\x06 \x01(\x03\x12!\n\nsourceType\x18\x07 \x01(\x0e\x32\x0b.canal.TypeH\x01\x12\x12\n\nschemaName\x18\x08 \x01(\t\x12\x11\n\ttableName\x18\t \x01(\t\x12\x13\n\x0b\x65ventLength\x18\n \x01(\x03\x12%\n\teventType\x18\x0b \x01(\x0e\x32\x10.canal.EventTypeH\x02\x12\x1a\n\x05props\x18\x0c \x03(\x0b\x32\x0b.canal.Pair\x12\x0c\n\x04gtid\x18\r \x01(\tB\x11\n\x0fversion_presentB\x14\n\x12sourceType_presentB\x13\n\x11\x65ventType_present\"\xc8\x01\n\x06\x43olumn\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x0f\n\x07sqlType\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05isKey\x18\x04 \x01(\x08\x12\x0f\n\x07updated\x18\x05 \x01(\x08\x12\x10\n\x06isNull\x18\x06 \x01(\x08H\x00\x12\x1a\n\x05props\x18\x07 \x03(\x0b\x32\x0b.canal.Pair\x12\r\n\x05value\x18\x08 \x01(\t\x12\x0e\n\x06length\x18\t \x01(\x05\x12\x11\n\tmysqlType\x18\n \x01(\tB\x10\n\x0eisNull_present\"p\n\x07RowData\x12$\n\rbeforeColumns\x18\x01 \x03(\x0b\x32\r.canal.Column\x12#\n\x0c\x61\x66terColumns\x18\x02 \x03(\x0b\x32\r.canal.Column\x12\x1a\n\x05props\x18\x03 \x03(\x0b\x32\x0b.canal.Pair\"\xdc\x01\n\tRowChange\x12\x0f\n\x07tableId\x18\x01 \x01(\x03\x12%\n\teventType\x18\x02 \x01(\x0e\x32\x10.canal.EventTypeH\x00\x12\x0f\n\x05isDdl\x18\n \x01(\x08H\x01\x12\x0b\n\x03sql\x18\x0b \x01(\t\x12 \n\x08rowDatas\x18\x0c \x03(\x0b\x32\x0e.canal.RowData\x12\x1a\n\x05props\x18\r \x03(\x0b\x32\x0b.canal.Pair\x12\x15\n\rddlSchemaName\x18\x0e \x01(\tB\x13\n\x11\x65ventType_presentB\x0f\n\risDdl_present\"l\n\x10TransactionBegin\x12\x13\n\x0b\x65xecuteTime\x18\x01 \x01(\x03\x12\x15\n\rtransactionId\x18\x02 \x01(\t\x12\x1a\n\x05props\x18\x03 \x03(\x0b\x32\x0b.canal.Pair\x12\x10\n\x08threadId\x18\x04 \x01(\x03\"X\n\x0eTransactionEnd\x12\x13\n\x0b\x65xecuteTime\x18\x01 \x01(\x03\x12\x15\n\rtransactionId\x18\x02 \x01(\t\x12\x1a\n\x05props\x18\x03 \x03(\x0b\x32\x0b.canal.Pair\"\"\n\x04Pair\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t*}\n\tEntryType\x12\x1d\n\x19\x45NTRYTYPECOMPATIBLEPROTO2\x10\x00\x12\x14\n\x10TRANSACTIONBEGIN\x10\x01\x12\x0b\n\x07ROWDATA\x10\x02\x12\x12\n\x0eTRANSACTIONEND\x10\x03\x12\r\n\tHEARTBEAT\x10\x04\x12\x0b\n\x07GTIDLOG\x10\x05*\xe5\x01\n\tEventType\x12\x1d\n\x19\x45VENTTYPECOMPATIBLEPROTO2\x10\x00\x12\n\n\x06INSERT\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\x12\n\n\x06\x43REATE\x10\x04\x12\t\n\x05\x41LTER\x10\x05\x12\t\n\x05\x45RASE\x10\x06\x12\t\n\x05QUERY\x10\x07\x12\x0c\n\x08TRUNCATE\x10\x08\x12\n\n\x06RENAME\x10\t\x12\n\n\x06\x43INDEX\x10\n\x12\n\n\x06\x44INDEX\x10\x0b\x12\x08\n\x04GTID\x10\x0c\x12\x0c\n\x08XACOMMIT\x10\r\x12\x0e\n\nXAROLLBACK\x10\x0e\x12\x0e\n\nMHEARTBEAT\x10\x0f*B\n\x04Type\x12\x18\n\x14TYPECOMPATIBLEPROTO2\x10\x00\x12\n\n\x06ORACLE\x10\x01\x12\t\n\x05MYSQL\x10\x02\x12\t\n\x05PGSQL\x10\x03\x42\x0cH\x01Z\x08./;canalb\x06proto3') _ENTRYTYPE = DESCRIPTOR.enum_types_by_name['EntryType'] EntryType = enum_type_wrapper.EnumTypeWrapper(_ENTRYTYPE) _EVENTTYPE = DESCRIPTOR.enum_types_by_name['EventType'] EventType = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPE) _TYPE = DESCRIPTOR.enum_types_by_name['Type'] Type = enum_type_wrapper.EnumTypeWrapper(_TYPE) ENTRYTYPECOMPATIBLEPROTO2 = 0 TRANSACTIONBEGIN = 1 ROWDATA = 2 TRANSACTIONEND = 3 HEARTBEAT = 4 GTIDLOG = 5 EVENTTYPECOMPATIBLEPROTO2 = 0 INSERT = 1 UPDATE = 2 DELETE = 3 CREATE = 4 ALTER = 5 ERASE = 6 QUERY = 7 TRUNCATE = 8 RENAME = 9 CINDEX = 10 DINDEX = 11 GTID = 12 XACOMMIT = 13 XAROLLBACK = 14 MHEARTBEAT = 15 TYPECOMPATIBLEPROTO2 = 0 ORACLE = 1 MYSQL = 2 PGSQL = 3 _ENTRY = DESCRIPTOR.message_types_by_name['Entry'] _HEADER = DESCRIPTOR.message_types_by_name['Header'] _COLUMN = DESCRIPTOR.message_types_by_name['Column'] _ROWDATA = DESCRIPTOR.message_types_by_name['RowData'] _ROWCHANGE = DESCRIPTOR.message_types_by_name['RowChange'] _TRANSACTIONBEGIN = DESCRIPTOR.message_types_by_name['TransactionBegin'] _TRANSACTIONEND = DESCRIPTOR.message_types_by_name['TransactionEnd'] _PAIR = DESCRIPTOR.message_types_by_name['Pair'] Entry = _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { 'DESCRIPTOR' : _ENTRY, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.Entry) }) _sym_db.RegisterMessage(Entry) Header = _reflection.GeneratedProtocolMessageType('Header', (_message.Message,), { 'DESCRIPTOR' : _HEADER, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.Header) }) _sym_db.RegisterMessage(Header) Column = _reflection.GeneratedProtocolMessageType('Column', (_message.Message,), { 'DESCRIPTOR' : _COLUMN, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.Column) }) _sym_db.RegisterMessage(Column) RowData = _reflection.GeneratedProtocolMessageType('RowData', (_message.Message,), { 'DESCRIPTOR' : _ROWDATA, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.RowData) }) _sym_db.RegisterMessage(RowData) RowChange = _reflection.GeneratedProtocolMessageType('RowChange', (_message.Message,), { 'DESCRIPTOR' : _ROWCHANGE, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.RowChange) }) _sym_db.RegisterMessage(RowChange) TransactionBegin = _reflection.GeneratedProtocolMessageType('TransactionBegin', (_message.Message,), { 'DESCRIPTOR' : _TRANSACTIONBEGIN, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.TransactionBegin) }) _sym_db.RegisterMessage(TransactionBegin) TransactionEnd = _reflection.GeneratedProtocolMessageType('TransactionEnd', (_message.Message,), { 'DESCRIPTOR' : _TRANSACTIONEND, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.TransactionEnd) }) _sym_db.RegisterMessage(TransactionEnd) Pair = _reflection.GeneratedProtocolMessageType('Pair', (_message.Message,), { 'DESCRIPTOR' : _PAIR, '__module__' : 'canal_pb2' # @@protoc_insertion_point(class_scope:canal.Pair) }) _sym_db.RegisterMessage(Pair) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'H\001Z\010./;canal' _ENTRYTYPE._serialized_start=1291 _ENTRYTYPE._serialized_end=1416 _EVENTTYPE._serialized_start=1419 _EVENTTYPE._serialized_end=1648 _TYPE._serialized_start=1650 _TYPE._serialized_end=1716 _ENTRY._serialized_start=22 _ENTRY._serialized_end=140 _HEADER._serialized_start=143 _HEADER._serialized_end=513 _COLUMN._serialized_start=516 _COLUMN._serialized_end=716 _ROWDATA._serialized_start=718 _ROWDATA._serialized_end=830 _ROWCHANGE._serialized_start=833 _ROWCHANGE._serialized_end=1053 _TRANSACTIONBEGIN._serialized_start=1055 _TRANSACTIONBEGIN._serialized_end=1163 _TRANSACTIONEND._serialized_start=1165 _TRANSACTIONEND._serialized_end=1253 _PAIR._serialized_start=1255 _PAIR._serialized_end=1289 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/example/dts/subscription/canal/dts_kafka_consumer_demo.py ================================================ from kafka import KafkaConsumer import canal_pb2 if __name__ == '__main__': brokers = "your brokers address" topic = "your topic" group = "your group" username = "your username" password = "your password" # create consumer consumer = KafkaConsumer( topic, group_id=group, # init consume offset auto_offset_reset='latest', enable_auto_commit=True, # set up SASL authentication security_protocol="SASL_PLAINTEXT", sasl_mechanism="PLAIN", sasl_plain_username=username, sasl_plain_password=password, api_version=(2, 2, 2), bootstrap_servers=brokers.split(',')) for message in consumer: msg = canal_pb2.Entry() msg.ParseFromString(message.value) if msg.entryType == canal_pb2.ROWDATA: event = canal_pb2.RowChange() event.ParseFromString(msg.storeValue) print(event) ================================================ FILE: volcengine/example/dts/subscription/volc/dts_kafka_consumer_demo.py ================================================ from kafka import KafkaConsumer import volc_pb2 if __name__ == '__main__': brokers = "your brokers address" topic = "your topic" group = "your group" username = "your username" password = "your password" # create consumer consumer = KafkaConsumer( topic, group_id=group, # init consume offset auto_offset_reset='latest', enable_auto_commit=True, # set up SASL authentication security_protocol="SASL_PLAINTEXT", sasl_mechanism="PLAIN", sasl_plain_username=username, sasl_plain_password=password, api_version=(2, 2, 2), bootstrap_servers=brokers.split(',')) for message in consumer: msg = volc_pb2.Entry() msg.ParseFromString(message.value) print(msg) ================================================ FILE: volcengine/example/dts/subscription/volc/volc.proto ================================================ syntax = "proto2"; option go_package="./;volc"; option optimize_for = SPEED; package volc; enum EntryType { UNKNOWN_ENTRY = 0; BEGIN = 1; COMMIT = 2; DML = 3; DDL = 4; } enum SrcType { UNKNOWN_SRC = 0; MySQL = 1; PostgreSQL = 2; } enum DMLType { OTHER_DML = 0; INSERT = 1; UPDATE = 2; DELETE = 3; } enum DDLType { OTHER_DDL = 0; CREATE_TABLE = 2; ALTER_TABLE = 3; DROP_TABLE = 4; RENAME_TABLE = 5; TRUNCATE_TABLE = 6; CREATE_VIEW = 7; ALTER_VIEW = 8; DROP_VIEW = 9; CREATE_INDEX = 10; DROP_INDEX = 11; CREATE_FUNCTION = 12; DROP_FUNCTION = 13; CREATE_PROCEDURE= 14; DROP_PROCEDURE = 15; } enum ColumnType { UNKNOWN = 0; STRING = 1; BINARY = 2; INTEGER = 3; // store as int64 value UNSIGNED_INTEGER = 4; // store as uint64 value FLOAT = 5; // store as float value DECIMAL = 6; // store as string value BOOL = 7; DATETIME = 8; //store in string value in RFC3339Nano format } message Entry { optional int32 version = 1; repeated Prop props = 2; optional SrcType src_type = 3; optional EntryType entry_type = 4; optional int64 timestamp = 5; optional string server_id = 6; optional string database = 7; optional string table = 8; oneof event { DMLEvent dml_event = 21; DDLEvent ddl_event = 22; CommitEvent commit_event = 23; BeginEvent begin_event = 24; } } message Prop{ optional string key = 1; optional string value = 2; } message BeginEvent { optional string transaction_id = 1; optional string file = 2; optional string offset = 3; repeated Prop props = 4; } message CommitEvent { optional string transaction_id = 1; optional string file = 2; optional string offset = 3; repeated Prop props = 4; } message DDLEvent { optional string sql = 1; optional int64 exec_time = 2; // unit: second optional int32 err_code = 3; repeated Prop props = 4; optional DDLType type = 5; } message DMLEvent { optional DMLType type = 1; optional string table_id = 2; optional Index use_index = 3; repeated ColumnDef column_defs= 4; repeated Row rows = 5; repeated Prop props = 6; } message Index { optional string name = 1; repeated int32 column_index = 2; } message Row { repeated Column before_cols = 1; repeated Column after_cols = 2; } message ColumnDef { repeated Prop props = 1; optional int32 index = 2; optional ColumnType type = 3; optional string origin_type = 4; optional string name = 5; optional string charset = 6; optional bool is_nullable = 7; optional bool is_unsigned = 8; } message Column { optional bool is_null = 1; oneof value { string string_value = 2; bytes binary_value = 3; double float_value = 4; int64 int64_value = 5; uint64 uint64_value = 6; bool bool_value = 7; } } ================================================ FILE: volcengine/example/dts/subscription/volc/volc_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volc.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nvolc.proto\x12\x04volc\"\xe7\x02\n\x05\x45ntry\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x19\n\x05props\x18\x02 \x03(\x0b\x32\n.volc.Prop\x12\x1f\n\x08src_type\x18\x03 \x01(\x0e\x32\r.volc.SrcType\x12#\n\nentry_type\x18\x04 \x01(\x0e\x32\x0f.volc.EntryType\x12\x11\n\ttimestamp\x18\x05 \x01(\x03\x12\x11\n\tserver_id\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\t\x12\r\n\x05table\x18\x08 \x01(\t\x12#\n\tdml_event\x18\x15 \x01(\x0b\x32\x0e.volc.DMLEventH\x00\x12#\n\tddl_event\x18\x16 \x01(\x0b\x32\x0e.volc.DDLEventH\x00\x12)\n\x0c\x63ommit_event\x18\x17 \x01(\x0b\x32\x11.volc.CommitEventH\x00\x12\'\n\x0b\x62\x65gin_event\x18\x18 \x01(\x0b\x32\x10.volc.BeginEventH\x00\x42\x07\n\x05\x65vent\"\"\n\x04Prop\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"]\n\nBeginEvent\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\t\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\"^\n\x0b\x43ommitEvent\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\t\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\"t\n\x08\x44\x44LEvent\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12\x11\n\texec_time\x18\x02 \x01(\x03\x12\x10\n\x08\x65rr_code\x18\x03 \x01(\x05\x12\x19\n\x05props\x18\x04 \x03(\x0b\x32\n.volc.Prop\x12\x1b\n\x04type\x18\x05 \x01(\x0e\x32\r.volc.DDLType\"\xb3\x01\n\x08\x44MLEvent\x12\x1b\n\x04type\x18\x01 \x01(\x0e\x32\r.volc.DMLType\x12\x10\n\x08table_id\x18\x02 \x01(\t\x12\x1e\n\tuse_index\x18\x03 \x01(\x0b\x32\x0b.volc.Index\x12$\n\x0b\x63olumn_defs\x18\x04 \x03(\x0b\x32\x0f.volc.ColumnDef\x12\x17\n\x04rows\x18\x05 \x03(\x0b\x32\t.volc.Row\x12\x19\n\x05props\x18\x06 \x03(\x0b\x32\n.volc.Prop\"+\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x63olumn_index\x18\x02 \x03(\x05\"J\n\x03Row\x12!\n\x0b\x62\x65\x66ore_cols\x18\x01 \x03(\x0b\x32\x0c.volc.Column\x12 \n\nafter_cols\x18\x02 \x03(\x0b\x32\x0c.volc.Column\"\xb3\x01\n\tColumnDef\x12\x19\n\x05props\x18\x01 \x03(\x0b\x32\n.volc.Prop\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x1e\n\x04type\x18\x03 \x01(\x0e\x32\x10.volc.ColumnType\x12\x13\n\x0borigin_type\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x0f\n\x07\x63harset\x18\x06 \x01(\t\x12\x13\n\x0bis_nullable\x18\x07 \x01(\x08\x12\x13\n\x0bis_unsigned\x18\x08 \x01(\x08\"\xae\x01\n\x06\x43olumn\x12\x0f\n\x07is_null\x18\x01 \x01(\x08\x12\x16\n\x0cstring_value\x18\x02 \x01(\tH\x00\x12\x16\n\x0c\x62inary_value\x18\x03 \x01(\x0cH\x00\x12\x15\n\x0b\x66loat_value\x18\x04 \x01(\x01H\x00\x12\x15\n\x0bint64_value\x18\x05 \x01(\x03H\x00\x12\x16\n\x0cuint64_value\x18\x06 \x01(\x04H\x00\x12\x14\n\nbool_value\x18\x07 \x01(\x08H\x00\x42\x07\n\x05value*G\n\tEntryType\x12\x11\n\rUNKNOWN_ENTRY\x10\x00\x12\t\n\x05\x42\x45GIN\x10\x01\x12\n\n\x06\x43OMMIT\x10\x02\x12\x07\n\x03\x44ML\x10\x03\x12\x07\n\x03\x44\x44L\x10\x04*5\n\x07SrcType\x12\x0f\n\x0bUNKNOWN_SRC\x10\x00\x12\t\n\x05MySQL\x10\x01\x12\x0e\n\nPostgreSQL\x10\x02*<\n\x07\x44MLType\x12\r\n\tOTHER_DML\x10\x00\x12\n\n\x06INSERT\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03*\x95\x02\n\x07\x44\x44LType\x12\r\n\tOTHER_DDL\x10\x00\x12\x10\n\x0c\x43REATE_TABLE\x10\x02\x12\x0f\n\x0b\x41LTER_TABLE\x10\x03\x12\x0e\n\nDROP_TABLE\x10\x04\x12\x10\n\x0cRENAME_TABLE\x10\x05\x12\x12\n\x0eTRUNCATE_TABLE\x10\x06\x12\x0f\n\x0b\x43REATE_VIEW\x10\x07\x12\x0e\n\nALTER_VIEW\x10\x08\x12\r\n\tDROP_VIEW\x10\t\x12\x10\n\x0c\x43REATE_INDEX\x10\n\x12\x0e\n\nDROP_INDEX\x10\x0b\x12\x13\n\x0f\x43REATE_FUNCTION\x10\x0c\x12\x11\n\rDROP_FUNCTION\x10\r\x12\x14\n\x10\x43REATE_PROCEDURE\x10\x0e\x12\x12\n\x0e\x44ROP_PROCEDURE\x10\x0f*\x84\x01\n\nColumnType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06\x42INARY\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x14\n\x10UNSIGNED_INTEGER\x10\x04\x12\t\n\x05\x46LOAT\x10\x05\x12\x0b\n\x07\x44\x45\x43IMAL\x10\x06\x12\x08\n\x04\x42OOL\x10\x07\x12\x0c\n\x08\x44\x41TETIME\x10\x08\x42\x0bH\x01Z\x07./;volc') _ENTRYTYPE = DESCRIPTOR.enum_types_by_name['EntryType'] EntryType = enum_type_wrapper.EnumTypeWrapper(_ENTRYTYPE) _SRCTYPE = DESCRIPTOR.enum_types_by_name['SrcType'] SrcType = enum_type_wrapper.EnumTypeWrapper(_SRCTYPE) _DMLTYPE = DESCRIPTOR.enum_types_by_name['DMLType'] DMLType = enum_type_wrapper.EnumTypeWrapper(_DMLTYPE) _DDLTYPE = DESCRIPTOR.enum_types_by_name['DDLType'] DDLType = enum_type_wrapper.EnumTypeWrapper(_DDLTYPE) _COLUMNTYPE = DESCRIPTOR.enum_types_by_name['ColumnType'] ColumnType = enum_type_wrapper.EnumTypeWrapper(_COLUMNTYPE) UNKNOWN_ENTRY = 0 BEGIN = 1 COMMIT = 2 DML = 3 DDL = 4 UNKNOWN_SRC = 0 MySQL = 1 PostgreSQL = 2 OTHER_DML = 0 INSERT = 1 UPDATE = 2 DELETE = 3 OTHER_DDL = 0 CREATE_TABLE = 2 ALTER_TABLE = 3 DROP_TABLE = 4 RENAME_TABLE = 5 TRUNCATE_TABLE = 6 CREATE_VIEW = 7 ALTER_VIEW = 8 DROP_VIEW = 9 CREATE_INDEX = 10 DROP_INDEX = 11 CREATE_FUNCTION = 12 DROP_FUNCTION = 13 CREATE_PROCEDURE = 14 DROP_PROCEDURE = 15 UNKNOWN = 0 STRING = 1 BINARY = 2 INTEGER = 3 UNSIGNED_INTEGER = 4 FLOAT = 5 DECIMAL = 6 BOOL = 7 DATETIME = 8 _ENTRY = DESCRIPTOR.message_types_by_name['Entry'] _PROP = DESCRIPTOR.message_types_by_name['Prop'] _BEGINEVENT = DESCRIPTOR.message_types_by_name['BeginEvent'] _COMMITEVENT = DESCRIPTOR.message_types_by_name['CommitEvent'] _DDLEVENT = DESCRIPTOR.message_types_by_name['DDLEvent'] _DMLEVENT = DESCRIPTOR.message_types_by_name['DMLEvent'] _INDEX = DESCRIPTOR.message_types_by_name['Index'] _ROW = DESCRIPTOR.message_types_by_name['Row'] _COLUMNDEF = DESCRIPTOR.message_types_by_name['ColumnDef'] _COLUMN = DESCRIPTOR.message_types_by_name['Column'] Entry = _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { 'DESCRIPTOR' : _ENTRY, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.Entry) }) _sym_db.RegisterMessage(Entry) Prop = _reflection.GeneratedProtocolMessageType('Prop', (_message.Message,), { 'DESCRIPTOR' : _PROP, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.Prop) }) _sym_db.RegisterMessage(Prop) BeginEvent = _reflection.GeneratedProtocolMessageType('BeginEvent', (_message.Message,), { 'DESCRIPTOR' : _BEGINEVENT, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.BeginEvent) }) _sym_db.RegisterMessage(BeginEvent) CommitEvent = _reflection.GeneratedProtocolMessageType('CommitEvent', (_message.Message,), { 'DESCRIPTOR' : _COMMITEVENT, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.CommitEvent) }) _sym_db.RegisterMessage(CommitEvent) DDLEvent = _reflection.GeneratedProtocolMessageType('DDLEvent', (_message.Message,), { 'DESCRIPTOR' : _DDLEVENT, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.DDLEvent) }) _sym_db.RegisterMessage(DDLEvent) DMLEvent = _reflection.GeneratedProtocolMessageType('DMLEvent', (_message.Message,), { 'DESCRIPTOR' : _DMLEVENT, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.DMLEvent) }) _sym_db.RegisterMessage(DMLEvent) Index = _reflection.GeneratedProtocolMessageType('Index', (_message.Message,), { 'DESCRIPTOR' : _INDEX, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.Index) }) _sym_db.RegisterMessage(Index) Row = _reflection.GeneratedProtocolMessageType('Row', (_message.Message,), { 'DESCRIPTOR' : _ROW, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.Row) }) _sym_db.RegisterMessage(Row) ColumnDef = _reflection.GeneratedProtocolMessageType('ColumnDef', (_message.Message,), { 'DESCRIPTOR' : _COLUMNDEF, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.ColumnDef) }) _sym_db.RegisterMessage(ColumnDef) Column = _reflection.GeneratedProtocolMessageType('Column', (_message.Message,), { 'DESCRIPTOR' : _COLUMN, '__module__' : 'volc_pb2' # @@protoc_insertion_point(class_scope:volc.Column) }) _sym_db.RegisterMessage(Column) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'H\001Z\007./;volc' _ENTRYTYPE._serialized_start=1389 _ENTRYTYPE._serialized_end=1460 _SRCTYPE._serialized_start=1462 _SRCTYPE._serialized_end=1515 _DMLTYPE._serialized_start=1517 _DMLTYPE._serialized_end=1577 _DDLTYPE._serialized_start=1580 _DDLTYPE._serialized_end=1857 _COLUMNTYPE._serialized_start=1860 _COLUMNTYPE._serialized_end=1992 _ENTRY._serialized_start=21 _ENTRY._serialized_end=380 _PROP._serialized_start=382 _PROP._serialized_end=416 _BEGINEVENT._serialized_start=418 _BEGINEVENT._serialized_end=511 _COMMITEVENT._serialized_start=513 _COMMITEVENT._serialized_end=607 _DDLEVENT._serialized_start=609 _DDLEVENT._serialized_end=725 _DMLEVENT._serialized_start=728 _DMLEVENT._serialized_end=907 _INDEX._serialized_start=909 _INDEX._serialized_end=952 _ROW._serialized_start=954 _ROW._serialized_end=1028 _COLUMNDEF._serialized_start=1031 _COLUMNDEF._serialized_end=1210 _COLUMN._serialized_start=1213 _COLUMN._serialized_end=1387 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/example/dts/suspend_dts_task.py ================================================ import json from volcengine.dts.dts_service import DtsService if __name__ == '__main__': access_key = 'your_ak_here' secret_key = 'your_sk_here' region_str = 'region_str_here' task_id_str = 'task_id_str' dts_service = DtsService(region=region_str) dts_service.set_ak(access_key) dts_service.set_sk(secret_key) params = {} body = { 'TaskId': task_id_str } resp = dts_service.suspend_transmission_task(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/emr/__init__.py ================================================ ================================================ FILE: volcengine/example/emr/example_list_clusters.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.emr.EMRService import EMRService if __name__ == '__main__': emr_service = EMRService(region="cn-beijing") # call the following methods explicitly if you dont set ak and sk in $HOME/.volc/config # emr_service.set_ak(testAk) # emr_service.set_sk(testSk) params = {} resp = emr_service.list_clusters(params) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/emr/example_list_instances.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.emr.EMRService import EMRService if __name__ == '__main__': emr_service = EMRService(region="cn-beijing") # call the following methods explicitly if you dont set ak and sk in $HOME/.volc/config # emr_service.set_ak(testAk) # emr_service.set_sk(testSk) params = {} body = { 'ClusterId': 'emr-2y1nqhdhxz38x9zkcwxb', 'PageSize': 20 } resp = emr_service.list_instances(params, body) print(json.dumps(resp, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'))) ================================================ FILE: volcengine/example/game_protect/example_anti_plugin.py ================================================ from volcengine.game_protect.GameProtectService import GameProtectService if __name__ == '__main__': gameProtector = GameProtectService() # call below method if you dont set ak and sk in $HOME/.volc/config gameProtector.set_ak('ak') gameProtector.set_sk('sk') params = { 'AppId': 218745, 'StartTime': 1618502400, 'EndTime': 1618545491, 'PageSize': 10, 'PageNum': 1 } req = dict() resp = gameProtector.risk_result(params, req) print(resp) ================================================ FILE: volcengine/example/iam/example_list_users.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.iam.IamService import IamService if __name__ == '__main__': iam_service = IamService() # call below method if you dont set ak and sk in $HOME/.volc/config iam_service.set_ak('ak') iam_service.set_sk('sk') params = dict() params['Limit'] = 5 params['Offset'] = 0 resp = iam_service.list_users(params) print(resp) ================================================ FILE: volcengine/example/image_registry/example_image_registry.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.image_registry.ImageRegistryService import ImageRegistryService if __name__ == '__main__': registry = ImageRegistryService() # call below method if you dont set ak and sk in $HOME/.volc/config registry.set_ak('ak') registry.set_sk('sk') params = {} body = {} resp = registry.list_namespace_basic(params, body) print(resp) ================================================ FILE: volcengine/example/imagex/v1/__init__.py ================================================ ================================================ FILE: volcengine/example/imagex/v1/data/__init__.py ================================================ import volcengine.imagex.data ================================================ FILE: volcengine/example/imagex/v1/data/bucket_base_op_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_base_op_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/bucket_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_bucket_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/cdn_top_request_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['ValueType'] = "Traffic" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_cdntop_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/compress_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_compress_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/domain_bandwidth_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_domain_bandwidth_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/domain_traffic_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_domain_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/edge_request.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['DataTypes'] = "2xx,3xx,4xx,5xx" query['GroupBy'] = "DomainName,DataType" query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/edge_request_bandwidth.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/edge_request_region.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" resp = imagex_service.describe_imagex_edge_request_regions(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/edge_request_traffic.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/hit_rate_request_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_hit_rate_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/hit_rate_traffic_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_hit_rate_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/imagex_summary.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['Timestamp'] = "2023-01-28T00:00:00+08:00" resp = imagex_service.describe_imagex_summary(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/mirror_request_bandwidth.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/mirror_request_http_code_by_time.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_http_code_by_time(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/mirror_request_http_code_overview.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_http_code_overview(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/mirror_request_traffic.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/data/request_cnt_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_request_cnt_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v1/examle_get_image_erase_models.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['Type'] = 0 resp = imagex_service.get_image_erase_models(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_common.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' params['StoreUri'] = 'image uri' resp = imagex_service.imagex_get('GetImageUploadFile', params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_create_image_content_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') args = {'ServiceId': '', 'TaskType': 'block_url', 'Urls': ['1'], } resp = imagex_service.create_image_content_task(args) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_delete_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') resp = imagex_service.delete_images("imagex service id", ["image uri 1"]) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_describe_imagex_volc_cdn_access_log.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = { 'ServiceId': "service id", } body = { 'StartTime': 1680500000, 'EndTime': 1680515000, 'Domain': "domain", 'Region': "global", 'PageNum': 1, 'PageSize': 10, } resp = imagex_service.describeImageVolcCdnAccessLog(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_fetch_url.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') req1 = { 'ServiceId': 'imagex service id', 'Url': 'image uri', # 'Async': True, } resp1 = imagex_service.fetch_image_url(req1) print(resp1) if 'TaskId' not in resp1: exit() req2 = { 'ServiceId': req1['ServiceId'], 'Id': resp1['TaskId'], } resp2 = imagex_service.get_url_fetch_task(req2) print(resp2) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_bg_fill_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['StoreUri'] = 'xx' params['Model'] = 0 params['Top'] = 0.0 params['Bottom'] = 0.0 params['Left'] = 0.0 params['Right'] = 0.0 resp = imagex_service.get_image_bg_fill_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_comic_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['StoreUri'] = 'xx' resp = imagex_service.get_image_comic_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_content_block_list.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') args = {'ServiceId': '', 'StartTime': 0, 'EndTime': 2147483647, } resp = imagex_service.get_image_content_block_list(args) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_content_task_detail.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') args = {'ServiceId': '', 'TaskType': 'refresh_url', 'StartTime': 0, 'EndTime': 2147483647, } resp = imagex_service.get_image_content_task_detail(args) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_enhance_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['StoreUri'] = 'xx' params['Model'] = 0 params['DisableAr'] = False params['DisableSharp'] = False resp = imagex_service.get_image_enhance_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_enhance_result_with_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['Model'] = 0 params['DisableAr'] = False params['DisableSharp'] = False data = open('path', mode='rb') resp = imagex_service.get_image_enhance_result_with_data(params, data) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_erase_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['StoreUri'] = 'xx' params['Model'] = '' resp = imagex_service.get_image_erase_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_info.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') resp = imagex_service.get_image_info('imagex service id', 'image uri') print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_ocr.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('your ak') imagex_service.set_sk('your sk') params = dict() params['ServiceId'] = "xx" params['Scene'] = "license" params['StoreUri'] = "xx" resp = imagex_service.get_image_ocr_v2(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('your ak') imagex_service.set_sk('your sk') params = dict() params['ServiceId'] = 'xx' params['Class'] = 'class' params['Refine'] = True params['StoreUri'] = 'store uri' params['OutFormat'] = 'out format' params['TransBg'] = True params['Color'] = { 'Color': "color", 'Size': 0 } resp = imagex_service.get_image_segment(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_style_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = { 'ServiceId': 'service id', 'StyleId': 'style id', 'Params': { 'key': 'value', }, 'OutputFormat': 'jpeg', 'OutputQuality': 90, } resp = imagex_service.get_image_style_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_image_super_resolution_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['StoreUri'] = 'xx' params['Multiple'] = 2.0 resp = imagex_service.get_image_super_resolution_result(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_get_license_plate_detection.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['ImageUri'] = '' resp = imagex_service.get_license_plate_detection(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_update_storage_ttl.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'service id' params['TTL'] = 0 resp = imagex_service.update_image_storage_ttl(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_upload_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' params['SkipMeta'] = False params['SkipCommit'] = False file_paths = ['image file path 1'] resp = imagex_service.upload_image(params, file_paths) print(resp) img_datas = ['image data 1'] resp = imagex_service.upload_image_data(params, img_datas) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_upload_image_token.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' resp = imagex_service.get_upload_auth_token(params) print(resp) ================================================ FILE: volcengine/example/imagex/v1/example_upload_sts2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.ImageXService import ImageXService if __name__ == '__main__': imagex_service = ImageXService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') # service id list allowed to do upload, set to empty if no restriction service_ids = ['imagex service id'] tag = dict() # tag 字段如下,可选择所需字段传入 # upload_policy_dict = { # "FileSizeUpLimit": "xxx", # "FileSizeBottomLimit": "xxx", # "ContentTypeBlackList":[ # "xxx" # ], # "ContentTypeWhiteList":[ # "xxx" # ] # } # policy_str = json.dumps(upload_policy_dict) # # tag = { # "UploadOverwrite": "true", # "UploadPolicy": policy_str, # } resp = imagex_service.get_upload_auth(service_ids, tag=tag) print(resp) ================================================ FILE: volcengine/example/imagex/v2/__init__.py ================================================ ================================================ FILE: volcengine/example/imagex/v2/api/AIProcessExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.ai_process(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/AddCertExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.add_cert(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/AddDomainV1Example.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.add_domain_v_1(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/AddImageBackgroundColorsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.add_image_background_colors(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/AddImageElementsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.add_image_elements(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/ApplyImageUploadExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.apply_image_upload(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/ApplyVpcUploadInfoExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.apply_vpc_upload_info(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/BatchImageAuditExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.batch_image_audit(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CommitImageUploadExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.commit_image_upload(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateAudioAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_audio_audit_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateBatchProcessTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_batch_process_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateCVImageGenerateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_cv_image_generate_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateFileRestoreExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_file_restore(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateHiddenWatermarkImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_hidden_watermark_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateHmExtractTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_hm_extract_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageAIProcessCallbackExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_ai_process_callback(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageAIProcessQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_ai_process_queue(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageAITaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_ai_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageAnalyzeTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_analyze_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_audit_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageCompressTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_compress_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageContentTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_content_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageFromUriExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_from_uri(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageHmEmbedExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_hm_embed(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageHmExtractExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.create_image_hm_extract(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageMigrateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_migrate_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageMonitorRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_monitor_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageRetryAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_retry_audit_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageServiceExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_service(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageSettingRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_setting_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageStyleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_style(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageTemplateExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_template(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageTemplatesByImportExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_image_templates_by_import(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageTranscodeCallbackExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_transcode_callback(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageTranscodeQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_transcode_queue(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateImageTranscodeTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_image_transcode_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateTemplatesFromBinExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_templates_from_bin(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/CreateVideoAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.create_video_audit_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DelCertExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.del_cert(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DelDomainExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.del_domain(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageAIProcessDetailExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_ai_process_detail(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageAIProcessQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_ai_process_queue(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageAnalyzeTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_image_analyze_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageAnalyzeTaskRunExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_image_analyze_task_run(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageAuditResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_image_audit_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageBackgroundColorsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_background_colors(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageElementsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_elements(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageMigrateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.delete_image_migrate_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageMonitorRecordsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_monitor_records(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageMonitorRulesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_monitor_rules(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageServiceExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.delete_image_service(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageSettingRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_setting_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageStyleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_style(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageTemplateExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_template(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageTranscodeDetailExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_image_transcode_detail(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageTranscodeQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_image_transcode_queue(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteImageUploadFilesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_image_upload_files(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DeleteTemplatesFromBinExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.delete_templates_from_bin(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageVolcCdnAccessLogExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_image_volc_cdn_access_log(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXAIRequestCntUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagexai_request_cnt_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXAddOnQPSUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_add_on_qps_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXBaseOpUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_base_op_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXBillingRequestCntUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_billing_request_cnt_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXBucketRetrievalUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_bucket_retrieval_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXBucketUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_bucket_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCDNTopRequestDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagexcdn_top_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnDurationAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_duration_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnDurationDetailByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_duration_detail_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnErrorCodeAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_error_code_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnErrorCodeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_error_code_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnProtocolRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_protocol_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnReuseRateAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_reuse_rate_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnReuseRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_reuse_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnSuccessRateAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_success_rate_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCdnSuccessRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_cdn_success_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientCountByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_count_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientDecodeDurationByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_decode_duration_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientDecodeSuccessRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_decode_success_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientDemotionRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_demotion_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientErrorCodeAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_error_code_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientErrorCodeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_error_code_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientFailureRateExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_failure_rate(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientFileSizeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_file_size(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientLoadDurationAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_load_duration_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientLoadDurationExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_load_duration(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientQualityRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_quality_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientQueueDurationByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_queue_duration_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientScoreByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_score_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientSdkVerByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_sdk_ver_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientTopDemotionURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_top_demotion_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientTopFileSizeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_top_file_size(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXClientTopQualityURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_client_top_quality_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCompressUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_compress_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXCubeUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_cube_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXDomainBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_domain_bandwidth_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXDomainBandwidthNinetyFiveDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_domain_bandwidth_ninety_five_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXDomainTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_domain_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXEdgeRequestBandwidthExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_edge_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXEdgeRequestExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_edge_request(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXEdgeRequestRegionsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_edge_request_regions(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXEdgeRequestTrafficExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_edge_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXExceedCountByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_exceed_count_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXExceedFileSizeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_exceed_file_size(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXExceedResolutionRatioAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_exceed_resolution_ratio_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeDurationByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_duration_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeErrorCodeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_error_code_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeFileInSizeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_file_in_size_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeFileOutSizeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_file_out_size_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeSuccessCountByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_success_count_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHeifEncodeSuccessRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.describe_imagex_heif_encode_success_rate_by_time(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHitRateRequestDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_hit_rate_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXHitRateTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_hit_rate_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXMirrorRequestBandwidthExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_mirror_request_bandwidth(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXMirrorRequestHttpCodeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_mirror_request_http_code_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXMirrorRequestHttpCodeOverviewExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_mirror_request_http_code_overview(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXMirrorRequestTrafficExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_mirror_request_traffic(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXMultiCompressUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_multi_compress_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXRequestCntUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_request_cnt_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXScreenshotUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_screenshot_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleCacheHitRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_cache_hit_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleCountByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_count_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleTopRamURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_top_ram_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleTopResolutionURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_top_resolution_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleTopSizeURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_top_size_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSensibleTopUnknownURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_sensible_top_unknown_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXServerQPSUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_server_qps_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXServiceQualityExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_service_quality(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSourceRequestBandwidthExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_source_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSourceRequestExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_source_request(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSourceRequestTrafficExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_source_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXStorageUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_storage_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXSummaryExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_summary(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadCountByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_count_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadDurationExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_duration(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadErrorCodeAllExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_error_code_all(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadErrorCodeByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_error_code_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadFileSizeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_file_size(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadSegmentSpeedByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_segment_speed_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadSpeedExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_speed(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXUploadSuccessRateByTimeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_imagex_upload_success_rate_by_time(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DescribeImageXVideoClipDurationUsageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_imagex_video_clip_duration_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/DownloadCertExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.download_cert(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/ExportFailedMigrateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.export_failed_migrate_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/FetchImageUrlExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.fetch_image_url(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAiGenerateImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_ai_generate_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAllCertsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_all_certs(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAllImageServicesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_all_image_services(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAllImageTemplatesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_all_image_templates(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAudioAuditResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_audio_audit_result(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetAuditEntrysCountExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_audit_entrys_count(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetBatchProcessResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_batch_process_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetBatchTaskInfoExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_batch_task_info(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCVAnimeGenerateImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_cv_anime_generate_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCVImageGenerateResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_cv_image_generate_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCVImageGenerateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_cv_image_generate_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCVTextGenerateImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_cv_text_generate_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCertInfoExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_cert_info(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetComprehensiveEnhanceImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_comprehensive_enhance_image(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetCompressTaskInfoExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_compress_task_info(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetDedupTaskStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_dedup_task_status(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetDenoisingImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_denoising_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetDomainConfigExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_domain_config(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetDomainOwnerVerifyContentExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_domain_owner_verify_content(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAIDetailsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_ai_details(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAIProcessQueuesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_ai_process_queues(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAITasksExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_ai_tasks(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAddOnTagExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_add_on_tag(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAiGenerateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_ai_generate_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAlertRecordsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_alert_records(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAllDomainCertExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_all_domain_cert(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAnalyzeResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_analyze_result(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAnalyzeTasksExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_analyze_tasks(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAuditResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_audit_result(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAuditTaskResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_audit_task_result(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAuditTasksExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_audit_tasks(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageAuthKeyExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_auth_key(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageBackgroundColorsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_background_colors(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageBgFillResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_bg_fill_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageComicResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_comic_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageContentBlockListExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_content_block_list(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageContentTaskDetailExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_content_task_detail(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageDetectResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_detect_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageDuplicateDetectionExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_duplicate_detection(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageElementsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_elements(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageEnhanceResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_enhance_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageEraseModelsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_erase_models(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageEraseResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_erase_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageFontsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_fonts(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageHmExtractTaskInfoExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_hm_extract_task_info(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageMigrateTasksExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_migrate_tasks(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageMonitorRulesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_monitor_rules(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageOCRV2Example.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_ocr_v2(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImagePSDetectionExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_ps_detection(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageQualityExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_quality(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageServiceExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_service(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageServiceSubscriptionExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_service_subscription(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageSettingRuleHistoryExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_setting_rule_history(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageSettingRulesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_setting_rules(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageSettingsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_settings(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageSmartCropResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_smart_crop_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageStorageFilesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_storage_files(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageStyleDetailExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_style_detail(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageStyleResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_image_style_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageStylesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_styles(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageSuperResolutionResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_image_super_resolution_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageTemplateExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_template(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageTranscodeDetailsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_transcode_details(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageTranscodeQueuesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_transcode_queues(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageUpdateFilesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_update_files(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageUploadFileExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_upload_file(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageUploadFilesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_image_upload_files(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageXQueryAppsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_imagex_query_apps(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageXQueryDimsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_imagex_query_dims(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageXQueryRegionsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_imagex_query_regions(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetImageXQueryValsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_imagex_query_vals(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetLicensePlateDetectionExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_license_plate_detection(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetPrivateImageTypeExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_private_image_type(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetProductAIGCResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_product_aigc_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetResourceURLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_resource_url(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetResponseHeaderValidateKeysExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.get_response_header_validate_keys() print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetSegmentImageExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_segment_image(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetServiceDomainsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_service_domains(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetSyncAuditResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.get_sync_audit_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetTemplatesFromBinExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_templates_from_bin(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetUrlFetchTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_url_fetch_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetVendorBucketsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_vendor_buckets(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/GetVideoAuditResultExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_video_audit_result(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/PreviewImageUploadFileExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.preview_image_upload_file(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/RerunImageMigrateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.rerun_image_migrate_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/SetDefaultDomainExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.set_default_domain(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/SingleImageAuditExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.single_image_audit(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/TerminateImageMigrateTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.terminate_image_migrate_task(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateAdvanceExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_advance(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateAudioAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_audio_audit_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateAuditImageStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_audit_image_status(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateDomainAdaptiveFmtExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_domain_adaptive_fmt(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateFileStorageClassExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_file_storage_class(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateHttpsExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_https(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAIProcessQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_ai_process_queue(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAIProcessQueueStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_ai_process_queue_status(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAnalyzeTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_analyze_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAnalyzeTaskStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_analyze_task_status(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_audit_task(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAuditTaskStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_audit_task_status(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageAuthKeyExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_auth_key(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageBatchDomainCertExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_batch_domain_cert(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainAreaAccessExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_area_access(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainBandwidthLimitExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_bandwidth_limit(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainConfigExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_config(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainDownloadSpeedLimitExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_download_speed_limit(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainIPAuthExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_ip_auth(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainUaAccessExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_ua_access(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageDomainVolcOriginExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_domain_volc_origin(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageExifDataExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_exif_data(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageFileCTExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_file_ct(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageFileKeyExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_file_key(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageMirrorConfExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_mirror_conf(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageMonitorRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_monitor_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageMonitorRuleStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_monitor_rule_status(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageObjectAccessExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_object_access(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageResourceStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_resource_status(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageSettingRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_setting_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageSettingRulePriorityExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_setting_rule_priority(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageStorageTTLExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_storage_ttl(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageStyleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_style(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageStyleMetaExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_style_meta(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageTaskStrategyExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_task_strategy(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageTranscodeQueueExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_transcode_queue(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageTranscodeQueueStatusExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_image_transcode_queue_status(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageUploadFilesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_upload_files(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateImageUploadOverwriteExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_image_upload_overwrite(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateReferExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_refer(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateResEventRuleExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_res_event_rule(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateResponseHeaderExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_response_header(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateServiceNameExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_service_name(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateSlimConfigExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_slim_config(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateStorageRulesExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_storage_rules(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateStorageRulesV2Example.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_storage_rules_v_2(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/UpdateVideoAuditTaskExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.update_video_audit_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/api/VerifyDomainOwnerExample.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} body = {} resp = service.verify_domain_owner(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/__init__.py ================================================ import volcengine.imagex.data ================================================ FILE: volcengine/example/imagex/v2/data/bucket_base_op_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_base_op_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/bucket_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_bucket_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/cdn_top_request_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['ValueType'] = "Traffic" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_cdntop_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/compress_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_compress_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/domain_bandwidth_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_domain_bandwidth_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/domain_traffic_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_domain_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/edge_request.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['DataTypes'] = "2xx,3xx,4xx,5xx" query['GroupBy'] = "DomainName,DataType" query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/edge_request_bandwidth.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/edge_request_region.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" resp = imagex_service.describe_imagex_edge_request_regions(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/edge_request_traffic.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_edge_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/hit_rate_request_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_hit_rate_request_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/hit_rate_traffic_data.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_hit_rate_traffic_data(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/imagex_summary.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['Timestamp'] = "2023-01-28T00:00:00+08:00" resp = imagex_service.describe_imagex_summary(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/mirror_request_bandwidth.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_bandwidth(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/mirror_request_http_code_by_time.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_http_code_by_time(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/mirror_request_http_code_overview.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_http_code_overview(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/mirror_request_traffic.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "5m" resp = imagex_service.describe_imagex_mirror_request_traffic(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/data/request_cnt_usage.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['StartTime'] = "2023-01-21T00:00:00+08:00" query['EndTime'] = "2023-01-28T00:00:00+08:00" query['Interval'] = "300" resp = imagex_service.describe_imagex_request_cnt_usage(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/examle_get_image_erase_models.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = dict() query['Type'] = 0 resp = imagex_service.get_image_erase_models(query) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_common.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' params['StoreUri'] = 'image uri' resp = imagex_service.imagex_get('GetImageUploadFile', params) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_create_image_content_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == "__main__": imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak("ak") imagex_service.set_sk("sk") query = { "ServiceId": "", } body = { "TaskType": "block_url", "Urls": ["1"], } resp = imagex_service.create_image_content_task(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_delete_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == "__main__": imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak("ak") imagex_service.set_sk("sk") query = { "ServiceId": "service id", } body = {} resp = imagex_service.delete_image_upload_files(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_describe_imagex_volc_cdn_access_log.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') query = { 'ServiceId': "service id", } body = { 'StartTime': 1680500000, 'EndTime': 1680515000, 'Domain': "domain", 'Region': "global", 'PageNum': 1, 'PageSize': 10, } resp = imagex_service.describe_image_volc_cdn_access_log(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_fetch_url.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = { 'ServiceId': 'imagex service id', 'Url': 'image uri', # 'Async': True, } resp1 = imagex_service.fetch_image_url(body) print(resp1) if 'TaskId' not in resp1: exit() req2 = { 'ServiceId': body['ServiceId'], 'Id': resp1['TaskId'], } resp2 = imagex_service.get_url_fetch_task(req2) print(resp2) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_bg_fill_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['StoreUri'] = 'xx' body['Model'] = 0 body['Top'] = 0.0 body['Bottom'] = 0.0 body['Left'] = 0.0 body['Right'] = 0.0 resp = imagex_service.get_image_bg_fill_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_comic_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['StoreUri'] = 'xx' resp = imagex_service.get_image_comic_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_content_block_list.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == "__main__": imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak("ak") imagex_service.set_sk("sk") query = { "ServiceId": "", } body = { "StartTime": 0, "EndTime": 2147483647, } resp = imagex_service.get_image_content_block_list(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_content_task_detail.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == "__main__": imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak("ak") imagex_service.set_sk("sk") body = { "ServiceId": "", "TaskType": "refresh_url", "StartTime": 0, "EndTime": 2147483647, } resp = imagex_service.get_image_content_task_detail(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_enhance_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['StoreUri'] = 'xx' body['Model'] = 0 body['DisableAr'] = False body['DisableSharp'] = False resp = imagex_service.get_image_enhance_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_erase_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['StoreUri'] = 'xx' body['Model'] = '' resp = imagex_service.get_image_erase_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_ocr.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('your ak') imagex_service.set_sk('your sk') query = dict() query['ServiceId'] = "xx" body = dict() body['Scene'] = "license" body['StoreUri'] = "xx" resp = imagex_service.get_image_ocr_v2(query,body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_style_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == "__main__": imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak("ak") imagex_service.set_sk("sk") query = { "ServiceId": "service id", } body = { "StyleId": "style id", "Params": { "key": "value", }, "OutputFormat": "jpeg", "OutputQuality": 90, } resp = imagex_service.get_image_style_result(query, body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_get_image_super_resolution_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['StoreUri'] = 'xx' body['Multiple'] = 2.0 resp = imagex_service.get_image_super_resolution_result(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_update_storage_ttl.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') body = dict() body['ServiceId'] = 'service id' body['TTL'] = 0 resp = imagex_service.update_image_storage_ttl(body) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_upload_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' params['SkipMeta'] = False # params['UploadHost'] = 'upload host' params['SkipCommit'] = False file_paths = ['image file path 1'] resp = imagex_service.upload_image(params, file_paths) print(resp) img_datas = ['image data 1'] resp = imagex_service.upload_image_data(params, img_datas) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_upload_image_token.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') params = dict() params['ServiceId'] = 'imagex service id' resp = imagex_service.get_upload_auth_token(params) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_upload_sts2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') # service id list allowed to do upload, set to empty if no restriction service_ids = ['imagex service id'] tag = dict() # tag 字段如下,可选择所需字段传入 # upload_policy_dict = { # "FileSizeUpLimit": "xxx", # "FileSizeBottomLimit": "xxx", # "ContentTypeBlackList":[ # "xxx" # ], # "ContentTypeWhiteList":[ # "xxx" # ] # } # policy_str = json.dumps(upload_policy_dict) # # tag = { # "UploadOverwrite": "true", # "UploadPolicy": policy_str, # } resp = imagex_service.get_upload_auth(service_ids, tag=tag) print(resp) ================================================ FILE: volcengine/example/imagex/v2/example_vpc_upload_image.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imagex.v2.imagex_service import ImagexService if __name__ == '__main__': imagex_service = ImagexService() # call below method if you dont set ak and sk in $HOME/.volc/config imagex_service.set_ak('ak') imagex_service.set_sk('sk') request = dict() request["ServiceId"] = "service id" # 服务 ID request["FilePath"] = "your file path" # 文件路径,与Data二选一 request["Data"] = 'your data' # 文件二进制数据,与FilePath二选一 request["StoreKey"] = "your store key" # 文件存储名 request["Prefix"] = "your prefix" # 文件前缀 request["FileExtension"] = "your file extension" # 文件后缀 request["ContentType"] = "your content type" # 文件Content-Type request["StorageClass"] = "your storage class" # 文件存储类型 request["PartSize"] = 0 # 偏好分片大小,单位为字节(0表示按照默认规则分片) request["Overwrite"] = False # 是否覆盖已有文件 request["SkipMeta"] = False # 是否跳过元信息 try: resp = imagex_service.vpc_upload_image(request) print(resp) except Exception as e: print(e) ================================================ FILE: volcengine/example/imp/KillJob.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imp.ImpService import ImpService from volcengine.imp.models.business.imp_common_pb2 import InputPath from volcengine.imp.models.request.request_imp_pb2 import * if __name__ == '__main__': imp_service = ImpService() # call below method if you dont set ak and sk in $HOME/.vcloud/config imp_service.set_ak('your ak') imp_service.set_sk('your sk') # KillJob try: req = ImpKillJobRequest() req.JobId = 'your JobId' resp = imp_service.kill_job(req) except Exception: raise else: print("resp:\n ", resp) if resp.ResponseMetadata.Error.Code == '': pass else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/imp/RetrieveJob.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imp.ImpService import ImpService from volcengine.imp.models.business.imp_common_pb2 import InputPath from volcengine.imp.models.request.request_imp_pb2 import * if __name__ == '__main__': imp_service = ImpService() # call below method if you dont set ak and sk in $HOME/.vcloud/config imp_service.set_ak('your ak') imp_service.set_sk('your sk') # RetrieveJob try: req = ImpRetrieveJobRequest() req.JobIds.extend(['your JobId1', 'your JobId2']) resp = imp_service.retrieve_job(req) except Exception: raise else: print("resp:\n ", resp) if resp.ResponseMetadata.Error.Code == '': print("Result:\n ", resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/imp/SubmitJob.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imp.ImpService import ImpService from volcengine.imp.models.business.imp_common_pb2 import * from volcengine.imp.models.request.request_imp_pb2 import * if __name__ == '__main__': imp_service = ImpService() # call below method if you dont set ak and sk in $HOME/.vcloud/config imp_service.set_ak('your ak') imp_service.set_sk('your sk') # SubmitJob try: req = ImpSubmitJobRequest() req.InputPath.Type = 'VOD' req.InputPath.VodSpaceName = 'your space' req.InputPath.FileId = 'your vid' req.TemplateId = 'your template id' req.CallbackArgs = 'your callback args' resp = imp_service.submit_job(req) except Exception: raise else: print("resp:\n ", resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/imp/SubmitJobByJob.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.imp.ImpService import ImpService from volcengine.imp.models.business.imp_common_pb2 import * from volcengine.imp.models.request.request_imp_pb2 import * if __name__ == '__main__': imp_service = ImpService() # call below method if you dont set ak and sk in $HOME/.vcloud/config imp_service.set_ak('your ak') imp_service.set_sk('your sk') # SubmitJob by Job try: req = ImpSubmitJobRequest() req.InputPath.Type = 'VOD' req.InputPath.VodSpaceName = 'your vod space' req.InputPath.FileId = 'your vid' req.OutputPath.Type = 'VOD' req.OutputPath.VodSpaceName = 'your vod space' req.Job.TranscodeVideo.Container = 'your container' req.Job.TranscodeVideo.Video.Codec = 'your video codec' req.Job.TranscodeVideo.Audio.Codec = 'your audio codec' req.CallbackArgs = 'your callback args' resp = imp_service.submit_job(req) except Exception: raise else: print("resp:\n ", resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/imp/__init__.py ================================================ ================================================ FILE: volcengine/example/live/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_audit/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_audit/example_create_snapshot_audit_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", "App": "app", "Bucket": "bb", "Interval": 8.9, "StorageStrategy": 1, "CallbackDetailList": [{"URL": "http://xx", "CallbackType": "http"}], "Label": ["301"] } resp = live_service.create_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_audit/example_delete_snapshot_audit_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", "App": "app", "PresetName": "preset", } resp = live_service.delete_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_audit/example_list_vhost_snapshot_audit_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", } resp = live_service.list_vhost_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_audit/example_update_snapshot_audit_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", "App": "app", "PresetName": "presetName", "Interval": 5.0, } resp = live_service.update_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_auth/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_auth/example_describe_auth.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", "SceneType": "push", } resp = live_service.describe_auth(body) print(resp) ================================================ FILE: volcengine/example/live/example_auth/example_update_auth_key.py ================================================ # coding:utf-8 from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", "SceneType": "push", "AuthDetailList": [ { "EncryptionAlgorithm": "md5", "SecretKey": "xx", }, ], } resp = live_service.update_auth_key(body) print(resp) ================================================ FILE: volcengine/example/live/example_callback/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_callback/example_delete_callback.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "MessageType": "record", "Vhost": "vhost", } resp = live_service.delete_callback(body) print(resp) ================================================ FILE: volcengine/example/live/example_callback/example_describe_callback.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "MessageType": "", "Domain": "domain", "App": "app", } resp = live_service.describe_callback(body) print(resp) ================================================ FILE: volcengine/example/live/example_callback/example_update_callback.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "MessageType": "record", "Vhost": "vhost", "CallbackDetailList": [ { "CallbackType": "callBackType", "URL": "demoUrl", }, ], } resp = live_service.update_callback(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_cert/example_bind_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", "CertDomain": "", "ChainID": "", } resp = live_service.bind_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/example_create_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "UseWay": "sign", "CertName": "", } resp = live_service.create_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/example_delete_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "ChainID": "", } resp = live_service.delete_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/example_list_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", "Available": True, "Expiring": False, } resp = live_service.list_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/example_un_bind_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", } resp = live_service.un_bind_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_cert/example_update_cert.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "UseWay": "sign", "ChainID": "xxx", } resp = live_service.update_cert(body) print(resp) ================================================ FILE: volcengine/example/live/example_deny_config/example_describe_deny_config.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeDenyConfigRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeDenyConfigRequest() req.Vhost = 'vhost' req.Domain = 'domain' print(req) resp = live_service.describe_deny_config(req) print(resp) ================================================ FILE: volcengine/example/live/example_deny_config/example_update_deny_config.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.business.deny_config_pb2 import DenyConfigDetail from volcengine.live.models.request.request_live_pb2 import UpdateDenyConfigRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = UpdateDenyConfigRequest() detail = DenyConfigDetail() detail.ProType.extend(['ProType']) detail.FmtType.extend(['FmtType']) detail.AllowList.extend(['AllowList']) detail.DenyList.extend(['DenyList']) req.Vhost = 'Vhost' req.Domain = 'Domain' req.DenyConfigList.extend([detail]) print(req) resp = live_service.update_deny_config(req) print(resp) ================================================ FILE: volcengine/example/live/example_describe_info/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_describe_info/example_describe_info.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService # 示例 - 查询直播域名带宽数据 def example_describe_live_bandwidth_data(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-04-13T00:00:00Z", "EndTime": "2022-04-14T00:00:00Z", "Aggregation": 300, } resp = live_service.describe_live_bandwidth_data(body) print(resp) # 示例 - 查询直播域名流量数据 def example_describe_live_traffic_data(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-04-13T00:00:00Z", "EndTime": "2022-04-14T00:00:00Z", "Aggregation": 300, } resp = live_service.describe_live_traffic_data(body) print(resp) # 示例 - 查询95带宽 def example_describe_live_P95Peak_bandwidth_data(live_service): body = { "StartTime": "2022-04-13T00:00:00Z", "EndTime": "2022-04-14T00:00:00Z", "Aggregation": 300, } resp = live_service.describe_live_P95Peak_bandwidth_data(body) print(resp) # 示例 - 查询直播域名录制用量 def example_describe_record_data(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-04-13T00:00:00Z", "EndTime": "2022-04-13T00:10:00Z", "Aggregation": 300, } resp = live_service.describe_record_data(body) print(resp) # 示例 - 查询直播域名转码用量 def example_describe_transcode_data(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-03-07T00:00:00+08:00", "EndTime": "2022-03-08T00:00:00+08:00", "Aggregation": 86400, } resp = live_service.describe_transcode_data(body) print(resp) # 示例 - 查询直播域名截图张数 def example_describe_snapshot_data(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-03-07T00:00:00+08:00", "EndTime": "2022-03-08T00:00:00+08:00", "Aggregation": 86400, } resp = live_service.describe_snapshot_data(body) print(resp) # 示例 - 日志下载 def example_describe_live_domain_log(live_service): params = { "DomainList": ["example.com", "example2.com"], "StartTime": "2022-04-21T14:00:00+08:00", "EndTime": "2022-04-22T14:00:00+08:00", } resp = live_service.describe_live_domain_log(params) print(resp) # 示例 - 查询推流监控数据 def example_describe_push_stream_metrics(live_service): body = { "Domain": "example.com", "App": "example_app", "Stream": "example_stream", "StartTime": "2022-04-21T00:00:00Z", "EndTime": "2022-04-23T23:59:59Z", "Aggregation": 30, } resp = live_service.describe_push_stream_metrics(body) print(resp) # 示例 - 查询直播流历史在线人数 def example_describe_live_stream_sessions(live_service): body = { "Domain": "example.com", "App": "example", "Stream": "example080601", "ProtocolList": ["RTMP", "HTTP-FLV"], "StartTime": "2022-04-21T00:00:00Z", "EndTime": "2022-04-21T10:59:59Z", "Aggregation": 60, } resp = live_service.describe_live_stream_sessions(body) print(resp) # 示例 - 查询域名 HTTP 返回码占比 def example_describe_play_response_status_stat(live_service): body = { "DomainList": ["example.com", "example2.com"], "StartTime": "2021-08-16T00:00:00Z", "EndTime": "2021-08-16T00:01:59Z", "Aggregation": 60 } resp = live_service.describe_play_response_status_stat(body) print(resp) # 示例 - Stream流量查询 def example_describe_live_metric_traffic_data(live_service): body = { "DomainList": ["example.com"], "ProtocolList": ["HTTP-FLV", "RTMP"], "ISPList": ["telecom"], "IPList": ["123.123.123.000"], "RegionList": [ { "Area": "cn", "Country": "cn", "Province": "beijing", }, ], "StartTime": "2022-04-13T00:00:00+08:00", "EndTime": "2022-04-13T12:00:00+08:00", "Aggregation": 300, "ShowDetail": True, } resp = live_service.describe_live_metric_traffic_data(body) print(resp) # 示例 - Stream带宽查询 def example_describe_live_metric_bandwidth_data(live_service): body = { "DomainList": ["example.com"], "ProtocolList": ["HTTP-FLV", "RTMP"], "ISPList": ["telecom"], "IPList": ["123.123.123.000"], "RegionList": [ { "Area": "cn", "Country": "cn", "Province": "beijing", }, ], "StartTime": "2021-04-13T00:00:00+08:00", "EndTime": "2021-04-14T00:00:00+08:00", "Aggregation": 300, "ShowDetail": True, } resp = live_service.describe_live_metric_bandwidth_data(body) print(resp) # 示例 - 拉流域名查询流列表 def example_describe_play_stream_list(live_service): params = { "Domain": "example.com", "StartTime": "2022-04-13T00:00:00+08:00", "EndTime": "2022-04-14T00:00:00+08:00", } resp = live_service.describe_play_stream_list(params) print(resp) # 示例 - 拉流转推带宽查询 def example_describe_pull_to_push_bandwidth_data(live_service): params = { "DomainList": ["example.com"], "DstAddrTypeList": ["live","Third"], "StartTime": "2021-04-13T00:00:00+08:00", "EndTime": "2021-04-14T00:00:00+08:00", "Aggregation": 300, "ShowDetail": True } resp = live_service.describe_pull_to_push_bandwidth_data(params) print(resp) # 示例 - 截图审核查询 def example_describe_live_audit_data(live_service): params = { "DomainList": ["example.com", "example2.com"], "DetailField": ["Domain"], "StartTime": "2022-07-13T00:00:00+08:00", "EndTime": "2022-07-14T00:00:00+08:00", "Aggregation": 86400, } resp = live_service.describe_live_audit_data(params) print(resp) if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) # 1.查询直播域名带宽数据 example_describe_live_bandwidth_data(live_service) # 2.查询直播域名流量数据 example_describe_live_traffic_data(live_service) # 3.查询95带宽 example_describe_live_P95Peak_bandwidth_data(live_service) # 4.查询直播域名录制用量 example_describe_record_data(live_service) # 5.查询直播域名转码用量 example_describe_transcode_data(live_service) # 6.查询直播域名截图张数 example_describe_snapshot_data(live_service) # 7.日志下载 example_describe_live_domain_log(live_service) # 8.查询推流监控数据 example_describe_push_stream_metrics(live_service) # 9.查询直播流历史在线人数 example_describe_live_stream_sessions(live_service) # 10.查询域名 HTTP 返回码占比 example_describe_play_response_status_stat(live_service) # 11.Stream流量查询 example_describe_live_metric_traffic_data(live_service) # 12.Stream带宽查询 example_describe_live_metric_bandwidth_data(live_service) # 13.拉流域名查询流列表 example_describe_play_stream_list(live_service) # 14.拉流转推带宽查询 example_describe_pull_to_push_bandwidth_data(live_service) ================================================ FILE: volcengine/example/live/example_domain/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_domain/example_create_domain.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { # "Domain": "push-rtmp-testpython.xxx.xx", "Domain": "pull-rtmp-testpython.xxx.xx", # "Type": "push", "Type": "pull-flv", } resp = live_service.create_domain(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_delete_domain.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", } resp = live_service.delete_domain(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_describe_domain.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "DomainList": ["domain1","domain2"], } # body = json.dumps(body) resp = live_service.describe_domain(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_disable_domain.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", } resp = live_service.disable_domain(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_enable_domain.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", } resp = live_service.enable_domain(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_list_domain_detail.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "PageNum": 1, "PageSize": 10, } resp = live_service.list_domain_detail(body) print(resp) ================================================ FILE: volcengine/example/live/example_domain/example_manager_pull_push_domain_bind.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "PullDomain": "", "PushDomain": "", } resp = live_service.manager_pull_push_domain_bind(body) print(resp) ================================================ FILE: volcengine/example/live/example_generate_url/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_generate_url/example_generate_play_u_r_l.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import GeneratePlayURLRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = GeneratePlayURLRequest() req.Vhost = '' req.Domain = '' req.App = '' req.Stream = '' req.Suffix = '' req.Type = '' req.ValidDuration = 1 req.ExpiredTime = '' print(req) resp = live_service.generate_play_u_r_l(req) print(resp) ================================================ FILE: volcengine/example/live/example_generate_url/example_generate_push_u_r_l.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import GeneratePushURLRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = GeneratePushURLRequest() req.Vhost = '' req.App = '' req.Stream = '' req.ValidDuration = 0 req.ExpiredTime = '' print(req) resp = live_service.generate_push_u_r_l(req) print(resp) ================================================ FILE: volcengine/example/live/example_index_m3u8/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_index_m3u8/example_create_live_stream_record_index_file.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') body = { "Domain": "your domain", "App": "your app", "Stream": "your stream", "StartTime": "2022-12-22T19:35:00Z", "EndTime": "2022-12-22T19:40:05Z", "OutputBucket": "your bucket" } resp = live_service.create_live_stream_record_index_files(body) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_pull_to_push/example_create_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import CreatePullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = CreatePullToPushTaskRequest() req.Title = '' req.Type = 0 req.CycleMode = 0 req.StartTime = 0 req.EndTime = 0 req.DstAddr = '' req.SrcAddr = '' req.SrcAddrS = [] req.SrcAddrS.extend(['']) print(req) resp = live_service.create_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/example_delete_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DeletePullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DeletePullToPushTaskRequest() req.TaskId = 'TaskId' print(req) resp = live_service.delete_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/example_list_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import ListPullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = ListPullToPushTaskRequest() req.Title = 'Title' req.Page = 0 req.Size = 0 print(req) resp = live_service.list_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/example_restart_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import RestartPullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = RestartPullToPushTaskRequest() req.TaskId = 'TaskId' print(req) resp = live_service.restart_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/example_stop_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import StopPullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = StopPullToPushTaskRequest() req.TaskId = 'TaskId' print(req) resp = live_service.stop_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_pull_to_push/example_update_pull_to_push_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import UpdatePullToPushTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = UpdatePullToPushTaskRequest() req.Title = '' req.Type = 1 req.CycleMode = -1 req.StartTime = 0 req.EndTime = 0 req.TaskId = '' req.DstAddr = '' req.SrcAddr = '' req.SrcAddrS = [] req.SrcAddrS.extend(['']) print(req) resp = live_service.update_pull_to_push_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_record/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_record/example_create_record_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", "App": "app", "Status": 1, "Bucket": "bb", "RecordTob": [ { "Format": "hls", "Duration": 100, "Splice": -1, "RecordObject": "/xx/xx", }, ] } resp = live_service.create_record_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_record/example_delete_record_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "Preset": "preset", } resp = live_service.delete_record_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_record/example_describe_record_task_file_history.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeRecordTaskFileHistoryRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeRecordTaskFileHistoryRequest() req.Vhost = 'Vhost' req.App = 'App' req.DateFrom = '2022-10-19T00:00:00+08:00' req.DateTo = '2022-10-25T23:59:59+08:00' req.Type = 'Type' req.PageNum = 0 req.PageSize = 0 print(req) resp = live_service.describe_record_task_file_history(req) print(resp) ================================================ FILE: volcengine/example/live/example_record/example_list_vhost_record_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "vhost", } resp = live_service.list_vhost_record_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_record/example_update_record_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Preset": "preset", "Vhost": "vhost", "App": "app", "Status": 1, "Bucket": "bb", "RecordTob": [ { "Format": "hls", "Duration": 100, "Splice": -1, "RecordObject": "/xx/xx", }, ], } resp = live_service.update_record_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_referer/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_referer/example_delete_referer.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", } resp = live_service.delete_referer(body) print(resp) ================================================ FILE: volcengine/example/live/example_referer/example_describe_referer.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", "App": "", } resp = live_service.describe_referer(body) print(resp) ================================================ FILE: volcengine/example/live/example_referer/example_update_referer.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", "App": "", "RefererInfoList": [ { "Key": "asd", "Type": "xx", "Value": "sad", "Priority": 0, }, ] } resp = live_service.update_referer(body) print(resp) ================================================ FILE: volcengine/example/live/example_relay_source/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_relay_source/example_delete_relay_source_v2.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DeleteRelaySourceRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DeleteRelaySourceRequest() req.Vhost = 'Vhost' req.App = 'App' print(req) resp = live_service.delete_relay_source_v2(req) print(resp) ================================================ FILE: volcengine/example/live/example_relay_source/example_describe_relay_source_v2.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeRelaySourceRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeRelaySourceRequest() req.Vhost = 'Vhost' print(req) resp = live_service.describe_relay_source_v2(req) print(resp) ================================================ FILE: volcengine/example/live/example_relay_source/example_update_relay_source_v2.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import UpdateRelaySourceRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('==') req = UpdateRelaySourceRequest() req.Vhost = 'Vhost' req.App = 'App' req.RelaySourceProtocol = 'RelaySourceProtocol' req.RelaySourceDomainList.extend(['RelaySourceDomainList']) print(req) resp = live_service.update_relay_source_v2(req) print(resp) ================================================ FILE: volcengine/example/live/example_snapshot/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_snapshot/example_create_snapshot_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "Status": 1, "Interval": 5, "Bucket": "", "SnapshotFormat": "jpeg", "SnapshotObject": "xx/xx", "StorageDir": "/xx", } resp = live_service.create_snapshot_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_snapshot/example_delete_snapshot_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "Preset": "", } resp = live_service.delete_snapshot_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_snapshot/example_describe_c_d_n_snapshot_history.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeCDNSnapshotHistoryRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeCDNSnapshotHistoryRequest() req.Vhost = 'Vhost' req.App = 'App' req.Stream = 'Stream' req.DateFrom = '2022-10-16T00:00:00+08:00' req.DateTo = '2022-10-21T23:59:59+08:00' req.Type = 'Type' req.PageNum = 0 req.PageSize = 0 print(req) resp = live_service.describe_c_d_n_snapshot_history(req) print(resp) ================================================ FILE: volcengine/example/live/example_snapshot/example_list_vhost_snapshot_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", } resp = live_service.list_vhost_snapshot_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_snapshot/example_update_snapshot_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "Preset": "", "Status": 1, "Interval": 5, "Bucket": "", "SnapshotFormat": "jpeg", "SnapshotObject": "xx/xx", "StorageDir": "/xx", } resp = live_service.update_snapshot_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_stream/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_stream/example_describe_closed_stream_info_by_page.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeClosedStreamInfoByPageRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeClosedStreamInfoByPageRequest() req.Vhost = 'Vhost' req.PageNum = 0 req.PageSize = 0 print(req) resp = live_service.describe_closed_stream_info_by_page(req) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_describe_forbidden_stream_info_by_page.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeForbiddenStreamInfoByPageRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeForbiddenStreamInfoByPageRequest() req.PageNum = 0 req.PageSize = 0 req.App = 'App' req.Stream = 'Stream' print(req) resp = live_service.describe_forbidden_stream_info_by_page(req) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_describe_live_stream_info_by_page.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeLiveStreamInfoByPageRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeLiveStreamInfoByPageRequest() req.Vhost = 'Vhost' req.PageNum = 0 req.PageSize = 0 print(req) resp = live_service.describe_live_stream_info_by_page(req) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_describe_live_stream_state.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeLiveStreamStateRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeLiveStreamStateRequest() req.Vhost = 'Vhost' req.App = 'App' req.Stream = 'Stream' print(req) resp = live_service.describe_live_stream_state(req) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_forbid_stream.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "domain", "App": "app", "Stream": "stream", } resp = live_service.forbid_stream(body) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_kill_stream.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import KillStreamRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = KillStreamRequest() req.Vhost = 'Vhost' req.App = 'App' req.Stream = 'Stream' print(req) resp = live_service.kill_stream(req) print(resp) ================================================ FILE: volcengine/example/live/example_stream/example_resume_stream.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Domain": "", "App": "", "Stream": "", } resp = live_service.resume_stream(body) print(resp) ================================================ FILE: volcengine/example/live/example_transcode/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_transcode/example_create_transcode_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "status": 1, "SuffixName": "", "Preset": "", "FPS": 30, } resp = live_service.create_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_transcode/example_delete_transcode_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "Preset": "", } resp = live_service.delete_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_transcode/example_list_common_trans_preset_detail.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "PresetList": ["Preset1", "Preset2"], } resp = live_service.list_common_trans_preset_detail(body) print(resp) ================================================ FILE: volcengine/example/live/example_transcode/example_list_vhost_transcode_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", } resp = live_service.list_vhost_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_transcode/example_update_transcode_preset.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() ak = "" sk = "" live_service.set_ak(ak) live_service.set_sk(sk) body = { "Vhost": "", "App": "", "status": 1, "SuffixName": "", "Preset": "", "FPS": 60, } resp = live_service.update_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/example_usage/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_usage/describe_live_batch_push_stream_metrics.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') body = { "Domain": "your domain", "App": "your app", "Stream": "your stream", "StartTime": "2022-12-22T19:35:00+08:00", "EndTime": "2022-12-22T19:40:05+08:00", "Aggregation": 60 } resp = live_service.describe_live_batch_push_stream_metrics.py(body) print(resp) ================================================ FILE: volcengine/example/live/example_usage/describe_live_batch_source_stream_metrics.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') body = { "Domain": "your domain", "App": "your app", "Stream": "your stream", "StartTime": "2022-12-22T19:35:00+08:00", "EndTime": "2022-12-22T19:40:05+08:00", "Aggregation": 60 } resp = live_service.describe_live_batch_source_stream_metrics.py(body) print(resp) ================================================ FILE: volcengine/example/live/example_vqs_task/__init__.py ================================================ ================================================ FILE: volcengine/example/live/example_vqs_task/example_create_v_q_score_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import CreateVQScoreTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = CreateVQScoreTaskRequest() req.MainAddr = '' req.ContrastAddr = '' req.FrameInterval = 0 req.Duration = 700 req.Algorithm = '' print(req.__dict__) resp = live_service.create_v_q_score_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_vqs_task/example_describe_v_q_score_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.request_live_pb2 import DescribeVQScoreTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = DescribeVQScoreTaskRequest() req.ID = 'ID' print(req) resp = live_service.describe_v_q_score_task(req) print(resp) ================================================ FILE: volcengine/example/live/example_vqs_task/example_list_v_q_score_task.py ================================================ # coding:utf-8 import json from volcengine.live.LiveService import LiveService from volcengine.live.models.request.live_requests import ListVQScoreTaskRequest if __name__ == '__main__': live_service = LiveService() live_service.set_ak('') live_service.set_sk('') req = ListVQScoreTaskRequest() req.StartTime = '' req.EndTime = '' # req.PageNum = 0 # req.PageSize = 0 req.Status = 0 print(req) resp = live_service.list_v_q_score_task(req) print(resp) ================================================ FILE: volcengine/example/live/v20230101/BindCertExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.bind_cert(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/BindEncryptDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.bind_encrypt_drm(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ContinuePullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.continue_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateCarouselTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_carousel_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateCertExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_cert(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateCloudMixTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_cloud_mix_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateDomainExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_domain(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateDomainV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_domain_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateHighLightTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_high_light_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateLivePadPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_live_pad_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateLiveStreamRecordIndexFilesExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_live_stream_record_index_files(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateLiveVideoQualityAnalysisTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_live_video_quality_analysis_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreatePullRecordTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_pull_record_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreatePullToPushGroupExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_pull_to_push_group(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreatePullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateRecordPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_record_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateRelaySourceV4Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_relay_source_v4(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateSnapshotAuditPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateSnapshotPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_snapshot_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateSubtitleTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_subtitle_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateTimeShiftPresetV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_time_shift_preset_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateWatermarkPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_watermark_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/CreateWatermarkPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.create_watermark_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteCallbackExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_callback(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteCarouselTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_carousel_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteCertExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_cert(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteCloudMixTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_cloud_mix_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteDomainExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_domain(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteHTTPHeaderConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_http_header_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteIPAccessRuleExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_ip_access_rule(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteLivePadPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_live_pad_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteLiveVideoQualityAnalysisTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_live_video_quality_analysis_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeletePullToPushGroupExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_pull_to_push_group(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeletePullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteRecordPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_record_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteRefererExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_referer(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteRelaySourceV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_relay_source_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteRelaySourceV4Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_relay_source_v4(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteSnapshotAuditPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteSnapshotPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_snapshot_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteStreamQuotaConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_stream_quota_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteSubtitleTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_subtitle_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteTaskByAccountIDExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_task_by_account_id(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteTimeShiftPresetV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_time_shift_preset_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteWatermarkPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_watermark_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DeleteWatermarkPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.delete_watermark_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeAuthExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_auth(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeCDNSnapshotHistoryExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_cdn_snapshot_history(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeCallbackExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_callback(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeCertDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_cert_drm(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeCertDetailSecretV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_cert_detail_secret_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeClosedStreamInfoByPageExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_closed_stream_info_by_page(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeDomainExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_domain(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeEncryptDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.describe_encrypt_drm() print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeEncryptHLSExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.describe_encrypt_hls() print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeForbiddenStreamGroupByPageExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_forbidden_stream_group_by_page(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeForbiddenStreamInfoByPageExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_forbidden_stream_info_by_page(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeHTTPHeaderConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_http_header_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeHighLightTaskByAccountIDExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_high_light_task_by_account_id(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeIPAccessRuleExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_ip_access_rule(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeIpInfoExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_ip_info(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLicenseDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_license_drm(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveAuditDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_audit_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_bandwidth_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchPushStreamAvgMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_push_stream_avg_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchPushStreamMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_push_stream_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchSourceStreamAvgMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_source_stream_avg_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchSourceStreamMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_source_stream_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchStreamSessionDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_stream_session_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchStreamTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_stream_traffic_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveBatchStreamTranscodeDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_batch_stream_transcode_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveCallbackDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_callback_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveEdgeStatDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_edge_stat_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveISPDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.describe_live_isp_data() print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveLogDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_log_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveMetricBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_metric_bandwidth_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveMetricTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_metric_traffic_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveP95PeakBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_p95_peak_bandwidth_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePadPresetDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_pad_preset_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePadStreamListExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_pad_stream_list(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePlayStatusCodeDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_play_status_code_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePullToPushBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_pull_to_push_bandwidth_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePullToPushDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_pull_to_push_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePushStreamCountDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_push_stream_count_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePushStreamInfoDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_push_stream_info_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLivePushStreamMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_push_stream_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveRecordDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_record_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveRegionDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.describe_live_region_data() print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveSnapshotDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_snapshot_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveSourceBandwidthDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_source_bandwidth_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveSourceStreamMetricsExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_source_stream_metrics(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveSourceTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_source_traffic_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveStreamCountDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_stream_count_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveStreamGroupByPageExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_stream_group_by_page(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveStreamInfoByPageExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_live_stream_info_by_page(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveStreamSessionDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_stream_session_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveStreamStateExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.describe_live_stream_state(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveTimeShiftDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_time_shift_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveTopPlayDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_top_play_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveTrafficDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_traffic_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveTranscodeDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_transcode_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeLiveTranscodeInfoDataExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_live_transcode_info_data(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeRecordTaskFileHistoryExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_record_task_file_history(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeRefererExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_referer(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeRelaySourceV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_relay_source_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DescribeStreamQuotaConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.describe_stream_quota_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/DisableDomainExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.disable_domain(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/EnableDomainExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.enable_domain(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/EnableHTTPHeaderConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.enable_http_header_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ForbidStreamExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.forbid_stream(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GeneratePlayURLExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.generate_play_url(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GeneratePushURLExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.generate_push_url(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetCarouselDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_carousel_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetCloudMixTaskDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_cloud_mix_task_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetHLSEncryptDataKeyExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.get_hls_encrypt_data_key(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetLiveVideoQualityAnalysisTaskDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_live_video_quality_analysis_task_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetPullRecordTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_pull_record_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetSpeechConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') resp = service.get_speech_config() print(resp) ================================================ FILE: volcengine/example/live/v20230101/GetSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.get_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/KillStreamExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.kill_stream(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListBindEncryptDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_bind_encrypt_drm(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListCarouselTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_carousel_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListCertV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_cert_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListCloudMixTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_cloud_mix_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListCommonTransPresetDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_common_trans_preset_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListDomainDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_domain_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListHighLightTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_high_light_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListLiveVideoQualityAnalysisTasksExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_live_video_quality_analysis_tasks(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListPullRecordTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_pull_record_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListPullToPushGroupExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_pull_to_push_group(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListPullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.list_pull_to_push_task(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListPullToPushTaskV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_pull_to_push_task_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListRelaySourceV4Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_relay_source_v4(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListTimeShiftPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_time_shift_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostRecordPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_record_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostSnapshotAuditPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostSnapshotPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_snapshot_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostSubtitleTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_subtitle_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostTransCodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_trans_code_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListVhostWatermarkPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_vhost_watermark_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListWatermarkPresetDetailExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_watermark_preset_detail(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ListWatermarkPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.list_watermark_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/RelaunchPullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.relaunch_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/RestartSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.restart_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/RestartTranscodingJobExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.restart_transcoding_job(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/ResumeStreamExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.resume_stream(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/SearchSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.search_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/StopLivePadStreamExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.stop_live_pad_stream(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/StopPullRecordTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.stop_pull_record_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/StopPullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.stop_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/TranscodingJobStatusExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') query = {} resp = service.transcoding_job_status(query) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UnBindEncryptDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.un_bind_encrypt_drm(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UnbindCertExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.unbind_cert(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateAuthKeyExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_auth_key(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateCallbackExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_callback(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateCarouselTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_carousel_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateCloudMixTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_cloud_mix_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateDomainVhostExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_domain_vhost(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateEncryptDRMExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_encrypt_drm(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateEncryptHLSExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_encrypt_hls(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateHTTPHeaderConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_http_header_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateIPAccessRuleExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_ip_access_rule(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateLivePadPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_live_pad_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdatePullToPushGroupExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_pull_to_push_group(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdatePullToPushTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_pull_to_push_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateRecordPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_record_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateRefererExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_referer(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateRelaySourceV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_relay_source_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateRelaySourceV4Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_relay_source_v4(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateSnapshotAuditPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_snapshot_audit_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateSnapshotPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_snapshot_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateSpeechTaskExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_speech_task(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateStreamQuotaConfigExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_stream_quota_config(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateSubtitleTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_subtitle_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateTimeShiftPresetV3Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_time_shift_preset_v3(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateTranscodePresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_transcode_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateWatermarkPresetExample.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_watermark_preset(body) print(resp) ================================================ FILE: volcengine/example/live/v20230101/UpdateWatermarkPresetV2Example.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_service import LiveService if __name__ == '__main__': service = LiveService() # call below method if you dont set ak and sk in $HOME/.volc/config service.set_ak('ak') service.set_sk('sk') body = {} resp = service.update_watermark_preset_v2(body) print(resp) ================================================ FILE: volcengine/example/livesaas/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_client_sdk/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_client_sdk/example_get_sdk_token_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "Mode": 1, "Nickname": "", #当Mode为2时为必传 "UserIdStr": "", #当Mode为2时为必传 } resp = livesaasService.get_sdk_token_api(body) # resp = await livesaasService.async_get_sdk_token_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_comment/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_comment/example_delete_chat_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "ChatId": 1 } resp = livesaasService.delete_chat_api(body) # resp = await livesaasService.async_delete_chat_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_comment/example_presenter_chat_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "Comment": "test" } resp = livesaasService.presenter_chat_api(body) # resp = await livesaasService.async_presenter_chat_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_admin/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_live_admin/example_create_activity_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { 'Name': "test", 'LiveTime': 1628067360, 'CoverImage': "", 'IsReplayAutoOnlineEnable': 1, 'IsWatermark': 0, 'ProtectModeCode': "", 'ViewUrlPath': "", 'TemplateId': 0 } resp = livesaasService.create_activity_api(body) # resp = await livesaasService.async_create_activity_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_admin/example_delete_activity_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { 'ActivityId': 1, } resp = livesaasService.delete_activity_api(body) # resp = await livesaasService.async_delete_activity_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_admin/example_list_activity_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') params = { 'IsNeedTotalCount': "True", 'PageNo': 1, 'PageItemCount': 10, 'Name': "", 'Status': 0, 'LiveTime': 0, 'IsLockPreview': 0 } resp = livesaasService.list_activity_api(params) # resp = await livesaasService.async_list_activity_api(params) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_live_control/example_get_activity_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') params = { 'ActivityId': 1 } resp = livesaasService.get_activity_api(params) # resp = await livesaasService.async_get_activity_api(params) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_get_activity_basic_config_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') params = { "ActivityId": 1 } resp = livesaasService.get_activity_basic_config_api(params) # resp = await livesaasService.async_get_activity_basic_config_api(params) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_get_streams_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') params = { 'ActivityId': 1 } resp = livesaasService.get_streams_api(params) # resp = await livesaasService.async_get_streams_api(params) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_update_activity_basic_config_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "Name": "test", "LiveTime": 1628130120, "IsCoverImageEnable": 1, "CoverImageUrl": "", "CoverImageUrlDefault": "", "IsPcBackImageEnable": 1, "PcBackImageUrl": "", "PcBackImageUrlDefault": "", "IsMobileBackImageEnable": 1, "MobileBackImageUrl": "", "MobileBackImageUrlDefault": "", "IsPreviewVideoEnable": 0, "PreviewVideoUrl": "", "PreviewVideoVid": "", "PreviewVideoVidDefault": "", "IsPeopleCountEnable": 0, "IsHeaderImageEnable": 0, "HeaderImageUrl": "", "IsWatermarkImageEnable": 0, "WatermarkImageUrl": "", "IsThumbUpEnable": 0, "ThumbUpUrl": "", "ThumbUpUrlDefault": "", "IsShareIconEnable": 0, "ShareIconUrl": "", "ShareIconUrlDefault": "", "IsCommentTranslateEnable": 0, "Announcement": "", "IsAnnouncementEnable": 0, "BackgroundColor": "", "InteractionColor": "", "FontColor": "", "ColorThemeIndex": "", "IsPCHeaderImageEnable": 0, "PCHeaderImageUrl": "", "IsCountdownEnable": 0, "IsAutoStartEnable": 0, "IsPageLimitEnable": 0, "PageLimitType": "", "IsLanguageEnable": 0, "LanguageType": [], "SiteTags": [{ "Index": 1, "Value": "", "DbIndex": 1, "Show": 0, "Name": "" }, { "Index": 2, "Value": "", "DbIndex": 3, "Show": 0, "Name": "" }, { "Index": 3, "Value": "", "DbIndex": 2, "Show": 0, "Name": "" }], "AutoStartType": 0, "IsPlayerTopEnable": 0, "PlayerTopType": [], "IsReplayAutoOnlineEnable": 1, "PreviewVideoId": 0, "AccountId": 0, "PreviewVideoReviewStatus": 0, "DefaultSubtitleLanguage": "", "SourceSubtitleLanguage": "", "OpenLiveAvextractorTask": 0, "IsTimeShift": 0, "PreviewVideoCoverImage": "", "PreviewVideoMediaName": "", "IsPreviewPromptEnable": 1, "PreviewPrompt": "直播即将开始,请稍候", "IsReservationEnable": 0, "ReservationTime": 0, "ReservationText": "", "WatermarkPosition": 0, "IsReplayBulletChat": 0, "PresenterChatColor": "", "IsLiveBulletChat": 0, "IsBackgroundBlur": 0, "FeedbackMessage": "", "IsFeedbackEnable": 0, "IsThumbUpNumberEnable": 1 } resp = livesaasService.update_activity_basic_config_api(body) # resp = await livesaasService.async_update_activity_basic_config_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_update_activity_status_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { 'ActivityId': 1, 'IsStreamViewEnable': 3, } resp = livesaasService.update_activity_status_api(body) # resp = await livesaasService.async_update_activity_status_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_update_loop_video_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "LineId": 1, "LoopNumber": 1, "IsShowProgram": 0, "LoopVideo": [{ "VideoCoverImage": "", "VideoName": "test.mp4", "VideoVid": "", "Index": 1 }] } resp = livesaasService.update_loop_video_api(body) # resp = await livesaasService.async_update_loop_video_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_update_loop_video_status_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "IsStartLoopVideo": 1, "LineId": 1 } resp = livesaasService.update_loop_video_status_api(body) # resp = await livesaasService.async_update_loop_video_status_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_live_control/example_update_pull_to_push_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { 'ActivityId': 1, 'LineId': 0, 'PullStreamUrl': "", 'PullStreamStatus': 1, 'PullStreamMode': 0, 'PullStreamLineId': 0, 'PullStreamMainBackupMode': 0 } resp = livesaasService.update_pull_to_push_api(body) # resp = await livesaasService.async_update_pull_to_push_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_replay_admin/__init__.py ================================================ ================================================ FILE: volcengine/example/livesaas/example_replay_admin/example_list_medias_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') params = { "ActivityId": 1, "IsNeedTotalCount": "True", "PageNo": 1, "PageItemCount": 10, "Name": "", "Vid": "" } resp = livesaasService.list_medias_api(params) # resp = await livesaasService.async_list_medias_api(params) print(resp) ================================================ FILE: volcengine/example/livesaas/example_replay_admin/example_update_media_online_status_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "MediaId": 1, "OnlineStatus": 2 } resp = livesaasService.update_media_online_status_api(body) # resp = await livesaasService.async_update_media_online_status_api(body) print(resp) ================================================ FILE: volcengine/example/livesaas/example_replay_admin/example_upload_replay_api.py ================================================ from volcengine.livesaas.LivesaasService import LivesaasService if __name__ == '__main__': livesaasService = LivesaasService() # call below method if you dont set ak and sk in $HOME/.volc/config livesaasService.set_ak('AK') livesaasService.set_sk('SK') body = { "ActivityId": 1, "Media": { "Name": "test", "Vid": "" } } resp = livesaasService.upload_replay_api(body) # resp = await livesaasService.async_upload_replay_api(body) print(resp) ================================================ FILE: volcengine/example/maas/__init__.py ================================================ ================================================ FILE: volcengine/example/maas/example_chat.py ================================================ import os from volcengine.maas import MaasService, MaasException, ChatRole def test_chat(maas, req): try: resp = maas.chat(req) print(resp) print(resp.choice.message.content) except MaasException as e: print(e) def test_stream_chat(maas, req): try: resps = maas.stream_chat(req) for resp in resps: print(resp) print(resp.choice.message.content) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # chat req = { "model": { "name": "${YOUR_MODEL_NAME}" }, "parameters": { "max_new_tokens": 2000, "temperature": 0.8 }, "messages": [ { "role": ChatRole.USER, "content": "天为什么这么蓝?" }, { "role": ChatRole.ASSISTANT, "content": "因为有你" }, { "role": ChatRole.USER, "content": "花儿为什么这么香?" }, ] } test_chat(maas, req) test_stream_chat(maas, req) ================================================ FILE: volcengine/example/maas/example_classification.py ================================================ import os from volcengine.maas import MaasService, MaasException def test_classification(maas, req): try: resp = maas.classification(req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # classification classificationReq = { "model": { "name": "${YOUR_MODEL_NAME}" }, "query": "花儿为什么这么香?", "labels": ["陈述句", "疑问句", "肯定句"], } test_classification(maas, classificationReq) ================================================ FILE: volcengine/example/maas/example_embeddings.py ================================================ import os from volcengine.maas import MaasService, MaasException def test_embeddings(maas, req): try: resp = maas.embeddings(req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # embeddings embeddingsReq = { "model": { "name": "${YOUR_MODEL_NAME}" }, "input": [ "天很蓝", "海很深" ] } test_embeddings(maas, embeddingsReq) ================================================ FILE: volcengine/example/maas/example_function_call.py ================================================ import os from volcengine.maas import MaasService, MaasException, ChatRole def test_function_call(maas: MaasService): req = { "model": {"name": "${YOUR_MODEL_NAME}"}, "messages": [ {"role": ChatRole.SYSTEM, "content": "如未特殊说明,用户下班时间为下午6点。"}, { "role": ChatRole.SYSTEM, "content": "用户ID全部用<>表示,文档ID全部用<>表示,其中N表示序号1,2,3...", }, {"role": ChatRole.USER, "content": "播放陈奕迅的十年"}, ], "parameters": {"temperature": 0.8, "max_new_tokens": 512}, "functions": [ { "name": "EntitySearchTool", "description": "当用户需要查询办公场景相关实体使用此函数,查询输入的实体对应的信息,实体包括:消息,邮件,文档,待办事项。用户问题里面有id信息优先提取id作为检索条件", "parameters": { "properties": { "query": {"description": "表示用户输入查询实体", "type": "string"} }, "required": ["query"], "type": "object", }, "examples": ['{"query": "最近3天看过的文档"}'], }, { "name": "EntityUnderstandTool", "description": "当用户需要对办公实体操作时使用此函数,实体包括:消息,邮件,代办事项", "parameters": { "properties": { "entity": {"description": "表示实体对应的id", "type": "string"}, "operation": { "description": "表示任务名称,取值有:总结、校对、提取待办事项", "type": "string", }, }, "required": ["operation", "entity"], "type": "object", }, "examples": ['{"operation": "总结", "entity": "<>"}'], }, { "name": "BookMeetingTool", "description": "当用户需要预订会议时使用此函数,根据输入的信息解析出会议主题,参会人,会议时间,并预订会议。如果用户没有指定会议开始时间,则取当前系统时间。如果用户没有指定会议结束时间,会议时长默认为1小时结束", "parameters": { "properties": { "end_time": {"description": "表示会议结束时间", "type": "string"}, "participant_ids": { "description": "表示参会人id集合,用;隔开,必须有用户本人的id", "type": "string", }, "start_time": {"description": "表示会议开始时间", "type": "string"}, "timezone": { "default": "Asia/Shanghai", "description": "表示会议所在时区", "type": "string", }, "topic": { "default": "", "description": "表示预订会议的主题", "type": "string", }, }, "required": ["participant_ids", "start_time", "end_time"], "type": "object", }, "examples": [ '{"topic": "今天下午5点跟小周周会日程", "participant_ids": "<>;<>", "start_time": "2023-07-18T17:00:00", "end_time": "2023-07-18T18:00:00", "timezone": "Asia/Shanghai"}' ], }, { "name": "CodeExecutorPlugin", "description": "当用户需要执行代码的时候使用此函数,支持go,js,java,python,rust,php,kotlin,dart,c,cpp,c#等编程语言", "parameters": { "properties": { "code": {"type": "string"}, "language": {"type": "string"}, }, "required": ["language", "code"], "type": "object", }, "examples": [ '{"language": "python3", "code": "print(\'hello word\')"}' ], }, { "name": "MusicPlayer", "description": "歌曲查询Plugin,当用户需要搜索某个歌手或者歌曲时使用此plugin,给定歌手,歌名等特征返回相关音乐", "parameters": { "properties": { "artist": {"description": "表示歌手名字", "type": "string"}, "description": {"description": "表示描述信息", "type": "string"}, "song_name": {"description": "表示歌曲名字", "type": "string"}, }, "required": [], "type": "object", }, "examples": ['{"artist":"孙燕姿","song_name":"遇见","description":""}'], }, ], } try: resp = maas.chat(req) print(resp) print(resp.choice.message.content) req["messages"].append( { "role": resp.choice.message.role, "content": resp.choice.message.content, "name": resp.choice.message.name, "function_call": { "name": resp.choice.message.function_call.name, "arguments": resp.choice.message.function_call.arguments, }, } ) if resp.choice.message.function_call.name != "": # Note: 用户必须要首先验证模型输出的 function name 和 argument 是否合法 # 1. Name 不一定是 prompt 给出的 function name; # 2. Arguments 不一定是合法的 json; # 3. Arguments 即使是合法的 json,也不一定满足 function 的 Parameters 规范。 function_resp = "通过汽水音乐,为您找到:\n| 歌手 | 歌名 |\n| --- | --- |\n| 陈奕迅 | 十年 (OT: 明年今日) |\n| 陈奕迅 | 富士山下 |\n| 陈奕迅 | 最佳损友 |" req["messages"].append( { "role": ChatRole.FUNCTION, "content": function_resp, "name": resp.choice.message.function_call.name, } ) else: # 模型输出的内容可能不是 function call,继续对话即可 user_input = "播放肖斯塔科维奇最伟大的作品" req["messages"].append( { "role": ChatRole.USER, "content": user_input, } ) resp = maas.chat(req) print(resp) print(resp.choice.message.content) except MaasException as e: print(e) if __name__ == "__main__": maas = MaasService("maas-api.ml-platform-cn-beijing.volces.com", "cn-beijing") maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) test_function_call(maas) ================================================ FILE: volcengine/example/maas/example_plugin.py ================================================ import os from volcengine.maas import MaasService, MaasException, ChatRole def test_chat(maas, req): try: resp = maas.chat(req) print(resp) except MaasException as e: print(e) if __name__ == "__main__": maas = MaasService("maas-api.ml-platform-cn-beijing.volces.com", "cn-beijing") maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" req = { "model": {"name": "${YOUR_MODEL_NAME}"}, "parameters": {"max_new_tokens": 2000, "temperature": 0.8}, "messages": [ {"role": ChatRole.USER, "content": "说一说这周发生的新鲜事儿"}, ], "plugins": ["browsing"], } test_chat(maas, req) ================================================ FILE: volcengine/example/maas/example_tokenize.py ================================================ import os from volcengine.maas import MaasService, MaasException def test_tokenize(maas, req): try: resp = maas.tokenize(req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # tokenize tokenizeReq = { "model": { "name": "${YOUR_MODEL_NAME}" }, "text": "花儿为什么这么香?", } test_tokenize(maas, tokenizeReq) ================================================ FILE: volcengine/example/maas/text_privatization/example_text_privatization.py ================================================ from volcengine.maas.text_privatization import ClsPrivConf from volcengine.maas.text_privatization import make_privatizer from volcengine.maas.text_privatization import get_bottom_model if __name__ == '__main__': # Prepare your tokenizer and embedding model. You can use the `get_bottom_model` method to get the # tokenizer and embedding module of an open source pre-trained model from hugging face. your_tokenizer, your_embedding_model = get_bottom_model(model_id="MODEL_ID") # Initialize a text privatizer instance text_privatizer = make_privatizer(task_type="classification", priv_conf=ClsPrivConf(priv_level="3")) # Load tokenizer and embedding model text_privatizer.load_tokenizer_embedding(tokenizer=your_tokenizer, embedding_model=your_embedding_model) # Given the training data path, use the `fit` method to perform text privatization. text_privatizer.fit(train_path="PATH/TO/DATA.jsonl") # Save text_privatizer.save(out_dir="PATH/TO/SAVE") ================================================ FILE: volcengine/example/maas/v2/__init__.py ================================================ ================================================ FILE: volcengine/example/maas/v2/audio/__init__.py ================================================ ================================================ FILE: volcengine/example/maas/v2/audio/example_speech.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_speech(maas: MaasService, endpoint_id, req, file): request_id = "" try: resp = maas.audio.speech.create(endpoint_id, req) request_id = resp.request_id resp.stream_to_file(file) print(f"request_id: {request_id}") print("finish create audio file.") except MaasException as e: print(f"request_id: {request_id}") print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) req = { "input": "你好欢迎光临", "voice": "zh_male_rap", "response_format": "mp3", "speed": 1.0 } endpoint_id = "{YOUR_ENDPOINT_ID}" file = "{YOUR_LOCAL_FILE}" test_speech(maas, endpoint_id, req, file) ================================================ FILE: volcengine/example/maas/v2/example_chat_v2.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException, ChatRole def test_chat(maas, endpoint_id, req): try: resp = maas.chat(endpoint_id, req) print(resp) except MaasException as e: print(e) def test_stream_chat(maas, endpoint_id, req): try: resps = maas.stream_chat(endpoint_id, req) for resp in resps: print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # chat req = { "parameters": { "max_new_tokens": 2000, "temperature": 0.8 }, "messages": [ { "role": ChatRole.USER, "content": "天为什么这么蓝" }, { "role": ChatRole.ASSISTANT, "content": "因为有你" }, { "role": ChatRole.USER, "content": "花儿为什么这么香?" }, ] } endpoint_id = "{YOUR_ENDPOINT_ID}" test_chat(maas, endpoint_id, req) test_stream_chat(maas, endpoint_id, req) # ================================================ FILE: volcengine/example/maas/v2/example_chat_with_apikey_v2.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException, ChatRole def test_chat(maas, endpoint_id, req): try: resp = maas.chat(endpoint_id, req) print(resp) print(type(resp)) except MaasException as e: print(e) def test_stream_chat(maas, endpoint_id, req): try: resps = maas.stream_chat(endpoint_id, req) for resp in resps: print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') apikey = "{YOUR_APIKEY}" maas.set_apikey(apikey) # document: "https://www.volcengine.com/docs/82379/1099475" # chat req = { "parameters": { "max_new_tokens": 2000, "temperature": 0.8 }, "messages": [ { "role": ChatRole.USER, "content": "天为什么这么蓝" }, { "role": ChatRole.ASSISTANT, "content": "因为有你" }, { "role": ChatRole.USER, "content": "花儿为什么这么香?" }, ] } endpoint_id = "{YOUR_ENDPOINT_ID}" test_chat(maas, endpoint_id, req) test_stream_chat(maas, endpoint_id, req) ================================================ FILE: volcengine/example/maas/v2/example_classification_v2.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_classification(maas, endpoint_id, req): try: resp = maas.classification(endpoint_id, req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # classification classificationReq = { "query": "花儿为什么这么香?", "labels": ["陈述句", "疑问句", "肯定句"], } endpoint_id = "{YOUR_ENDPOINT_ID}" test_classification(maas, endpoint_id, classificationReq) ================================================ FILE: volcengine/example/maas/v2/example_embeddings_v2.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_embeddings(maas, endpoint_id, req): try: resp = maas.embeddings(endpoint_id, req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # embeddings embeddingsReq = { "input": [ "天很蓝", "海很深" ] } endpoint_id = "{YOUR_ENDPOINT_ID}" test_embeddings(maas, endpoint_id, embeddingsReq) ================================================ FILE: volcengine/example/maas/v2/example_tokenize_v2.py ================================================ import os from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_tokenize(maas, endpoint_id, req): try: resp = maas.tokenize(endpoint_id, req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) # document: "https://www.volcengine.com/docs/82379/1099475" # tokenize tokenizeReq = { "text": "花儿为什么这么香?", } endpoint_id = "{YOUR_ENDPOINT_ID}" test_tokenize(maas, endpoint_id, tokenizeReq) ================================================ FILE: volcengine/example/maas/v2/image/__init__.py ================================================ ================================================ FILE: volcengine/example/maas/v2/image/example_images_flex_gen.py ================================================ import os import base64 from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_images_flex_gen(maas, endpoint_id, req): try: resp = maas.images.flex_gen(endpoint_id, req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) with open("{YOUR_CONTROL_PICTURE_PATH}", "rb") as file: controlImage = base64.b64encode(file.read()).decode('utf-8') req = { "prompt": "(sfw:1.0),(masterpiece,best quality,ultra highres),(realistic:1.15),(3D:1.0)", "negative_prompt": "(embedding:EasyNegative:0.9),(embedding:badhandv4:1.3),terrible,injured,(nsfw:1.0),(nude:1.0)", "control_image_list": [controlImage], "strength": 0.75, "height": 512, "width": 512, "num_inference_steps": 20, } endpoint_id = "{YOUR_ENDPOINT_ID}" test_images_flex_gen(maas, endpoint_id, req) ================================================ FILE: volcengine/example/maas/v2/image/example_images_quick_gen.py ================================================ import os import base64 from volcengine.maas.v2 import MaasService from volcengine.maas import MaasException def test_images_quick_gen(maas, endpoint_id, req): try: resp = maas.images.quick_gen(endpoint_id, req) print(resp) except MaasException as e: print(e) if __name__ == '__main__': maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing') maas.set_ak(os.getenv("VOLC_ACCESSKEY")) maas.set_sk(os.getenv("VOLC_SECRETKEY")) with open("{YOUR_CONTROL_PICTURE_PATH}", "rb") as file: controlImage = base64.b64encode(file.read()).decode('utf-8') req = { "prompt": "(sfw:1.0),(masterpiece,best quality,ultra highres),(realistic:1.15),(3D:1.0)", "negative_prompt": "(embedding:EasyNegative:0.9),(embedding:badhandv4:1.3),terrible,injured,(nsfw:1.0),(nude:1.0)", "control_image_list": [controlImage], "parameters": { "strength": 0.75, "height": 512, "width": 512, "num_inference_steps": 20, }, } endpoint_id = "{YOUR_ENDPOINT_ID}" test_images_quick_gen(maas, endpoint_id, req) ================================================ FILE: volcengine/example/nlp/__init__.py ================================================ #!/usr/bin/python # -*- coding: utf-8 -*- ================================================ FILE: volcengine/example/nlp/example_essay_auto_grade.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "grade": "junior", "question": "My Beloved Teacher", "essay": "Sara, who came from Canada is our English Oral teacher. She is loved and respected by many students. What impressed me the most is that she is warm-hearted, generous and easy-going. She always stays optimistic and tries hard to understand every of her student. Besides, she often tells us some interesting stories and jokes in class, so as to make a happy atmosphere for us to study English. She loves teaching so much and has the eagerness to devote her life to Chinese education. Because of her outstanding achievements, she had won lots of rewards, one of which is “Model Teacher”.", } resp = nlp_service.essay_auto_grade(form) print(resp) ================================================ FILE: volcengine/example/nlp/example_keyphrase_extraction_extract.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "request_type": "text", "title": "外交部:中方已同意并愿意安排欧盟及成员国驻华使节访问新疆", "content": "9月15日,外交部发言人汪文斌主持例行记者会。有记者提问,欧方表示,在9月14日举行的中德欧领导人视频会晤中双方谈及了人权、涉疆、香港等问题,欧方向中方表明了有关关切。中方对此有何评论?汪文斌表示,中方已就昨天举行的中德欧领导人会晤发布了详细的新闻稿。关于人权问题,习近平主席强调,世界上没有放之四海而皆准的人权发展道路,人权保障没有最好,只有更好。各国首先应该做好自己的事情。相信欧方能够解决好自身存在的人权问题。中方不接受人权“教师爷”、反对搞“双重标准”。中方愿同欧方本着相互尊重的原则加强交流,共同进步。会上还讨论了欧盟内部存在的人权问题,如难民问题久拖不决、人道主义危机屡屡上演,一些欧盟成员国种族主义、极端主义、少数族裔问题抬头,反犹太、反穆斯林、反黑人等言论和恶性事件频频发生等等。欧方坦承自身存在的问题,希望同中方本着平等和尊重的原则开展对话,增进相互了解,妥善处理差异和分歧。习近平主席还阐明了中方在涉港、涉疆问题上的原则立场,指出涉港、涉疆问题的实质是维护中国国家主权、安全和统一,保护各族人民安居乐业的权利。中方坚决反对任何人、任何势力在中国制造不稳定、分裂和动乱,坚决反对任何国家干涉中国内政。汪文斌指出,在涉疆问题上,我们一直欢迎包括欧方在内的各国朋友去新疆走一走、看一看,了解新疆的真实情况,而不是道听途说,偏信那些刻意编造的谎言。欧盟及成员国驻华使节提出希望访问新疆,中方已经同意并愿作出安排。现在球在欧方一边。同时我要说明一点,我们反对有罪推定式的调查。" } resp = nlp_service.keyphrase_extraction_extract(form) print(resp) ================================================ FILE: volcengine/example/nlp/example_novel_correction.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() body = { "content": "好就不见" } resp = nlp_service.novel_correction(body) print(resp) ================================================ FILE: volcengine/example/nlp/example_sentiment_analysis.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() body = { "text": "我很生气" } resp = nlp_service.sentiment_analysis(body) print(resp) ================================================ FILE: volcengine/example/nlp/example_text_correction_en_correct.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "content": "This is a incomplte text test" } resp = nlp_service.text_correction_en_correct(form) print(resp) ================================================ FILE: volcengine/example/nlp/example_text_correction_zh_correct.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "content": "粉色露肩群活力亮相" } resp = nlp_service.text_correction_zh_correct(form) print(resp) ================================================ FILE: volcengine/example/nlp/example_text_summarization.py ================================================ # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "title": "汽车", "text": "例如会让部件磨损大,使得寿命降低,而且还带来动力降低,油耗越来越高,抖动大等。以前一箱油能跑380公里的,如今却只能跑到350了,无疑也增加了开车成本。", "max_len": 5 } resp = nlp_service.text_summarization(form) print(resp) ================================================ FILE: volcengine/example/rdspostgresql/__init__.py ================================================ ================================================ FILE: volcengine/example/rdspostgresql/example_create_instance.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.rdspostgresql.rdspostgresql import RdsPostgreSQL # test unit : "create_instance" "create_account" "create_white_list" "create_database" "modify_database_owner" test_unit = "create_instance" instanceID = "postgres-xxx" def test_create_instance(cls): params = { "Region": "cn-north-x", "Zone": "cn-north-x-a", "DBEngine": "PostgreSQL", "DBEngineVersion": "PostgreSQL_12", # PostgreSQL Version "PostgreSQL_12" "PostgreSQL_11" "InstanceType": "HA", # Primary isntance should be "HA" Readonly instance should be "Basic" "InstanceSpecName": "rds.postgres.1c2g", # 1c2g mean 1CPU and 2G Memory "StorageSpaceGB": 100, # storage(GB) "Number": 1, # instance number "StorageType": "LocalSSD", # storage type should be "LocalSSD" "VpcID": "vpc-xxx", "ChargeType": "PostPaid", # ChargeType currently should be "PostPaid" "InstanceCategory": "Primary", # Primary instance type should be "Primary", readonly instance should be "ReadOnly" "RequestSource": "OpenAPI" } print(cls.create_instance(params)) def test_create_account(cls): params = { "InstanceId": instanceID, "AccountName": "user004", "AccountPassword": "xxx", "AccountDesc": "", "AccountType": "Normal", # account type "Super" or "Normal" } print(cls.create_account(params)) def test_create_white_list(cls): params = { "InstanceId": instanceID, "GroupName": "hahaha", "IPList": ["1.1.1.2"], } print(cls.create_instance_white_list(params)) def test_create_database(cls): params = { "InstanceId": instanceID, "DBName": "db001", "CharacterSetName": "utf8", # CharacterSet "utf8" "latin1" or "ascii" "Collate": "CUTF8", # Collate "C" "CUTF8" or "EnUsUtf8" "Ctype": "CUTF8", # Ctype "C" "CUTF8" or "EnUsUtf8" "Owner": "user001", } print(cls.create_database(params)) def test_modify_database_owner(cls): params = { "InstanceId": instanceID, "DBName": "db001", "Owner": "user001", } print(cls.modify_database_owner(params)) if __name__ == '__main__': service = RdsPostgreSQL("cn-north-1") service.set_ak("Your AK") service.set_sk("Your SK") if test_unit == "create_instance": test_create_instance(service) elif test_unit == "create_account": test_create_account(service) elif test_unit == "create_white_list": test_create_white_list(service) elif test_unit == "create_database": test_create_database(service) elif test_unit == "modify_database_owner": test_modify_database_owner(service) ================================================ FILE: volcengine/example/rtc/RtcService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo class RtcService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(RtcService, "_instance"): with RtcService._instance_lock: if not hasattr(RtcService, "_instance"): RtcService._instance = object.__new__(cls) return RtcService._instance def __init__(self): self.service_info = RtcService.get_service_info() self.api_info = RtcService.get_api_info() super(RtcService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("rtc.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'rtc', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = { "StartRecord": ApiInfo("POST", "/", {"Action": "StartRecord", "Version": "2022-06-01"}, {}, {}), "StopRecord": ApiInfo("POST", "/", {"Action": "StopRecord", "Version": "2022-06-01"}, {}, {}), "GetRecordTask": ApiInfo("GET", "/", {"Action": "GetRecordTask", "Version": "2022-06-01"}, {}, {}), } return api_info def start_record(self, body): res = self.json("StartRecord", {}, body) if res == '': raise Exception("StartRecord: empty response") res_json = json.loads(res) return res_json def stop_record(self, body): res = self.json("StopRecord", {}, body) if res == '': raise Exception("StopRecord: empty response") res_json = json.loads(res) return res_json def get_record_task(self, params): res = self.get("GetRecordTask", params) if res == '': raise Exception("GetRecordTask: empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/example/rtc/__init__.py ================================================ ================================================ FILE: volcengine/example/rtc/example_get_record_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.example.rtc.RtcService import RtcService if __name__ == '__main__': # using your own AK and SK AK = 'Your_AK' SK = 'Your_SK' # Firstly , init an RTCService Class rtc_service = RtcService() # Then , Set your AK and SK rtc_service.set_ak(AK) rtc_service.set_sk(SK) # You can using this API now ! Here are some Examples params = dict() params['AppId'] = 'Your_AppId' params['RoomId'] = 'Your_RoomId' params['TaskId'] = 'Your_TaskId' resp = rtc_service.get_record_task(params) print(resp) ================================================ FILE: volcengine/example/rtc/example_start_record.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.example.rtc.RtcService import RtcService def set_encode(): encode = dict() encode['VideoWidth'] = 1920 encode['VideoHeight'] = 1080 encode['VideoFps'] = 15 encode['VideoBitrate'] = 4000 encode['VideoCodec'] = 0 encode['VideoGop'] = 4 encode['AudioCodec'] = 0 encode['AudioProfile'] = 0 encode['AudioBitrate'] = 64 encode['AudioSampleRate'] = 48000 encode['AudioChannels'] = 2 return encode def set_layout(): layout = dict() layout['LayoutMode'] = 0 return layout def set_control(): control = dict() control['MediaType'] = 0 control['FrameInterpolationMode'] = 0 control['MaxIdleTime'] = 180 control['MaxRecordTime'] = 0 return control def set_file_format_config(): config = dict() config['FileFormat'] = ['MP4'] return config def set_storage_config(): config = dict() config['Type'] = 0 config['TosConfig'] = set_tos_config() return config def set_tos_config(): config = dict() config['AccountId'] = 'Your_AccountId' config['Region'] = 0 config['Bucket'] = 'Your_Bucket' return config if __name__ == '__main__': # using your own AK and SK AK = 'Your_AK' SK = 'Your_SK' # Firstly , init an RTCService Class rtc_service = RtcService() # Then , Set your AK and SK rtc_service.set_ak(AK) rtc_service.set_sk(SK) # You can using this API now ! Here are some Examples body = dict() body['AppId'] = 'Your_AppId' body['BusinessId'] = 'Your_BusinessId' body['RoomId'] = 'Your_RoomId' body['TaskId'] = 'Your_TaskId' body['RecordMode'] = 0 body['Encode'] = set_encode() body['Layout'] = set_layout() body['Control'] = set_control() body['FileFormatConfig'] = set_file_format_config() body['StorageConfig'] = set_storage_config() body = json.dumps(body) resp = rtc_service.start_record(body) print(resp) ================================================ FILE: volcengine/example/rtc/example_stop_reocrd.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.example.rtc.RtcService import RtcService if __name__ == '__main__': # using your own AK and SK AK = 'Your_AK' SK = 'Your_SK' # Firstly , init an RTCService Class rtc_service = RtcService() # Then , Set your AK and SK rtc_service.set_ak(AK) rtc_service.set_sk(SK) # You can using this API now ! Here are some Examples body = dict() body['AppId'] = 'Your_AppId' body['BusinessId'] = 'Your_BusinessId' body['RoomId'] = 'Your_RoomId' body['TaskId'] = 'Your_TaskId' body = json.dumps(body) resp = rtc_service.stop_record(body) print(resp) ================================================ FILE: volcengine/example/sms/__init__.py ================================================ ================================================ FILE: volcengine/example/sms/example_apply_signature_ident.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host("sms-api.volcengineapi.com") body = { "purpose": 1, "materialName": "名称", "businessInfo": { "businessCertificateType": 1, "businessCertificate": { "fileContent": "data:image/jpg;base64,IPV*****************************************************************CYII=", "fileSuffix": "jpg", "fileType": 1, "fileUrl": "https://url", }, "businessCertificateName": "xx公司", "unifiedSocialCreditIdentifier": "Zf6m", "businessCertificateValidityPeriodStart": "2024-01-12", "businessCertificateValidityPeriodEnd": "2024-01-12", "legalPersonName": "陈xx", }, "operatorPerson": { "certificateType": 0, "personCertificate": [ { "fileContent": "data:image/jpg;base64,IPV*****************************************************************CYII=", "fileSuffix": "jpg", "fileType": 8, "fileUrl": "https://url", }, { "fileContent": "data:image/jpg;base64,IPV*****************************************************************CYII=", "fileSuffix": "jpg", "fileType": 9, "fileUrl": "https://url", }, ], "personName": "陈xx", "personIDCard": "41000000000", "personMobile": "13800000", }, "responsiblePersonInfo": { "certificateType": 0, "personCertificate": [ { "fileContent": "data:image/jpg;base64,IPV*****************************************************************CYII=", "fileSuffix": "jpg", "fileType": 10, "fileUrl": "https://url", }, { "fileContent": "data:image/jpg;base64,IPV*****************************************************************CYII=", "fileSuffix": "jpg", "fileType": 11, "fileUrl": "https://url", }, ], "personName": "陈xx", "personIDCard": "41000000000", "personMobile": "13800000", }, } resp = sms_service.apply_signature_ident(body) # { # "ResponseMetadata": { # "RequestId": "202404252055144D6C4FB9957172CF8034", # "Action": "BatchBindSignatureIdent", # "Version": "2021-01-11", # "Service": "volcSMS", # "Region": "cn-north-1" # }, # "Result": { # "id": 17, # } # } print(resp) ================================================ FILE: volcengine/example/sms/example_apply_sms_signature.py ================================================ # coding:utf-8 from __future__ import print_function import base64 import json from volcengine.const.Const import * from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # base64 encode func def to_base64_str(file): with open(file, 'rb') as fileObj: image_data = fileObj.read() return base64.b64encode(image_data).decode('utf-8') # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SubAccount": "subAccount", "Content": "content", "Desc": "description", "Source": "公司名称/公司缩写", "Domain": "网站域名", "UploadFileList": [{ "FileType": DOC_TYPE_THREE_IN_ONE, "FileContent": to_base64_str("图片.jpg"), "FileSuffix": "jpg" }], "Purpose": SIGN_PURPOSE_FOR_OWN, "SignatureIdentificationID": 12 } resp = sms_service.apply_sms_signature(body) print(resp) ================================================ FILE: volcengine/example/sms/example_apply_sms_signature_v2.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host("sms-api.volcengineapi.com") body = { "subAccount": "abc", "purpose": SIGN_PURPOSE_FOR_OWN, "source": SIGN_SOURCE_APP, "content": "测试签名", "desc": "000000", "domain": "000000", "signatureIdentificationID": 123, "appIcp": { "appIcpFilling": "APPICP测试备案", "appIcpFileList": [ { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_APP_ICP_CERTIFICATE } ] }, "trademark": { "trademarkCn": "商标中文", "trademarkEn": "english", "trademarkNumber": "商标注册号1", "trademarkFileList": [ { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_TRADEMARK_CERTIFICATE }, { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_TRADEMARK_CERTIFICATE } ] } } resp = sms_service.apply_signature_ident(body) print(resp) ================================================ FILE: volcengine/example/sms/example_apply_sms_template.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import * from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SubAccount": "subAccount", "Area": AREA_CN, "ChannelType": SMS_CHANNEL_TYPE_CN_MKT, "Content": "We're offering our xxxx community 20% off with code THANKYOU. It's our way of showing our " "appreciation to you for standing by us in this time. Shop Now: " "https://webhook.site/edd2b39a-6c8d-4161-a310-36a470c840d4 T退订", "Desc": "description", "Name": "template_name", "ShortUrlConfig": { "IsEnabled": ENABLE_STATUS_ENABLE, "IsNeedClickDetails": ENABLE_STATUS_NOT_ENABLE } } resp = sms_service.apply_sms_template(body) print(resp) ================================================ FILE: volcengine/example/sms/example_apply_vms_template.py ================================================ # coding:utf-8 from __future__ import print_function import base64 import json from volcengine.const.Const import * from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # base64 encode func def to_base64_str(file): with open(file, 'rb') as fileObj: image_data = fileObj.read() return base64.b64encode(image_data).decode('utf-8') # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') file_base64_string = to_base64_str("媒体文件路径") body = { "subAccount": "subAccount", "name": "SDK测试", "theme": "SDK测试视频短信", "signature": "签名", "channelType": "CN_VMS", "contents": [ { "sourceType": SOURCE_TYPE_TEXT, "content": "火山引擎,做企业好的伙伴" }, { # choose the midea type "sourceType": SOURCE_TYPE_IMAGE_GIF, "content": file_base64_string } ] } resp = sms_service.apply_vms_template(body) print(resp) ================================================ FILE: volcengine/example/sms/example_batch_bind_signature_ident.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host("sms-api.volcengineapi.com") body = {"subAccount": "cYyUq453", "signatures": ["签名1", "签名2"], "id": 123} resp = sms_service.batch_bind_signature_ident(body) # { # "ResponseMetadata": { # "RequestId": "202404252055144D6C4FB9957172CF8034", # "Action": "BatchBindSignatureIdent", # "Version": "2021-01-11", # "Service": "volcSMS", # "Region": "cn-north-1" # }, # "Result": { # "msg": "success", # } # } print(resp) ================================================ FILE: volcengine/example/sms/example_conversion.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "MessageIDs": ["testMsgId"] } resp = sms_service.conversion(body) print(resp) ================================================ FILE: volcengine/example/sms/example_delete_signature.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SubAccount": "subAccount", "Id": "id", "IsOrder": True } resp = sms_service.delete_signature(body) print(resp) ================================================ FILE: volcengine/example/sms/example_delete_sms_template.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import REGION_AP_SINGAPORE1 from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # oversea # sms_service = SmsService(REGION_AP_SINGAPORE1) # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "subAccount": "subAccount", "id": "id", "isOrder": True } resp = sms_service.delete_sms_template(body) print(resp) ================================================ FILE: volcengine/example/sms/example_get_signature_and_order_list.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import REGION_AP_SINGAPORE1, AREA_OVERSEAS from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') param = { "subAccount": "subAccount", "signature": "sign", "pageIndex": 1, "pageSize": 10 } resp = sms_service.get_signature_and_order_list(param) print(resp) ================================================ FILE: volcengine/example/sms/example_get_signature_ident_list.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host("sms-api.volcengineapi.com") body = {"ids": [1, 23], "pageIndex": 1, "pageSize": 15} resp = sms_service.get_signature_ident_list(body) # { # "ResponseMetadata": { # "RequestId": "202404252055144D6C4FB9957172CF8034", # "Action": "GetSignatureIdentList", # "Version": "2021-01-11", # "Service": "volcSMS", # "Region": "cn-north-1", # }, # "Result": { # "list": [ # { # "id": 953, # "purpose": 1, # "materialName": "name", # "businessCertificateName": "xx公司", # "operatorPersonName": "陈xx", # "responsiblePersonName": "陈xx", # "effectSignatures": ["签名"], # } # ], # "total": 1, # }, # } print(resp) ================================================ FILE: volcengine/example/sms/example_get_sms_send_details.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host('sms-api.volcengineapi.com') body = { "subAccount": "subAccount", "phoneNumber": "xxxxxx", "messageId": "", "sendDate": "20240424", "pageIndex": 1, "pageSize": 15 } resp = sms_service.get_sms_send_details(body) # { # "ResponseMetadata": { # "RequestId": "202404252055144D6C4FB9957172CF8034", # "Action": "GetSmsSendDetails", # "Version": "2021-01-11", # "Service": "volcSMS", # "Region": "cn-north-1" # }, # "Result": { # "account": "xxxxxxxx", # "sendDetailsResults": [ # { # "status": 3, # "errorCode": "0", # "errorMessage": "发送成功", # "phoneNumber": "152********", # "signature": "xx", # "templateID": "xxx", # "content": "xxxxxx", # "channelType": "CN_MKT", # "messageId": "xxxxxxxxxx", # "msgCount": 1, # "sendTime": 1713951918107, # "receiptTime": 1713951925706 # } # ], # "subAccount": "xxxxxx", # "total": 1 # } # } print(resp) ================================================ FILE: volcengine/example/sms/example_get_sms_template_and_order_list.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import AREA_CN from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') param = { "subAccount": "subAccount", "area": AREA_CN, "pageIndex": 1, "pageSize": 10 } resp = sms_service.get_sms_template_and_order_list(param) print(resp) ================================================ FILE: volcengine/example/sms/example_get_sub_account_detail.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import REGION_AP_SINGAPORE1 from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # sms_service.set_host('host') param = { "subAccount": "subAccount" } resp = sms_service.get_sub_account_detail(param) print(resp) ================================================ FILE: volcengine/example/sms/example_get_sub_account_list.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import REGION_AP_SINGAPORE1 from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # SmsService is no longer support SG endpoint # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') param = { "subAccountName": "", "pageIndex": 1, "pageSize": 1 } resp = sms_service.get_sub_account_list(param) print(resp) ================================================ FILE: volcengine/example/sms/example_insert_sms_sub_account.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "subAccountName": "smsAccount", "desc": "desc", } resp = sms_service.insert_sms_sub_account(body) print(resp) ================================================ FILE: volcengine/example/sms/example_send_batch_sms.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.const.Const import REGION_AP_SINGAPORE1 from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SmsAccount": "subAccount", "Sign": "signature", "From": "BytePlus", "TemplateID": "ST_xxx", "Messages": [{"TemplateParam": "{\"code\": \"1234\"}", "PhoneNumber": "+65xxxxxxxx"}], "Tag": "tag", } resp = sms_service.send_batch_sms(body) print(resp) ================================================ FILE: volcengine/example/sms/example_send_sms.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == '__main__': sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SmsAccount": "smsAccount", "Sign": "sign", "TemplateID": "ST_xxx", "TemplateParam": "{\"code\": \"1234\"}", "PhoneNumbers": "188xxxxxxxx", "Tag": "tag", } body = json.dumps(body) resp = sms_service.send_sms(body) print(resp) body = { "SmsAccount": "smsAccount", "Sign": "sign", "TemplateID": "ST_xxx", "PhoneNumber": "188xxxxxxxx", "CodeType": 6, "TryCount": 3, "ExpireTime": 240, "Scene": "Test" } body = json.dumps(body) resp = sms_service.send_sms_verify_code(body) print(resp) body = { "SmsAccount": "smsAccount", "PhoneNumber": "188xxxxxxxx", "Scene": "Test", "Code": "123456" } body = json.dumps(body) resp = sms_service.check_sms_verify_code(body) print(resp) ================================================ FILE: volcengine/example/sms/example_send_vms.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == '__main__': sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SmsAccount": "subAccount", "TemplateID": "templateId", # enable TemplateParam if there is template param in your template text content # "TemplateParam": "{\"code\": \"111\"}", "PhoneNumbers": "188********", "Tag": "tag", } body = json.dumps(body) resp = sms_service.send_sms(body) print(resp) ================================================ FILE: volcengine/example/sms/example_update_sms_signature.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.sms.SmsService import SmsService from volcengine.const.Const import * if __name__ == "__main__": # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak("ak") sms_service.set_sk("sk") # It is recommended to use this domain name with a CDN. sms_service.set_host("sms-api.volcengineapi.com") body = { "subAccount": "8163cd74", "purpose": SIGN_PURPOSE_FOR_OWN, "source": SIGN_SOURCE_APP, "content": "测试签名", "desc": "000000", "domain": "000000", "signatureIdentificationID": 814, "appIcp": { "appIcpFilling": "APPICP测试备案", "appIcpFileList": [ { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_APP_ICP_CERTIFICATE } ] }, "trademark": { "trademarkCn": "商标中文", "trademarkEn": "english", "trademarkNumber": "商标注册号1", "trademarkFileList": [ { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_TRADEMARK_CERTIFICATE }, { "fileSuffix": "jpg", "fileUrl": "http:", "fileType": DOC_TYPE_TRADEMARK_CERTIFICATE } ] } } resp = sms_service.apply_signature_ident(body) print(resp) ================================================ FILE: volcengine/example/sms/example_vms_template_query.py ================================================ # coding:utf-8 from __future__ import print_function import base64 import json from volcengine.const.Const import * from volcengine.sms.SmsService import SmsService if __name__ == '__main__': # base64 encode func def to_base64_str(file): with open(file, 'rb') as fileObj: image_data = fileObj.read() return base64.b64encode(image_data).decode('utf-8') # cn sms_service = SmsService() # call below method if you dont set ak and sk in $HOME/.volc/config sms_service.set_ak('ak') sms_service.set_sk('sk') # sms_service.set_host('host') body = { "SubAccount": "subAccount", "TemplateId": "templateId" } resp = sms_service.get_vms_template_status(body) print(resp) ================================================ FILE: volcengine/example/sts/__init__.py ================================================ ================================================ FILE: volcengine/example/sts/example_assume_role.py ================================================ # coding:utf-8 from volcengine.sts.StsService import StsService if __name__ == '__main__': stsService = StsService() stsService.set_ak("your ak") stsService.set_sk("your sk") params = { "DurationSeconds": "900", "RoleSessionName": "just_for_test", "RoleTrn": "trn:iam::yourAccountID:role/yourRole" } print(stsService.assume_role(params)) ================================================ FILE: volcengine/example/tls/__init__.py ================================================ ================================================ FILE: volcengine/example/tls/example_alarm.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 创建日志主题 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 创建告警组 # 请根据您的需要,填写alarm_notify_group_name、notify_type和receivers等参数 # CreateAlarmNotifyGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112220 receiver = Receiver(receiver_type="User", receiver_names=["chenlei_test_sy_7_subuser1"], receiver_channels=["Email", "Sms"], start_time="00:00:00", end_time="23:59:59") create_alarm_notify_group_request = CreateAlarmNotifyGroupRequest( alarm_notify_group_name="alarm-notify-group-name-" + now, notify_type=["Trigger", "Recovery"], receivers=[receiver],) create_alarm_notify_group_response = tls_service.create_alarm_notify_group(create_alarm_notify_group_request) alarm_notify_group_id = create_alarm_notify_group_response.get_alarm_notify_group_id() # 获取不存在告警组的测试 # 请根据您的需要,填写alarm_notify_group_name等参数 # DescribeAlarmNotifyGroups API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112223 describe_alarm_notify_groups_request = DescribeAlarmNotifyGroupsRequest(alarm_notify_group_id="no-exists-notify-group-id" + now,) describe_alarm_notify_groups_response = tls_service.describe_alarm_notify_groups( describe_alarm_notify_groups_request) print("topics total: {}\n" . format(describe_alarm_notify_groups_response.get_total())) # 获取告警组 # 请根据您的需要,填写alarm_notify_group_name等参数 # DescribeAlarmNotifyGroups API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112223 describe_alarm_notify_groups_request = DescribeAlarmNotifyGroupsRequest() describe_alarm_notify_groups_response = tls_service.describe_alarm_notify_groups( describe_alarm_notify_groups_request) print("topics total: {}\nfirst alarm group name: {}".format(describe_alarm_notify_groups_response.get_total(), describe_alarm_notify_groups_response. get_alarm_notify_groups()[0].get_alarm_notify_group_name())) # 修改告警组 # 请根据您的需要,填写待修改的alarm_notify_group_id和其它参数 # ModifyAlarmNotifyGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112222 modify_alarm_notify_group_request = \ ModifyAlarmNotifyGroupRequest(alarm_notify_group_id, alarm_notify_group_name="change-alarm-notify-group-name-" + now) modify_alarm_notify_group_response = tls_service.modify_alarm_notify_group(modify_alarm_notify_group_request) # 创建告警策略 # 请根据您的需要,填写project_id、alarm_name、query_request、request_cycle、condition、alarm_period、alarm_notify_group等参数 # CreateAlarm API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112216 query_request = QueryRequest(topic_id=topic_id, query="Failed | select count(*) as errNum", number=1, start_time_offset=-15, end_time_offset=0, time_span_type="Relative", truncated_time="Minute") request_cycle = RequestCycle(cycle_type="Period", time=10) trigger_conditions = [TriggerCondition(condition="$1.errNum>=5", severity="warning")] create_alarm_request = CreateAlarmRequest(project_id, alarm_name="alarm-name", query_request=[query_request], request_cycle=request_cycle, condition="$1.errNum>0", alarm_period=60, alarm_notify_group=[alarm_notify_group_id], trigger_conditions=trigger_conditions) create_alarm_response = tls_service.create_alarm(create_alarm_request) alarm_id = create_alarm_response.alarm_id # 创建告警策略 - 关联检索分析结果 # 请根据您的需要,填写project_id、alarm_name、query_request、request_cycle、condition、alarm_period、alarm_notify_group等参数 # CreateAlarm API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112216 query_request_1 = QueryRequest(topic_id=topic_id, query="Failed | select count(*) as errCount", number=1, start_time_offset=-15, end_time_offset=0) query_request_2 = QueryRequest(topic_id=topic_id, query="Error | select count(*) as errCount", number=2, start_time_offset=-15, end_time_offset=0) request_cycle = RequestCycle(cycle_type="Period", time=10) join_configurations = [JoinConfig(set_operation_type="CrossJoin", condition="")] trigger_conditions = [TriggerCondition(condition="$1.errCount + $2.errCount >= 10", severity="warning")] create_alarm_request = CreateAlarmRequest(project_id, alarm_name="alarm-name-with-join-configurations", query_request=[query_request_1, query_request_2], request_cycle=request_cycle, condition="", alarm_period=60, alarm_notify_group=[alarm_notify_group_id], join_configurations=join_configurations, trigger_conditions=trigger_conditions) create_alarm_response = tls_service.create_alarm(create_alarm_request) alarm_id_2 = create_alarm_response.alarm_id # 修改告警策略 # 请根据您的需要,填写待修改的alarm_id和其它参数 # ModifyAlarm API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112218 trigger_conditions = [TriggerCondition(condition="$1.errNum>=6", severity="warning")] query_request = QueryRequest(topic_id=topic_id, query="Failed | select count(*) as errNum", number=1, start_time_offset=-15, end_time_offset=0, time_span_type="Today", truncated_time="Hour") modify_alarm_request = ModifyAlarmRequest(alarm_id, trigger_period=2, trigger_conditions=trigger_conditions, query_request=[query_request]) modify_alarm_response = tls_service.modify_alarm(modify_alarm_request) # 查询告警策略 # 请根据您的需要,填写待查询的project_id # DescribeAlarms API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112219 describe_alarms_request = DescribeAlarmsRequest(project_id) describe_alarms_response = tls_service.describe_alarms(describe_alarms_request) print("topics total:{} first alarm name:{}".format(describe_alarms_response.get_total(), describe_alarms_response.get_alarms()[0].get_alarm_name())) # 删除告警策略 # 请根据您的需要,填写待删除的alarm_id # DeleteAlarm API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112217 delete_alarm_request = DeleteAlarmRequest(alarm_id) delete_alarm_response = tls_service.delete_alarm(delete_alarm_request) tls_service.delete_alarm(DeleteAlarmRequest(alarm_id_2)) # 删除告警组 # 请根据您的需要,填写待删除的alarm_notify_group_id # DeleteAlarmNotifyGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112221 delete_alarm_notify_group_request = DeleteAlarmNotifyGroupRequest(alarm_notify_group_id) delete_alarm_notify_group_response = tls_service.delete_alarm_notify_group(delete_alarm_notify_group_request) # 删除日志主题 tls_service.delete_topic(DeleteTopicRequest(topic_id)) # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) ================================================ FILE: volcengine/example/tls/example_consumer.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.consumer.consumer import TLSConsumer, LogProcessor from volcengine.tls.consumer.consumer_model import ConsumerConfig from volcengine.tls.log_pb2 import LogGroupList # 用户需要实现一个继承LogProcessor的类,并按照业务需要自行实现process函数,用于处理消费到的每个LogGroupList class MyLogProcessor(LogProcessor): def process(self, topic_id: str, shard_id: int, log_group_list: LogGroupList): print(topic_id + " --- " + str(shard_id)) count = 0 for log_group in log_group_list.log_groups: for log in log_group.logs: count += 1 print("*** Count = {} ***".format(count)) for content in log.contents: print("{}: {}".format(content.key, content.value)) print() if __name__ == '__main__': # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 # endpoint = "https://tls-cn-beijing.volces.com" # region = "cn-beijing" # access_key_id = "AKLxxxxxxxx" # access_key_secret = "TUxxxxxxxxxx==" endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) # 配置消费组的必填参数,ConsumerConfig构造函数设定了一些默认参数,您也可根据需要自定义配置 consumer_config = ConsumerConfig(project_id="your-project-id", consumer_group_name="python-consumer-group", consumer_name="python-consumer", topic_id_list=["your-topic-id"]) tls_consumer = TLSConsumer(consumer_config, tls_service, MyLogProcessor()) # 调用start方法开始持续消费 tls_consumer.start() # 可通过调用tls_consumer.stop()来结束消费组消费 time.sleep(10) tls_consumer.stop() ================================================ FILE: volcengine/example/tls/example_consumer_group.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import CreateProjectRequest, CreateTopicRequest, DeleteTopicRequest, \ DeleteProjectRequest, CreateConsumerGroupRequest, DeleteConsumerGroupRequest, DescribeConsumerGroupsRequest if __name__ == '__main__': # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() print("Successfully create project, project id is: {} ".format(project_id)) # 创建日志主题 # 请根据您的需要,填写project_id、topic_name、ttl、shard_count和description等参数 # CreateTopic API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112180 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() print("Successfully create topic, topic id is: {} ".format(topic_id)) # 创建消费者组 consumer_group = "test-consumer-group-" + now create_consumer_group_request = CreateConsumerGroupRequest(project_id, consumer_group, topic_id_list=[topic_id], heartbeat_ttl=10, ordered_consume=True) tls_service.create_consumer_group(create_consumer_group_request) print("Successfully create consumer group, group is: {} ".format(consumer_group)) # 查询消费者组 describe_consumer_groups_request = DescribeConsumerGroupsRequest(project_id) describe_consumer_groups_response = tls_service.describe_consumer_groups(describe_consumer_groups_request) print("Successfully describe consumer group, count is: {} ".format(len(describe_consumer_groups_response.consumer_groups))) # 删除消费者组 tls_service.delete_consumer_group(DeleteConsumerGroupRequest(project_id, consumer_group)) print("Successfully delete consumer group, group is: {} ".format(consumer_group)) # 删除topic tls_service.delete_topic(DeleteTopicRequest(topic_id)) print("Successfully delete topic, topic id is: {} ".format(topic_id)) # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) print("Successfully delete project, project id is: {} ".format(project_id)) ================================================ FILE: volcengine/example/tls/example_describe_trace_instance.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeTraceInstanceRequest if __name__ == "__main__": # 初始化TLS服务 endpoint = "your-endpoint" access_key_id = "your-access-key-id" access_key_secret = "your-access-key-secret" region = "your-region" tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) # 创建DescribeTraceInstance请求 trace_instance_id = "your-trace-instance-id" request = DescribeTraceInstanceRequest(trace_instance_id=trace_instance_id) try: # 调用DescribeTraceInstance API response = tls_service.describe_trace_instance(request) # 获取Trace实例信息 trace_instance = response.get_trace_instance() print(f"Trace Instance ID: {trace_instance.get_trace_instance_id()}") print(f"Trace Instance Name: {trace_instance.get_trace_instance_name()}") print(f"Trace Instance Status: {trace_instance.get_trace_instance_status()}") print(f"Project ID: {trace_instance.get_project_id()}") print(f"Project Name: {trace_instance.get_project_name()}") print(f"Description: {trace_instance.get_description()}") print(f"Create Time: {trace_instance.get_create_time()}") print(f"Modify Time: {trace_instance.get_modify_time()}") print(f"Trace Topic ID: {trace_instance.get_trace_topic_id()}") print(f"Trace Topic Name: {trace_instance.get_trace_topic_name()}") print(f"Dependency Topic ID: {trace_instance.get_dependency_topic_id()}") print(f"Dependency Topic Name: {trace_instance.get_dependency_topic_topic_name()}") except Exception as e: print(f"Error: {e}") ================================================ FILE: volcengine/example/tls/example_embedded_console.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import json import requests from urllib.parse import quote from volcengine.sts.StsService import StsService if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] sts_service = StsService() sts_service.set_ak(access_key_id) sts_service.set_sk(access_key_secret) role_trn = "trn:iam::yourAccountID:role/yourRole" role_session_name = "tlsiframe" target_console_url = "https://console.volc-embed.com/tls/region:tls+cn-beijing" # 调用AssumeRole接口获取临时安全令牌 assume_role_params = { "DurationSeconds": "900", "RoleSessionName": role_session_name, "RoleTrn": role_trn } assume_role_resp = sts_service.assume_role(assume_role_params) assume_rule_ak = assume_role_resp["Result"]["Credentials"]["AccessKeyId"] assume_role_sk = assume_role_resp["Result"]["Credentials"]["SecretAccessKey"] session_token = assume_role_resp["Result"]["Credentials"]["SessionToken"] # 获取登录Token url_str = "https://console.volc-embed.com/api/passport/login/getSigninTokenWithSTS" url_str = url_str + "?accessKeyId=" + quote(assume_rule_ak) url_str = url_str + "&secretAccessKey=" + quote(assume_role_sk) url_str = url_str + "&sessionToken=" + quote(session_token) url_str = url_str + "&sessionDuration=3600" get_signin_token_with_sts_resp = json.loads(requests.post(url_str).content) signin_token = get_signin_token_with_sts_resp["Result"]["SigninToken"] # 构建免密访问链接 result = "https://console.volc-embed.com/api/passport/login/loginWithSigninToken" result = result + "?signinToken=" + quote(signin_token) result = result + '&redirectURI=' + quote(target_console_url) print(result) ================================================ FILE: volcengine/example/tls/example_etl.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息, # 以免AccessKey硬编码引发数据安全风险。详细说明请参考 # https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 创建源日志主题 create_source_topic_request = CreateTopicRequest( topic_name="source-topic-name-" + now, project_id=project_id, ttl=3650, description="source-topic-description", shard_count=2, ) create_source_topic_response = tls_service.create_topic(create_source_topic_request) source_topic_id = create_source_topic_response.get_topic_id() # 创建目标日志主题 create_target_topic_request = CreateTopicRequest( topic_name="target-topic-name-" + now, project_id=project_id, ttl=3650, description="target-topic-description", shard_count=2, ) create_target_topic_response = tls_service.create_topic(create_target_topic_request) target_topic_id = create_target_topic_response.get_topic_id() # 创建ETL任务 # 请根据您的需要,填写相关参数 # CreateETLTask API的请求参数规范请参阅相关文档 create_etl_task_request = CreateETLTaskRequest( dsl_type="NORMAL", name="etl-task-name-" + now, description="etl-task-description", enable=True, source_topic_id=source_topic_id, script='f_set("key", "value")', task_type="Resident", target_resources=[ { "alias": "test", "topic_id": target_topic_id, "region": region } ] ) create_etl_task_response = tls_service.create_etl_task(create_etl_task_request) etl_task_id = create_etl_task_response.get_task_id() print(f"ETL Task created successfully, task_id: {etl_task_id}") # 删除日志主题 delete_source_topic_request = DeleteTopicRequest(source_topic_id) tls_service.delete_topic(delete_source_topic_request) delete_target_topic_request = DeleteTopicRequest(target_topic_id) tls_service.delete_topic(delete_target_topic_request) # 删除日志项目 delete_project_request = DeleteProjectRequest(project_id=project_id) tls_service.delete_project(delete_project_request) ================================================ FILE: volcengine/example/tls/example_host_group.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建机器组 # 请根据您的需要,填写host_group_name、host_group_type和host_ip_list等参数 # CreateHostGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112206 create_host_group_request = CreateHostGroupRequest(host_group_name="host-group-name-" + now, host_group_type="IP", host_ip_list=["192.168.1.1", "192.168.1.2", "192.168.1.3"]) create_host_group_response = tls_service.create_host_group(create_host_group_request) host_group_id = create_host_group_response.get_host_group_id() # 获取指定机器组信息 # 请根据您的需要,填写待查询的host_group_id # DescribeHostGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112210 describe_host_group_request = DescribeHostGroupRequest(host_group_id) describe_host_group_response = tls_service.describe_host_group(describe_host_group_request) print("host group name: {}".format( describe_host_group_response.get_host_group_hosts_rules_info().get_host_group_info().get_host_group_name())) print("first host ip: {}".format( describe_host_group_response.get_host_group_hosts_rules_info().get_host_infos()[0].get_ip())) # 获取全部机器组信息 # 请根据您的需要,填写host_group_name等可选参数 # DescribeHostGroups API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112211 describe_host_groups_request = DescribeHostGroupsRequest() describe_host_groups_response = tls_service.describe_host_groups(describe_host_groups_request) print("first host group name: {}".format( describe_host_groups_response.get_host_group_hosts_rules_infos()[0].get_host_group_info().get_host_group_name())) print("first host ip: {}".format( describe_host_groups_response.get_host_group_hosts_rules_infos()[0].get_host_infos()[0].get_ip())) # 修改机器组 # 请根据您的需要,填写host_group_id和待修改的机器组信息 # ModifyHostGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112209 modify_host_group_request = ModifyHostGroupRequest(host_group_id, host_group_name="change-host-group-name-" + now) modify_host_group_response = tls_service.modify_host_group(modify_host_group_request) # 查询机器组所有机器 # 请根据您的需要,填写待查询的host_group_id # DescribeHosts API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112212 describe_hosts_request = DescribeHostsRequest(host_group_id) describe_hosts_response = tls_service.describe_hosts(describe_hosts_request) print("total {} hosts\nfirst host ip: {}".format(describe_hosts_response.get_total(), describe_hosts_response.get_host_infos()[0].get_ip())) # 删除机器组内指定机器 # 请根据您的需要,填写待删除机器的host_group_id和ip # DeleteHost API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112213 delete_host_request = DeleteHostRequest(host_group_id, ip="192.168.1.3") delete_host_response = tls_service.delete_host(delete_host_request) # 查询机器组的采集配置 # 请根据您的需要,填写待查询的host_group_id # DescribeHostGroupRules API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112214 describe_host_group_rules_request = DescribeHostGroupRulesRequest(host_group_id) describe_host_group_rules_response = tls_service.describe_host_group_rules(describe_host_group_rules_request) print("total {} hosts".format(describe_host_group_rules_response.get_total())) # 删除机器组 # 请根据您的需要,填写待删除的host_group_id # DeleteHostGroup API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112208 delete_host_group_request = DeleteHostGroupRequest(host_group_id) delete_host_group_response = tls_service.delete_host_group(delete_host_group_request) ================================================ FILE: volcengine/example/tls/example_import_task.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="import-project-" + now, region=region, description="project for import task test") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() print("创建日志项目成功,project_id: {}".format(project_id)) # 创建日志主题 create_topic_request = CreateTopicRequest( topic_name="import-topic-" + now, project_id=project_id, ttl=5, description="topic for import task test", shard_count=2, ) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() print("创建日志主题成功,topic_id: {}".format(topic_id)) # 示例1:创建TOS导入任务 print("\n=== 创建TOS导入任务 ===") # TOS源信息配置 tos_source_info = TosSourceInfo( bucket="bucket-for-import-sdk-test", # 请替换为您的TOS存储桶名称 region="cn-guilin-boe", # 请替换为您的TOS存储桶所在区域 compress_type="none", # 日志压缩类型:none、gzip、lz4、snappy prefix="logs/" # 日志文件前缀 ) # 导入源信息 import_source_info = ImportSourceInfo(tos_source_info=tos_source_info) # 提取规则配置 import_extract_rule = ImportExtractRule( delimiter="|", # 分隔符 keys=["time", "level", "message"], # 字段名 time_key="time", # 时间字段名 time_format="%Y-%m-%d %H:%M:%S", # 时间格式 time_zone="Asia/Shanghai", # 时区 un_match_up_load_switch=True, # 上传解析失败的日志 un_match_log_key="LogParseFailed" # 解析失败日志的字段名 ) # 目标信息配置 target_info = TargetInfo( region=region, # 日志主题所在区域 log_type="delimiter_log", # 日志类型 extract_rule=import_extract_rule, # 提取规则 log_sample="2023-12-01 10:00:00|INFO|This is a sample log" # 日志样例 ) # 创建TOS导入任务请求 create_import_task_request = CreateImportTaskRequest( topic_id=topic_id, task_name="tos-import-task-" + now, source_type="tos", # 源类型:tos import_source_info=import_source_info, target_info=target_info, project_id=project_id, description="TOS导入任务测试" ) try: create_response = tls_service.create_import_task(create_import_task_request) task_id = create_response.get_task_id() print("TOS导入任务创建成功,task_id: {}".format(task_id)) # 查询导入任务 print("\n=== 验证查询导入任务功能 ===") try: describe_request = DescribeImportTaskRequest(task_id=task_id) describe_response = tls_service.describe_import_task(describe_request) print("查询导入任务成功,任务名称: {}".format(describe_response.get_task_info().task_name)) except Exception as e: print("查询导入任务失败: {}".format(str(e))) # 验证新增方法 - 修改导入任务 print("\n=== 验证修改导入任务功能 ===") try: # 修改任务状态为已停止(状态码4) modify_request = ModifyImportTaskRequest( task_id=task_id, status=4, # 已停止 topic_id=topic_id, task_name="modified-tos-import-task-" + now, source_type="tos", import_source_info=import_source_info, target_info=target_info, project_id=project_id, description="修改后的TOS导入任务测试" ) modify_response = tls_service.modify_import_task(modify_request) print("修改导入任务成功") except Exception as e: print("修改导入任务失败: {}".format(str(e))) # 验证新增方法 - 查询导入任务列表 print("\n=== 验证查询导入任务列表功能 ===") try: describe_tasks_request = DescribeImportTasksRequest( project_id=project_id, topic_id=topic_id, source_type="tos", page_number=1, page_size=10 ) tasks_response = tls_service.describe_import_tasks(describe_tasks_request) print("查询导入任务列表成功,总数: {}".format(tasks_response.get_total())) if tasks_response.get_task_info(): print("第一个任务名称: {}".format(tasks_response.get_task_info()[0].task_name)) except Exception as e: print("查询导入任务列表失败: {}".format(str(e))) except Exception as e: print("TOS导入任务创建失败: {}".format(str(e))) task_id = None # 示例2:创建Kafka导入任务 print("\n=== 创建Kafka导入任务 ===") # Kafka源信息配置 kafka_source_info = KafkaSourceInfo( host="kafka1.example.com:9092,kafka2.example.com:9092", # Kafka集群地址 topic="app-logs", # Kafka Topic名称 encode="UTF-8", # 数据编码格式 protocol="plaintext", # Kafka协议 is_need_auth=False, # 是否开启鉴权 initial_offset=0, # 从最早时间开始导入 time_source_default=0, # 使用Kafka消息时间戳 ) # 导入源信息 import_source_info_kafka = ImportSourceInfo(kafka_source_info=kafka_source_info) # 提取规则配置(JSON日志类型) import_extract_rule_json = ImportExtractRule( time_key="timestamp", # 时间字段名 time_format="%Y-%m-%dT%H:%M:%S.%fZ", # ISO时间格式 time_zone="UTC", # UTC时区 un_match_up_load_switch=True, un_match_log_key="LogParseFailed" ) # 目标信息配置 target_info_kafka = TargetInfo( region=region, log_type="json_log", # JSON日志类型 extract_rule=import_extract_rule_json, log_sample='{"@timestamp":"2023-12-01T10:00:00.000Z","level":"INFO","message":"Sample log message"}' ) # 创建Kafka导入任务请求 create_kafka_import_request = CreateImportTaskRequest( topic_id=topic_id, task_name="kafka-import-task-" + now, source_type="kafka", # 源类型:kafka import_source_info=import_source_info_kafka, target_info=target_info_kafka, project_id=project_id, description="Kafka导入任务测试" ) try: create_kafka_response = tls_service.create_import_task(create_kafka_import_request) kafka_task_id = create_kafka_response.get_task_id() print("Kafka导入任务创建成功,task_id: {}".format(kafka_task_id)) # 验证新增方法 - 查询Kafka导入任务 print("\n=== 验证查询Kafka导入任务功能 ===") try: describe_kafka_request = DescribeImportTaskRequest(task_id=kafka_task_id) describe_kafka_response = tls_service.describe_import_task(describe_kafka_request) print("查询Kafka导入任务成功,任务名称: {}".format(describe_kafka_response.get_task_info().task_name)) except Exception as e: print("查询Kafka导入任务失败: {}".format(str(e))) # 验证新增方法 - 修改Kafka导入任务 print("\n=== 验证修改Kafka导入任务功能 ===") try: modify_kafka_request = ModifyImportTaskRequest( task_id=kafka_task_id, status=5, # 导入中 topic_id=topic_id, task_name="modified-kafka-import-task-" + now, source_type="kafka", import_source_info=import_source_info_kafka, target_info=target_info_kafka, project_id=project_id, description="修改后的Kafka导入任务测试" ) modify_kafka_response = tls_service.modify_import_task(modify_kafka_request) print("修改Kafka导入任务成功") except Exception as e: print("修改Kafka导入任务失败: {}".format(str(e))) # 验证新增方法 - 查询Kafka导入任务列表(按状态筛选) print("\n=== 验证按状态查询导入任务列表功能 ===") try: describe_kafka_tasks_request = DescribeImportTasksRequest( project_id=project_id, topic_id=topic_id, source_type="kafka", page_number=1, page_size=10 ) kafka_tasks_response = tls_service.describe_import_tasks(describe_kafka_tasks_request) print("按状态查询导入任务列表成功,总数: {}".format(kafka_tasks_response.get_total())) if kafka_tasks_response.get_task_info(): print("第一个Kafka任务名称: {}".format(kafka_tasks_response.get_task_info()[0].task_name)) except Exception as e: print("按状态查询导入任务列表失败: {}".format(str(e))) except Exception as e: print("Kafka导入任务创建失败: {}".format(str(e))) kafka_task_id = None # 验证新增方法 - 综合查询所有导入任务 print("\n=== 验证综合查询导入任务列表功能 ===") try: all_tasks_request = DescribeImportTasksRequest( page_number=1, page_size=20 ) all_tasks_response = tls_service.describe_import_tasks(all_tasks_request) print("查询所有导入任务列表成功,总数: {}".format(all_tasks_response.get_total())) if all_tasks_response.get_task_info(): print("任务列表中包含 {} 个任务".format(len(all_tasks_response.get_task_info()))) for i, task in enumerate(all_tasks_response.get_task_info()): print("任务 {}: ID={}, 名称={}, 类型={}, 状态={}".format( i+1, task.task_id, task.task_name, task.source_type, task.status )) except Exception as e: print("综合查询导入任务列表失败: {}".format(str(e))) # 删除导入任务(清理资源) print("\n=== 清理导入任务 ===") if task_id: try: delete_request = DeleteImportTaskRequest(task_id=task_id) tls_service.delete_import_task(delete_request) print("TOS导入任务删除成功") except Exception as e: print("TOS导入任务删除失败: {}".format(str(e))) if kafka_task_id: try: delete_kafka_request = DeleteImportTaskRequest(task_id=kafka_task_id) tls_service.delete_import_task(delete_kafka_request) print("Kafka导入任务删除成功") except Exception as e: print("Kafka导入任务删除失败: {}".format(str(e))) # 删除日志主题 print("\n=== 清理资源 ===") delete_topic_request = DeleteTopicRequest(topic_id) tls_service.delete_topic(delete_topic_request) print("日志主题删除成功") # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) print("日志项目删除成功") print("\n=== 导入任务示例程序执行完成 ===") ================================================ FILE: volcengine/example/tls/example_index.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 创建日志主题 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 创建索引配置 # 请根据您的需要,配置full_text全文索引或key_value键值索引 # CreateIndex API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112187 full_text = FullTextInfo(case_sensitive=False, delimiter=",-;", include_chinese=False) value_info_a = ValueInfo(value_type="text", delimiter="", case_sensitive=True, include_chinese=False, sql_flag=False) value_info_b = ValueInfo(value_type="long", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True) value_c1_json_keys = ValueInfo(value_type="text", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True) value_c2_json_keys = ValueInfo(value_type="long", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True) value_info_c = ValueInfo(value_type="json", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True, index_all=True, json_keys=[ KeyValueInfo("test", value_c1_json_keys).json(), KeyValueInfo("key-l", value_c2_json_keys).json(), ]) key_value_info_a = KeyValueInfo(key="test1", value=value_info_a) key_value_info_b = KeyValueInfo(key="test2", value=value_info_b) key_value_info_c = KeyValueInfo(key="test3", value=value_info_c) key_value = [key_value_info_a, key_value_info_b, key_value_info_c] create_index_request = CreateIndexRequest(topic_id=create_topic_response.topic_id, full_text=full_text, key_value=key_value) create_index_response = tls_service.create_index(create_index_request) # 查询索引配置 # 请根据您的需要,填写待查询的topic_id # DescribeIndex API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112190 describe_index_request = DescribeIndexRequest(topic_id) describe_index_response = tls_service.describe_index(describe_index_request) print("index delimiter: {}".format(describe_index_response.get_full_text().get_delimiter())) # 修改索引配置 # 请根据您的需要,填写topic_id和待修改的full_text或key_value配置 # ModifyIndex API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112189 modify_index_request = ModifyIndexRequest(topic_id, full_text=FullTextInfo(case_sensitive=True, delimiter=",")) modify_index_response = tls_service.modify_index(modify_index_request) # 删除索引配置 # 请根据您的需要,填写待删除索引的topic_id # DeleteIndex API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112188 delete_index_request = DeleteIndexRequest(topic_id) delete_index_response = tls_service.delete_index(delete_index_request) # 删除topic tls_service.delete_topic(DeleteTopicRequest(topic_id)) # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) ================================================ FILE: volcengine/example/tls/example_log.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.project_id # 创建日志主题 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 创建索引 full_text = FullTextInfo(case_sensitive=False, delimiter=",-;", include_chinese=False) value_info_a = ValueInfo(value_type="text", delimiter="", case_sensitive=True, include_chinese=False, sql_flag=True) value_info_b = ValueInfo(value_type="long", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True) key_value_info_a = KeyValueInfo(key="key1", value=value_info_a) key_value_info_b = KeyValueInfo(key="key2", value=value_info_b) key_value = [key_value_info_a, key_value_info_b] create_index_request = CreateIndexRequest(topic_id, full_text, key_value) create_index_response = tls_service.create_index(create_index_request) # 写入日志数据 # 建议您一次性聚合多条日志后调用一次put_logs_v2接口,以提高日志上传吞吐率 # 请根据您的需要,填写topic_id、source、filename和logs列表,建议您使用lz4压缩 # PutLogs API的请求参数规范和限制请参阅 https://www.volcengine.com/docs/6470/112191 logs = PutLogsV2Logs(source="192.168.1.1", filename="sys.log") for i in range(100): logs.add_log(contents={"key1": "value1-" + str(i + 1), "key2": "value2-" + str(i + 1)}, log_time=int(round(time.time()))) tls_service.put_logs_v2(PutLogsV2Request(topic_id, logs)) time.sleep(30) # 查询日志直方图情况 # 请根据您的需要,填写topic_id、query、start_time、end_time、interval # DescribeHistogramV1 API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/1347899 start_time = int(round(time.time())) - 60 end_time = start_time + 60 * 2 # Deprecated, use DescribeHistogramV1 instead. describe_histogram_request = DescribeHistogramRequest(topic_id, "", start_time, end_time, interval=None) describe_histogram_response = tls_service.describe_histogram(describe_histogram_request) describe_histogram_v1_request = DescribeHistogramV1Request(topic_id, "", start_time, end_time, interval=None) describe_histogram_v1_response = tls_service.describe_histogram_v1(describe_histogram_v1_request) # 查询消费游标 # 请根据您的需要,填写topic_id、shard_id和from_time # DescribeCursor API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112193 describe_cursor_request = DescribeCursorRequest(topic_id, shard_id=0, from_time="begin") describe_cursor_response = tls_service.describe_cursor(describe_cursor_request) # 消费日志数据 # 请根据您的需要,填写topic_id、shard_id、cursor等参数 # ConsumeLogs API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112194 consume_logs_request = ConsumeLogsRequest(topic_id, shard_id=0, cursor=describe_cursor_response.cursor) consume_logs_response = tls_service.consume_logs(consume_logs_request) # 查询分析日志数据 # 请根据您的需要,填写topic_id、query、start_time、end_time、limit等参数值 # SearchLogs API的请求参数规范和限制请参阅 https://www.volcengine.com/docs/6470/112195 # 当您需要检索和分析日志时,推荐您使用Python SDK提供的search_logs_v2方法,下面的代码提供了具体的调用示例 # 查询日志数据(全文检索) search_logs_request = SearchLogsRequest(topic_id, query="error", limit=10, start_time=1672502400000, end_time=1688140800000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(键值检索) search_logs_request = SearchLogsRequest(topic_id, query="key1:error", limit=10, start_time=1672502400000, end_time=1688140800000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(SQL分析) search_logs_request = SearchLogsRequest(topic_id, query="* | select key1, key2", limit=10, start_time=1672502400000, end_time=1688140800000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(SQL分析) search_logs_request = SearchLogsRequest(topic_id, query="* | select key1, key2", limit=10, start_time=1672502400000, end_time=1688140800000) search_logs_response = tls_service.search_logs(search_logs_request) ================================================ FILE: volcengine/example/tls/example_producer.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.consumer.consumer import TLSConsumer, LogProcessor from volcengine.tls.consumer.consumer_model import ConsumerConfig from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.producer.producer import TLSProducer from volcengine.tls.producer.producer_model import CallBack, ProducerConfig from volcengine.tls.tls_requests import PutLogsV2LogContent produce_success_count = 0 produce_failed_count = 0 class MyCallBack(CallBack): def __init__(self, logs: list[PutLogsV2LogContent]): self.logs = logs def on_complete(self, result: 'Result'): global produce_success_count global produce_failed_count if result.success: produce_success_count += len(self.logs) else: produce_failed_count += len(self.logs) if __name__ == '__main__': # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 # endpoint = "https://tls-cn-beijing.volces.com" # region = "cn-beijing" # access_key_id = "AKLxxxxxxxx" # access_key_secret = "TUxxxxxxxxxx==" endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] topic_id = "your-topic-id" producer_config = ProducerConfig( endpoint=endpoint, access_key=access_key_id, access_secret=access_key_secret, region=region, ) tls_producer = TLSProducer(producer_config) tls_producer.start() for i in range(10): logs = [PutLogsV2LogContent( log_dict={ "key": "key-" + str(i), "value": "test-message-" + str(i) }, time=int(time.time()) - 300 ), PutLogsV2LogContent( log_dict={ "key": "key1-" + str(i), "value": "test-message1-" + str(i) }, time=int(time.time()) - 300 )] callback = MyCallBack(logs) tls_producer.send_logs_v2("", topic_id, "", "", logs, callback) # 等待所有消息发送完成 time.sleep(5) tls_producer.close() print("*****produce success count: " + str(produce_success_count)) print("*****produce failed count: " + str(produce_failed_count)) ================================================ FILE: volcengine/example/tls/example_project.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 # 请根据您的需要,填写project_name和可选的description;请您填写和初始化tls_service时一致的region # CreateProject API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112174 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 查询指定日志项目信息 # 请根据您的需要,填写待查询的project_id # DescribeProject API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112178 describe_project_request = DescribeProjectRequest(project_id) describe_project_response = tls_service.describe_project(describe_project_request) project = describe_project_response.get_project() print("project id: {}".format(project.get_project_id())) # 查询所有日志项目信息 # 请根据您的需要,填写project_name等参数 # DescribeProjects API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112179 describe_projects_request = DescribeProjectsRequest() describe_projects_response = tls_service.describe_projects(describe_projects_request) print("project total: {}\nfirst project name: {}".format(describe_projects_response.get_total(), describe_projects_response.get_projects()[0].get_project_name())) # 修改日志项目 # 请根据您的需要,填写project_name或description等参数 # ModifyProject API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112177 modify_project_request = ModifyProjectRequest(project_id, project_name="change-project-name", description="change-project-description") modify_project_response = tls_service.modify_project(modify_project_request) # 删除日志项目 # 请根据您的需要,填写待删除的project_id # DeleteProject API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112176 delete_project_request = DeleteProjectRequest(project_id) delete_project_response = tls_service.delete_project(delete_project_request) ================================================ FILE: volcengine/example/tls/example_rule.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 创建日志主题 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 创建采集配置 # 请根据您的需要,填写topic_id、rule_name和其它采集配置参数 # CreateRule API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112199 rule_name = "rule-name" paths = ["/data/nginx/log/*/*/*.log"] log_type = "delimiter_log" extract_rule = ExtractRule(delimiter="#", keys=["time", "level", "msg"], time_key="time", time_format="%Y-%m-%dT%H:%M:%S,%f", time_zone="Asia/Shanghai", time_extract_regex="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2},\\d{3}", enable_nanosecond=True, time_sample="2018-05-22 15:35:53.850#INFO#XXXX", filter_key_regex=[FilterKeyRegex("msg", ".*ERROR.*")], un_match_up_load_switch=True, un_match_log_key="LogParseFailed") exclude_paths = [ExcludePath("File", "/data/nginx/log/*/*/exclude.log"), ExcludePath("Path", "/data/nginx/log/*/exclude/")] user_define_rule = UserDefineRule(ParsePathRule(path_sample="/var/logs/instanceid_any_podname/test.log", regex="\\/var\\/logs\\/([a-z]*)_any_([a-z]*)\\/test\\.log", keys=["instance-id", "pod-name"]), enable_raw_log=True, raw_log_key="raw_log_key", enable_hostname=True, hostname_key="hostname", enable_host_group_label=True, host_group_label_key="host_group_label", tail_size_kb=1024, ignore_older=24, multi_collects_type="RuleID", tail_files=True) log_sample = "2018-05-22 15:35:53.850#INFO#XXXX" input_type = 2 container_rule = ContainerRule(container_name_regex=".*Name.*", include_container_label_regex={"Key1": "Value1", "Key2": "Value2"}, exclude_container_label_regex={"Key1": "Value1", "Key2": "Value2"}, include_container_env_regex={"Key1": "Value1", "Key2": "Value2"}, exclude_container_env_regex={"Key1": "Value1", "Key2": "Value2"}, env_tag={"Key1": "Value1", "Key2": "Value2"}, kubernetes_rule=KubernetesRule(namespace_name_regex=".*Name.*", workload_type="Deployment", workload_name_regex=".*workload.*", include_pod_label_regex={"Key1": "Value1", "Key2": "Value2"}, exclude_pod_label_regex={"Key1": "Value1", "Key2": "Value2"}, pod_name_regex=".*Name.*", label_tag={"Key1": "Value1", "Key2": "Value2"}, enable_all_label_tag=True, include_pod_annotation_regex={"Key1": "Value1"}, exclude_pod_annotation_regex={"Key2": "Value2"})) create_rule_request = CreateRuleRequest(topic_id, rule_name, paths, log_type, extract_rule, exclude_paths, user_define_rule, log_sample, input_type, container_rule) create_rule_response = tls_service.create_rule(create_rule_request) rule_id = create_rule_response.get_rule_id() # 查询指定采集配置 # 请根据您的需要,填写待查询的rule_id # DescribeRule API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112202 describe_rule_request = DescribeRuleRequest(rule_id) describe_rule_response = tls_service.describe_rule(describe_rule_request) print("rule name: {}".format(describe_rule_response.get_rule_info().get_rule_name())) # 查询日志项目所有采集配置 # 请根据您的需要,填写待查询的project_id # DescribeRules API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112203 describe_rules_request = DescribeRulesRequest(project_id) describe_rules_response = tls_service.describe_rules(describe_rules_request) print("topics total:{}\nfirst rule name: {}".format(describe_rules_response.get_total(), describe_rules_response.get_rule_infos()[0].get_rule_name())) # 修改采集配置 # 请根据您的需要,填写待修改的rule_id、rule_name或其它参数 # ModifyRule API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112201 modify_rule_request = ModifyRuleRequest(rule_id, rule_name="change-rule-name-" + now, pause=1) modify_rule_response = tls_service.modify_rule(modify_rule_request) # 验证新增字段 - 查询采集配置并检查新增字段 describe_rule_request = DescribeRuleRequest(rule_id) describe_rule_response = tls_service.describe_rule(describe_rule_request) rule_info = describe_rule_response.get_rule_info() print("修改后的规则名称: {}".format(rule_info.get_rule_name())) # 验证查询采集配置列表的新增参数 describe_rules_request = DescribeRulesRequest(project_name="project-name-" + now, log_type="delimiter_log", pause=1) describe_rules_response = tls_service.describe_rules(describe_rules_request) print("查询到 {} 个暂停的采集配置".format(len([r for r in describe_rules_response.get_rule_infos() if hasattr(r, 'pause') and r.pause]))) # 创建机器组 create_host_group_request = CreateHostGroupRequest(host_group_name="host-group-name", host_group_type="IP", host_ip_list=["192.168.1.1", "192.168.1.2", "192.168.1.3"]) create_host_group_response = tls_service.create_host_group(create_host_group_request) host_group_id = create_host_group_response.get_host_group_id() # 应用采集配置到机器组 # 请根据您的需要,填写rule_id和host_group_ids列表 # ApplyRuleToHostGroups API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112204 apply_rule_to_host_groups_request = ApplyRuleToHostGroupsRequest(rule_id, host_group_ids=[host_group_id]) apply_rule_to_host_groups_response = tls_service.apply_rule_to_host_groups(apply_rule_to_host_groups_request) # 删除机器组的采集配置 # 请根据您的需要,填写rule_id和host_group_ids列表 # DeleteRuleFromHostGroups API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112205 delete_rule_from_host_groups_request = DeleteRuleFromHostGroupsRequest(rule_id, host_group_ids=[host_group_id]) delete_rule_from_host_groups_response = tls_service.delete_rule_from_host_groups( delete_rule_from_host_groups_request) # 删除采集配置 # 请根据您的需要,填写待删除的rule_id # DeleteRule API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112200 delete_rule_request = DeleteRuleRequest(rule_id) delete_rule_response = tls_service.delete_rule(delete_rule_request) # 删除机器组 delete_host_group_request = DeleteHostGroupRequest(host_group_id) delete_host_group_response = tls_service.delete_host_group(delete_host_group_request) # 删除日志主题 tls_service.delete_topic(DeleteTopicRequest(topic_id)) # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) ================================================ FILE: volcengine/example/tls/example_schedule_sql_task.py ================================================ # coding=utf-8 import os import time import uuid from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,需要设置AccessKey ID/AccessKey Secret,以及服务地域 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 创建TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) # 创建项目和主题用于测试 project_name = f"tls-python-sdk-schedule-project-{uuid.uuid4().hex}" source_topic_name = f"tls-python-sdk-schedule-source-topic-{uuid.uuid4().hex}" dest_topic_name = f"tls-python-sdk-schedule-dest-topic-{uuid.uuid4().hex}" # 创建项目 create_project_request = CreateProjectRequest( project_name=project_name, region=region, ) create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() print(f"Created project: {project_id}") # 创建源主题 create_source_topic_request = CreateTopicRequest( project_id=project_id, topic_name=source_topic_name, shard_count=1, ttl=1, ) create_source_topic_response = tls_service.create_topic(create_source_topic_request) source_topic_id = create_source_topic_response.get_topic_id() print(f"Created source topic: {source_topic_id}") # 创建目标主题 create_dest_topic_request = CreateTopicRequest( project_id=project_id, topic_name=dest_topic_name, shard_count=1, ttl=1, ) create_dest_topic_response = tls_service.create_topic(create_dest_topic_request) dest_topic_id = create_dest_topic_response.get_topic_id() print(f"Created dest topic: {dest_topic_id}") # 为源主题创建索引 create_index_request = CreateIndexRequest( topic_id=source_topic_id, full_text=FullTextInfo( delimiter=",; ", case_sensitive=False, include_chinese=False, ), ) create_index_response = tls_service.create_index(create_index_request) print(f"Created index for source topic: {create_index_response.get_request_id()}") # 创建定时SQL任务 current_time = int(time.time()) task_name = f"tls-python-sdk-schedule-task-{uuid.uuid4().hex}" create_schedule_sql_task_request = CreateScheduleSqlTaskRequest( task_name=task_name, topic_id=source_topic_id, dest_topic_id=dest_topic_id, process_start_time=current_time + 3600, # 1小时后开始 process_time_window="@m-15m,@m", query="* | select count(*) as count", request_cycle=RequestCycle( cycle_type="Period", time=60, # 每60分钟执行一次 ), status=0, # 关闭任务,后续需手动启动 description="测试定时SQL任务", process_sql_delay=60, ) create_schedule_sql_task_response = tls_service.create_schedule_sql_task( create_schedule_sql_task_request) task_id = create_schedule_sql_task_response.get_task_id() print(f"Created schedule SQL task: {task_id}") # 清理资源 print("Cleaning up resources...") # 删除目标主题 delete_dest_topic_request = DeleteTopicRequest(topic_id=dest_topic_id) tls_service.delete_topic(delete_dest_topic_request) print(f"Deleted dest topic: {dest_topic_id}") # 删除源主题 delete_source_topic_request = DeleteTopicRequest(topic_id=source_topic_id) tls_service.delete_topic(delete_source_topic_request) print(f"Deleted source topic: {source_topic_id}") # 删除项目 delete_project_request = DeleteProjectRequest(project_id=project_id) tls_service.delete_project(delete_project_request) print(f"Deleted project: {project_id}") print("Example completed successfully!") ================================================ FILE: volcengine/example/tls/example_shipper.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="shipper-project-" + now, region=region, description="project for shipper test") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() print("创建日志项目成功,project_id: {}".format(project_id)) # 创建日志主题 create_topic_request = CreateTopicRequest( topic_name="shipper-topic-" + now, project_id=project_id, ttl=5, description="topic for shipper test", shard_count=2, ) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() print("创建日志主题成功,topic_id: {}".format(topic_id)) # 示例1:创建TOS投递配置 print("\n=== 创建TOS投递配置 ===") # JSON格式内容配置 json_info = JsonInfo( enable=True, keys=["__content__", "__time__", "__source__", "level", "message"], # 指定要投递的字段 escape=True ) # 内容信息配置 content_info = ContentInfo( format="json", # JSON格式 json_info=json_info ) # TOS投递信息配置 tos_shipper_info = TosShipperInfo( bucket="bucket-for-import-sdk-test", # 请替换为您的TOS存储桶名称 prefix="logs/shipper/", # 投递路径前缀 max_size=256, # 每个分片最大投递文件大小(MiB) compress="snappy", # 压缩格式 interval=300, # 投递时间间隔(秒) partition_format="%Y/%m/%d/%H" # 分区格式 ) # 创建TOS投递配置请求 create_tos_shipper_request = CreateShipperRequest( topic_id=topic_id, shipper_name="tos-shipper-" + now, shipper_type="tos", # TOS投递类型 content_info=content_info, tos_shipper_info=tos_shipper_info, shipper_start_time=int(time.time() * 1000), # 当前时间作为开始时间 shipper_end_time=int((time.time() + 3600) * 1000) # 1小时后结束 ) try: create_tos_response = tls_service.create_shipper(create_tos_shipper_request) tos_shipper_id = create_tos_response.get_shipper_id() print("TOS投递配置创建成功,shipper_id: {}".format(tos_shipper_id)) # 验证查询TOS投递配置 print("\n=== 验证查询TOS投递配置 ===") try: describe_tos_request = DescribeShipperRequest(shipper_id=tos_shipper_id) tos_info = tls_service.describe_shipper(describe_tos_request) print("查询TOS投递配置成功") print("投递配置名称: {}".format(tos_info.get_shipper_name())) print("投递类型: {}".format(tos_info.get_shipper_type())) print("状态: {}".format(tos_info.get_status())) print("TOS存储桶: {}".format(tos_info.get_tos_shipper_info().bucket)) print("投递路径: {}".format(tos_info.get_tos_shipper_info().prefix)) except Exception as e: print("查询TOS投递配置失败: {}".format(str(e))) # 验证修改TOS投递配置 print("\n=== 验证修改TOS投递配置 ===") try: # 修改投递间隔和压缩格式 modified_tos_info = TosShipperInfo( bucket="bucket-for-import-sdk-test", prefix="logs/modified/", max_size=128, # 修改为128MiB compress="gzip", # 修改为gzip压缩 interval=600, # 修改为10分钟 partition_format="%Y/%m/%d" # 修改分区格式 ) modify_tos_request = ModifyShipperRequest( shipper_id=tos_shipper_id, shipper_name="modified-tos-shipper-" + now, tos_shipper_info=modified_tos_info, status=False # 暂停投递 ) modify_tos_response = tls_service.modify_shipper(modify_tos_request) print("修改TOS投递配置成功") except Exception as e: print("修改TOS投递配置失败: {}".format(str(e))) except Exception as e: print("TOS投递配置创建失败: {}".format(str(e))) tos_shipper_id = None # 示例2:创建Kafka投递配置 print("\n=== 创建Kafka投递配置 ===") # original格式内容配置 json_info = JsonInfo( keys=["timestamp", "level", "service", "message", "request_id"], # JSON字段 escape=True ) # 内容信息配置 content_info_csv = ContentInfo( format="original", # CSV格式 json_info=json_info ) # Kafka投递信息配置 kafka_shipper_info = KafkaShipperInfo( instance="kafka-cnoe27xibel3vjxd", # Kafka实例ID kafka_topic="test1", # Kafka Topic名称 compress="snappy", # 压缩格式 start_time=int(time.time() * 1000), # 开始时间 end_time=int((time.time() + 3600) * 1000) # 1小时后结束 ) # 创建Kafka投递配置请求 create_kafka_shipper_request = CreateShipperRequest( topic_id=topic_id, shipper_name="kafka-shipper-" + now, shipper_type="kafka", # Kafka投递类型 content_info=content_info_csv, kafka_shipper_info=kafka_shipper_info ) try: create_kafka_response = tls_service.create_shipper(create_kafka_shipper_request) kafka_shipper_id = create_kafka_response.get_shipper_id() print("Kafka投递配置创建成功,shipper_id: {}".format(kafka_shipper_id)) # 验证查询Kafka投递配置 print("\n=== 验证查询Kafka投递配置 ===") try: describe_kafka_request = DescribeShipperRequest(shipper_id=kafka_shipper_id) describe_kafka_response = tls_service.describe_shipper(describe_kafka_request) print("查询Kafka投递配置成功") print("投递配置名称: {}".format(describe_kafka_response.get_shipper_name())) print("投递类型: {}".format(describe_kafka_response.get_shipper_type())) print("Kafka实例: {}".format(describe_kafka_response.get_kafka_shipper_info().instance)) print("Kafka Topic: {}".format(describe_kafka_response.get_kafka_shipper_info().kafka_topic)) except Exception as e: print("查询Kafka投递配置失败: {}".format(str(e))) # 验证修改Kafka投递配置 print("\n=== 验证修改Kafka投递配置 ===") try: # 修改Kafka配置 modified_kafka_info = KafkaShipperInfo( instance="kafka-cnoe27xibel3vjxd", kafka_topic="test1", # 修改Topic名称 compress="gzip" # 修改为gzip压缩 ) modify_kafka_request = ModifyShipperRequest( shipper_id=kafka_shipper_id, shipper_name="modified-kafka-shipper-" + now, kafka_shipper_info=modified_kafka_info, status=True # 启用投递 ) modify_kafka_response = tls_service.modify_shipper(modify_kafka_request) print("修改Kafka投递配置成功") except Exception as e: print("修改Kafka投递配置失败: {}".format(str(e))) except Exception as e: print("Kafka投递配置创建失败: {}".format(str(e))) kafka_shipper_id = None # 示例3:查询投递配置列表 print("\n=== 查询投递配置列表 ===") try: # 查询所有投递配置 describe_shippers_request = DescribeShippersRequest( project_id=project_id, topic_id=topic_id, page_number=1, page_size=20 ) shippers_response = tls_service.describe_shippers(describe_shippers_request) print("查询投递配置列表成功") print("总配置数: {}".format(shippers_response.get_total())) shipper_list = shippers_response.get_shippers() print("获取到 {} 个投递配置".format(len(shipper_list))) for i, shipper in enumerate(shipper_list): print("配置 {}: ID={}, 名称={}, 类型={}, 状态={}".format( i + 1, shipper.shipper_id, shipper.shipper_name, shipper.shipper_type, shipper.status )) except Exception as e: print("查询投递配置列表失败: {}".format(str(e))) # 示例4:按类型筛选查询 print("\n=== 按类型筛选投递配置 ===") try: # 查询TOS类型的投递配置 tos_shippers_request = DescribeShippersRequest( page_number=1, page_size=10 ) tos_shippers_response = tls_service.describe_shippers(tos_shippers_request) print("TOS类型投递配置数: {}".format(tos_shippers_response.get_total())) if tos_shippers_response.get_shippers(): print("第一个投递配置: {}".format( tos_shippers_response.get_shippers()[0].json() )) # 查询Kafka类型的投递配置 kafka_shippers_request = DescribeShippersRequest( shipper_type="kafka", # 筛选Kafka类型 page_number=1, page_size=10 ) kafka_shippers_response = tls_service.describe_shippers(kafka_shippers_request) print("Kafka类型投递配置数: {}".format(kafka_shippers_response.get_total())) if kafka_shippers_response.get_shippers(): print("第一个Kafka配置: {}".format( kafka_shippers_response.get_shippers()[0].json() )) except Exception as e: print("按类型筛选查询失败: {}".format(str(e))) # 清理资源 print("\n=== 清理投递配置 ===") if tos_shipper_id: try: delete_tos_request = DeleteShipperRequest(shipper_id=tos_shipper_id) tls_service.delete_shipper(delete_tos_request) print("TOS投递配置删除成功") except Exception as e: print("TOS投递配置删除失败: {}".format(str(e))) if kafka_shipper_id: try: delete_kafka_request = DeleteShipperRequest(shipper_id=kafka_shipper_id) tls_service.delete_shipper(delete_kafka_request) print("Kafka投递配置删除成功") except Exception as e: print("Kafka投递配置删除失败: {}".format(str(e))) # 删除日志主题和项目 print("\n=== 清理日志资源 ===") delete_topic_request = DeleteTopicRequest(topic_id) tls_service.delete_topic(delete_topic_request) print("日志主题删除成功") tls_service.delete_project(DeleteProjectRequest(project_id)) print("日志项目删除成功") print("\n=== Shipper示例程序执行完成 ===") ================================================ FILE: volcengine/example/tls/example_tag.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) # 为日志项目或日志主题绑定标签 # 请根据您的需要,填写resource_type、resource_list和tags等参数 # AddTagsToResource API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/597772 add_tags_to_resource_req = AddTagsToResourceRequest(resource_type="topic", resources_list=["your-topic-id-1", "your-topic-id-2"], tags=[TagInfo("test-tag-key", "test-tag-value")]) add_tags_to_resource_resp = tls_service.add_tags_to_resource(add_tags_to_resource_req) # 为日志项目或日志主题解绑标签 # 请根据您的需要,填写resource_type、resource_list和tag_key_list等参数 # RemoveTagsFromResource API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/597802 remove_tags_from_resource_req = RemoveTagsFromResourceRequest(resource_type="topic", resources_list=["your-topic-id"], tag_key_list=["test-tag-key"]) remove_tags_from_resource_resp = tls_service.remove_tags_from_resource(remove_tags_from_resource_req) ================================================ FILE: volcengine/example/tls/example_topic.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.get_project_id() # 创建日志主题 # 请根据您的需要,填写project_id、topic_name、ttl、shard_count和description等参数 # CreateTopic API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112180 create_topic_request = CreateTopicRequest( topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2, enable_hot_ttl=True, hot_ttl=30, cold_ttl=70, archive_ttl=3550, ) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 查询指定日志主题信息 # 请根据您的需要,填写待查询的topic_id # DescribeTopic API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112184 describe_topic_request = DescribeTopicRequest(topic_id) describe_topic_response = tls_service.describe_topic(describe_topic_request) print("topic id: {}".format(describe_topic_response.get_topic().get_topic_id())) # 修改日志主题 # 请根据您的需要,填写topic_id以及待修改的各项参数 # ModifyTopic API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112183 modify_topic_request = ModifyTopicRequest( topic_id, topic_name="change-topic-name", description="change-topic-description", ttl=3650, enable_hot_ttl=True, hot_ttl=100, cold_ttl=100, archive_ttl=3450, ) modify_topic_response = tls_service.modify_topic(modify_topic_request) # 查询所有日志主题信息 # 请根据您的需要,填写待查询的project_id # DescribeTopics API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112185 describe_topics_request = DescribeTopicsRequest( project_id, project_name="project-name", ) describe_topics_response = tls_service.describe_topics(describe_topics_request) if describe_topics_response.get_total() > 0: print("topics total: {}\nfirst topic name: {}".format(describe_topics_response.get_total(), describe_topics_response.get_topics()[0].get_topic_name())) else: print("no topics") # 删除日志主题 # 请根据您的需要,填写待删除的topic_id # DeleteTopic API的请求参数规范请参阅 https://www.volcengine.com/docs/6470/112182 delete_topic_request = DeleteTopicRequest(topic_id) delete_topic_response = tls_service.delete_topic(delete_topic_request) # 删除日志项目 tls_service.delete_project(DeleteProjectRequest(project_id)) ================================================ FILE: volcengine/example/vedit/__init__.py ================================================ ================================================ FILE: volcengine/example/vedit/example_edit.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vedit.VEditService import VEditService if __name__ == '__main__': edit_service = VEditService() # call below method if you dont set ak and sk in $HOME/.vcloud/config # edit_service.set_ak('ak') # edit_service.set_sk('sk') body = {} body["EditParam"] = { "Upload": { "Uploader": "your uploader", "VideoName": "your video name" }, "Output": { "Fps": 25, "Height": 720, "Quality": "medium", "Width": 1280 }, "Segments": [{ "BackGround": "0xFFFFFFFF", "Duration": 3, "Elements": [], "Volume": 1 }], "GlobalElements": [] } body["Priority"] = 0 body["CallbackArgs"] = "your callback args" body["CallbackUri"] = "your callback uri" body = json.dumps(body) resp = edit_service.submit_direct_edit_task_async(body) print(resp) print("****") body = {} body["ReqIds"] = ["your req id 1", "your req id 2"] body = json.dumps(body) resp = edit_service.get_direct_edit_result(body) print(resp) ================================================ FILE: volcengine/example/veen/__init__.py ================================================ ak = '' sk = '' ================================================ FILE: volcengine/example/veen/attach_ebs.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "ebs_id": "disk-t9p44586fn6cbs9", "ebs_ids": ["disk-t9p44586fn6cbs9"], "res_type": "veen", "res_id": "testing2-veen92023710333272539522", "delete_with_res": True, } resp = svc.attach_ebs(body) print(resp) ================================================ FILE: volcengine/example/veen/batch_reset_system.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identities": ["veen26301302623093022820", "testing-veen23323035425312030023"], "image_identity": "image7ajpdaodf7", "clear_data_disk": False, } resp = svc.batch_reset_system(body) print(resp) ================================================ FILE: volcengine/example/veen/create_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "cloudserver_name": "test-sdk", "image_id": "imagekhvhgzhna6", "spec_name": "veEN.C1.large", "storage_config": { "system_disk": {"capacity": "40", "storage_type": "CloudBlockSSD"}, "data_disk_list": [ {"capacity": "20", "storage_type": "CloudBlockSSD"}, {"capacity": "40", "storage_type": "CloudBlockSSD"}, ], }, "network_config": { "bandwidth_peak": "200", "enable_ipv6": False, }, "secret_config": {"secret_type": 2, "secret_data": "Abcd1234*"}, "instance_area_nums": [ {"cluster_name": "bdcdn-ycct", "num": 2} ], "billing_config": { "computing_billing_method": "MonthlyPeak", "bandwidth_billing_method": "MonthlyP95", }, } resp = svc.create_cloudserver(body) print(resp) ================================================ FILE: volcengine/example/veen/create_ebs_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "cluster_name": "bdcdn-chdcu", "charge_type": "HourUsed", "ebs_type": "data", "storage_type": "CloudBlockHDD", "capacity": "200", "number": 1, "name": "ebs_test_yx", "desc": "test", "project": "", "delete_with_res": True, "res_id": "veen-xxxxx", } resp = svc.create_ebs_instances(body) print(resp) ================================================ FILE: volcengine/example/veen/create_instance.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "cloud_server_identity": "cloudserver-8fz56vmnzbwcv99", "instance_area_nums": [ {"cluster_name": "bdcdn-ycct", "num": 1} ], } resp = svc.create_instance(body) print(resp) ================================================ FILE: volcengine/example/veen/delete_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = {"cloud_server_id": "cloudserver-8fz56vmnzbwcv99"} resp = svc.delete_cloudserver(body) print(resp) ================================================ FILE: volcengine/example/veen/delete_ebs_instance.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "ebs_id": "disk-t9p44586fn6cbs9", "ebs_ids": ["disk-t9p44586fn6cbs9"], } resp = svc.delete_ebs_instance(body) print(resp) ================================================ FILE: volcengine/example/veen/detach_ebs.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "ebs_id": "disk-t9p44586fn6cbs9", "ebs_ids": ["disk-t9p44586fn6cbs9"], } resp = svc.detach_ebs(body) print(resp) ================================================ FILE: volcengine/example/veen/get_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = {"cloud_server_id": "cloudserver-8fz56vmnzbwcv99"} resp = svc.get_cloudserver(query) print(resp) ================================================ FILE: volcengine/example/veen/get_ebs_instance.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "ebs_id": "disk-t9p44586fn6cbs9", "with_attachment_info": True, } resp = svc.get_ebs_instance(body) print(resp) ================================================ FILE: volcengine/example/veen/get_instance.py ================================================ # -*- coding: utf-8 -*- import os import sys import json sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = { "instance_identity": "veen26301302623093022820", } resp = svc.get_instance(query) print(resp) ================================================ FILE: volcengine/example/veen/get_instance_cloud_disk_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = { "instance_identity": "veen26301302623093022820", } resp = svc.get_instance_cloud_disk_info(query) print(resp) ================================================ FILE: volcengine/example/veen/list_available_resource_info.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = {"instance_type": "veEN.C1.large", "cloud_disk_type": "CloudSSD"} resp = svc.list_available_resource_info(query) print(resp) ================================================ FILE: volcengine/example/veen/list_cloudservers.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = {"fuzzy_name": "sdk", "page": 1, "limit": 10, "order_by": 2} resp = svc.list_cloudservers(query) print(resp) ================================================ FILE: volcengine/example/veen/list_ebs_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "with_attachment_info": True, "res_ids": ["testing2-veen92023710333272539522"], "ebs_ids": ["disk-t9p44586fn6cbs9"], "ebs_names": ["本地_虚机测试用-3"], "regions": ["CentralChina"], "cluster_names": ["nbct05-testing3"], "status": ["attached"], "ebs_type": ["data"], "charge_type": ["HourUsed"], "fuzzy_veen_external_ip": "172.19.23.230", "delete_with_res": True, "fuzzy_ebs_id_or_name": "disk-t9p44586fn6cbs9", "page_option": { "page_no": 1, "page_size": 10, }, "order_option": { "order_by": "ebs_id", "asc": True, }, } resp = svc.list_ebs_instances(body) print(resp) ================================================ FILE: volcengine/example/veen/list_instance_types.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = {} resp = svc.list_instance_types(query) print(resp) ================================================ FILE: volcengine/example/veen/list_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys import json sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) query = { "regions": "SouthChina,Northwest", "cities": "440300,640100", "isps": "CTCC,CMCC_CTCC_CUCC", "status": "opening,running", "page": 2, "limit": 2, "order_by": 2 } resp = svc.list_instances(query) print(resp) ================================================ FILE: volcengine/example/veen/offline_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identities": [ "veen26301302623093022820", "veen25200031222138400005", "veen38855042004824221584", ], "ignore_running": True, } resp = svc.offline_instances(body) print(resp) ================================================ FILE: volcengine/example/veen/reboot_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = {"cloud_server_id": "cloudserver-8fz56vmnzbwcv99"} resp = svc.reboot_cloudserver(body) print(resp) ================================================ FILE: volcengine/example/veen/reboot_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identities": ["veen26301302623093022820", "veen25200031222138400005"] } resp = svc.reboot_instances(body) print(resp) ================================================ FILE: volcengine/example/veen/reset_login_credential.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identity": "veen26301302623093022820", "secret_type": 2, "secret_data": "Abcd1234&" } resp = svc.reset_login_credential(body) print(resp) ================================================ FILE: volcengine/example/veen/scale_ebs_instance_capacity.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "ebs_id": "disk-t9p44586fn6cbs9", "capacity": "200", "with_reboot": True, } resp = svc.scale_ebs_instance_capacity(body) print(resp) ================================================ FILE: volcengine/example/veen/scale_instance_cloud_disk_capacity.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identity": "veen26301302623093022820", "scale_system_cloud_disk_info": {"device_name": "vda", "capacity": "1000"}, "scale_data_cloud_disk_info_list": [{"device_name": "vdb", "capacity": "1000"}], "with_reboot": True, } resp = svc.scale_instance_cloud_disk_capacity(body) print(resp) ================================================ FILE: volcengine/example/veen/set_instance_name.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identity": "veen26301302623093022820", "instance_name": "sdk测试", } resp = svc.set_instance_name(body) print(resp) ================================================ FILE: volcengine/example/veen/start_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = {"cloud_server_id": "cloudserver-8fz56vmnzbwcv99"} resp = svc.start_cloudserver(body) print(resp) ================================================ FILE: volcengine/example/veen/start_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identities": ["veen26301302623093022820", "veen25200031222138400005"] } resp = svc.start_instances(body) print(resp) ================================================ FILE: volcengine/example/veen/stop_cloudserver.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = {"cloud_server_id": "cloudserver-8fz56vmnzbwcv99"} resp = svc.stop_cloudserver(body) print(resp) ================================================ FILE: volcengine/example/veen/stop_instances.py ================================================ # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../") from volcengine.example.veen import ak, sk from volcengine.veen.service import VeenService if __name__ == "__main__": svc = VeenService() svc.set_ak(ak) svc.set_sk(sk) body = { "instance_identities": ["veen26301302623093022820", "veen25200031222138400005"] } resp = svc.stop_instances(body) print(resp) ================================================ FILE: volcengine/example/verender/add_render_setting_demo.py ================================================ import verender_init def add_render_setting_demo(): v = verender_init.get_verender_instance() user = v.get_current_user() params = { "WorkspaceId": 1935 } body = { "AccountId": user["AccountId"], "UserId": user["UserId"], "WorkspaceId": 1935, "Name": "test-render-setting-2111", "Dcc": "maya", "DccVersion": "2022.3", "Plugins": [ { "Name": "mtoa", "Version": "5.1.3", "RenderPlugin": True, "NeedLicense": True } ], "RenderLayerMode": "LegacyRenderLayer", "ProjectPath": "", "FramesCountOneCell": 1, "CellSpecId": 15 } resp = v.add_render_setting(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/auto_full_speed_render_jobs_demo.py ================================================ import verender_init def auto_full_speed_render_jobs_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 19931 } body = { "JobIds": [ "r377a81d87e" ] } resp = v.auto_full_speed_render_jobs(params, body) print(resp) ================================================ FILE: volcengine/example/verender/create_render_setting_demo.py ================================================ import verender_init def create_render_job_demo(v): v = verender_init.get_verender_instance() workspace_id = 1993 params = { "WorkspaceId": workspace_id, } # upload file src = "D:\\car-studio\\Studio_Top.ma" des = "D:\\car-studio\\Studio_Top.ma" isp = "ct" obj = v.upload_file(workspace_id, src, des, isp) # get render setting user = v.get_current_user() p = { "AccountId": user["AccountId"], "UserId": user["UserId"], "WorkspaceId": workspace_id, "CheckUserId": False, "WithDeleted": True, "Id": 368 } rs = v.get_render_setting(params=p) body = { "Title": "test-create-render-job", "Description": "volc-sdk-python", "Tryout": False, "SceneFile": obj.name, "TimeoutReminderEachFrame": 86400, "TimeoutStopperEachFrame": 86400, "LayerConfig": [ { "LayerIndex": 0, "LayerName": "masterLayer", "Frame": { "Start": 1, "End": 10, "Step": 1 }, "Resolutions": { "Height": 1080, "Width": 1920 }, "Cameras": ["文件内设置"], "PluginData": "{}", "Renderer": "mtoa" } ], "RenderSetting": rs, "FramesCountEachCell": 8 } resp = v.create_render_job(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/delete_render_jobs_demo.py ================================================ import verender_init def delete_render_jobs_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } body = { "JobIds": [ "r003ebaa720" ] } resp = v.delete_render_jobs(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/delete_render_setting_demo.py ================================================ import verender_init def delete_render_setting_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993, "RenderSettingId": 361 } resp = v.delete_render_setting(params=params) print(resp) ================================================ FILE: volcengine/example/verender/download_file_demo.py ================================================ import verender_init def download_file_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 src = "D/tests/test_upload_file/test_upload_file.txt" des = "D:\\tests\\test_upload_file\\test_upload_file.txt" isp = "ct" # ct: 电信 un: 联通 cm: 移动 f = v.download_file(workspace_id, src, des, isp) print(f) ================================================ FILE: volcengine/example/verender/full_speed_render_jobs_demo.py ================================================ import verender_init def full_speed_render_jobs_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } body = { "JobIds": [ "r90ea40ecbd", "r041853ab30" ] } resp = v.full_speed_render_jobs(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/get_current_user_demo.py ================================================ import verender_init def get_current_user_demo(): v = verender_init.get_verender_instance() resp = v.get_current_user() print(resp) ================================================ FILE: volcengine/example/verender/get_job_output_demo.py ================================================ import verender_init def get_job_output_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1802, "JobId": "rf19285eae5" } body = { "Layers": { "masterLayer": { "Frames": [1, 2, 3], "IncludeThumb": True, "IncludeImage": True } } } resp = v.get_job_output(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/get_render_job_demo.py ================================================ import verender_init def get_render_job_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993, "RenderJobId": "r776bf384a4" } resp = v.get_render_job(params=params) print(resp) ================================================ FILE: volcengine/example/verender/get_render_setting_demo.py ================================================ import verender_init def get_render_setting_demo(): v = verender_init.get_verender_instance() user = v.get_current_user() params = { "AccountId": user["AccountId"], "UserId": user["UserId"], "WorkspaceId": 1993, "Id": 360 } resp = v.get_render_setting(params=params) print(resp) ================================================ FILE: volcengine/example/verender/list_account_dcc_plugins_demo.py ================================================ import verender_init def list_account_dcc_plugins_demo(): v = verender_init.get_verender_instance() params = { "SpecTemplateId": 15, "Dcc": "maya", "DccVersion": "2022.3" } resp = v.list_account_dcc_plugin(params=params) print(resp) ================================================ FILE: volcengine/example/verender/list_cell_spec_demo.py ================================================ import verender_init def list_cell_spec_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 735 } resp = v.list_cell_spec(params=params) print(resp) ================================================ FILE: volcengine/example/verender/list_dcc_demo.py ================================================ import verender_init def list_dcc_demo(): v = verender_init.get_verender_instance() resp = v.list_dcc() print(resp) ================================================ FILE: volcengine/example/verender/list_file_demo.py ================================================ import verender_init def list_file_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 prefix = "D/tests" filter_in = "" order_type = "asc" # asc or desc order_field = "name" # name or mtime page_num = 1 page_size = 10 isp = "ct" # ct: 电信 un: 联通 cm: 移动 total, file_info_list = v.list_file(workspace_id, prefix, filter_in, order_type, order_field, page_num, page_size, isp) print(total) print(file_info_list) ================================================ FILE: volcengine/example/verender/list_job_output_demo.py ================================================ import verender_init def list_job_output_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1802 } body = { "StartTime": "2023-08-01T00:00:00+08:00", "EndTime": "2023-08-14T00:00:00+08:00", "PageNum": 1, "PageSize": 100, "Type": "all", # all, image(渲染结果), thumb(缩略图) "Status": "all", # all, new(未下载过的记录) "OrderType": "asc", # asc, desc "OrderField": "created_at", # 暂不支持其他 "JobIdList": ["job_id1", "job_id2"] # 单次建议不超过10个 } resp = v.list_job_output(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/list_render_job_demo.py ================================================ import verender_init def list_render_job_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } resp = v.list_render_job(params=params) print(resp) ================================================ FILE: volcengine/example/verender/list_render_setting_demo.py ================================================ import verender_init def list_render_setting_demo(): v = verender_init.get_verender_instance() user = v.get_current_user() params = { "AccountId": user["AccountId"], "UserId": user["UserId"], "WorkspaceId": 1993, "Dcc": "maya" } resp = v.list_render_setting(params=params) print(resp) ================================================ FILE: volcengine/example/verender/list_workspace_demo.py ================================================ import verender_init def list_workspace_demo(): v = verender_init.get_verender_instance() params = { "PageNum": 1, "PageSize": 10 } resp = v.list_workspace(params) print(resp) ================================================ FILE: volcengine/example/verender/remove_file_demo.py ================================================ import verender_init def remove_file_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 filename = "D/tests/test_upload_file/test_upload_file.txt" isp = "ct" # ct: 电信 un: 联通 cm: 移动 v.remove_file(workspace_id, filename, isp) ================================================ FILE: volcengine/example/verender/resume_render_jobs_demo.py ================================================ import verender_init def resume_render_jobs_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } body = { "JobIds": [ "r776bf384a4" ] } resp = v.resume_render_jobs(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/retry_render_job_demo.py ================================================ import verender_init def retry_render_job_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993, "RenderJobId": "r5ad3829bef" } body = { "JobId": "r5ad3829bef", "AllFailedFrames": True, "CustomFrames": [ { "LayerIndex": 0, "FrameIndexes": "1-5" } ] } resp = v.retry_render_job(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/stat_file_demo.py ================================================ import verender_init def stat_file_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 filename = "D/tests/test_upload_file/test_upload_file.txt" isp = "un" # ct: 电信 un: 联通 cm: 移动 f = v.stat_file(workspace_id, filename, isp) print(f.name, f.size, f.mtime, f.md5) ================================================ FILE: volcengine/example/verender/stop_render_jobs_demo.py ================================================ import verender_init def stop_render_jobs_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } body = { "JobIds": [ "r003ebaa720" ] } resp = v.stop_render_jobs(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/update_job_output_demo.py ================================================ import verender_init def update_job_output_demo(): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1802, "JobId": "abc" } body = { "files": [ "Result/test-create-render-job_rf19285eae5/images/simple.exr.0001" ] } resp = v.update_job_output(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/update_render_jobs_priority_demo.py ================================================ import verender_init def update_render_jobs_priority_demo(v): v = verender_init.get_verender_instance() params = { "WorkspaceId": 1993 } body = { "JobIds": [ "r90ea40ecbd", "r041853ab30" ], "Priority": 10 } resp = v.update_render_jobs_priority(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/update_render_setting_dem.py ================================================ import verender_init def update_render_setting_demo(): v = verender_init.get_verender_instance() user = v.get_current_user() params = { "WorkspaceId": 1993, "RenderSettingId": 360 } body = { "AccountId": user["AccountId"], "UserId": user["UserId"], "WorkspaceId": 1993, "Name": "test-render-setting-1", "Dcc": "maya", "DccVersion": "2022", "Plugins": [ { "Name": "mtoa", "Version": "5.1.2", "RenderPlugin": True, "NeedLicense": True } ], "RenderLayerMode": "LegacyRenderLayer", "ProjectPath": "", "FrameOneCell": 2, "CellSpecId": 9 } resp = v.update_render_setting(params=params, body=body) print(resp) ================================================ FILE: volcengine/example/verender/upload_file_demo.py ================================================ import verender_init def upload_file_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 src = "D:\\tests\\test_upload_file\\test_upload_file.txt" des = "D:\\tests\\test_upload_file\\test_upload_file.txt" isp = "ct" # ct: 电信 un: 联通 cm: 移动 f = v.upload_file(workspace_id, src, des, isp) print(f.name, f.size, f.mtime, f.md5) ================================================ FILE: volcengine/example/verender/upload_folder_demo.py ================================================ import verender_init def upload_folder_demo(): v = verender_init.get_verender_instance() workspace_id = 1935 src_path = "D:\\tests\\test_upload_folder" des_path = "D:\\tests\\test_upload_folder" isp = "un" # ct: 电信 un: 联通 cm: 移动 v.upload_folder(workspace_id, src_path, des_path, isp) ================================================ FILE: volcengine/example/verender/verender_init.py ================================================ from volcengine.verender.VerenderService import VerenderService def get_verender_instance(): # ftrans_client_addr是快传客户端的地址 不配置走S10 传输速度会低于快传客户端 # ftrans_proxy_addr是代理的管理地址 无代理不需要填 v = VerenderService(ftrans_client_addr="127.0.0.1:8899", ftrans_proxy_addr="10.1.1.1:30001") v.set_ak("your ak") v.set_sk("your sk") return v ================================================ FILE: volcengine/example/viking_db/__init__.py ================================================ ================================================ FILE: volcengine/example/viking_db/collection_create.py ================================================ import utils import volcengine.viking_db as vkdb if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() fields = [ vkdb.Field(field_name="f_id", field_type=vkdb.FieldType.String, is_primary_key=True), vkdb.Field(field_name="f_string", field_type=vkdb.FieldType.String, default_val=""), vkdb.Field(field_name="f_int64", field_type=vkdb.FieldType.Int64, default_val=0), vkdb.Field(field_name="f_text", field_type=vkdb.FieldType.Text, default_val=0, pipeline_name="text_doubao_embedding_and_m3"), ] collection = vikingdb_service.create_collection("test_coll_for_sdk", fields=fields, description="test for sdk") print(collection.collection_name) print(collection.description) ================================================ FILE: volcengine/example/viking_db/collection_create_with_vectorize.py ================================================ import utils import volcengine.viking_db as vkdb if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() fields = [ vkdb.Field(field_name="f_id", field_type=vkdb.FieldType.String, is_primary_key=True), vkdb.Field(field_name="f_string", field_type=vkdb.FieldType.String, default_val=""), vkdb.Field(field_name="f_text1", field_type=vkdb.FieldType.Text), vkdb.Field(field_name="f_text2", field_type=vkdb.FieldType.Text), vkdb.Field(field_name="f_image1", field_type=vkdb.FieldType.Image), vkdb.Field(field_name="f_image2", field_type=vkdb.FieldType.Image), ] vectorize = [vkdb.VectorizeTuple( dense=vkdb.VectorizeModelConf( model_name="doubao-embedding-vision", model_version="241215", text_field="f_text1", image_field="f_image1", dim=3072, ), sparse=vkdb.VectorizeModelConf( model_name="bge-m3", text_field="f_text1", ) )] collection = vikingdb_service.create_collection("test_coll_for_sdk_with_vectorize", fields=fields, description="test for sdk", vectorize=vectorize) print(collection.collection_name) print(collection.description) print(collection.vectorize) ================================================ FILE: volcengine/example/viking_db/collection_drop.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection = vikingdb_service.drop_collection("test_coll_for_sdk") ================================================ FILE: volcengine/example/viking_db/collection_get.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection = vikingdb_service.get_collection("test_coll_for_sdk_with_vectorize") print(collection.collection_name) print(collection.description) print(collection.vectorize) ================================================ FILE: volcengine/example/viking_db/collection_list.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection_list = vikingdb_service.list_collections() for collection in collection_list: print(collection.collection_name) print(collection.description) print(collection.vectorize) ================================================ FILE: volcengine/example/viking_db/data_fetch_by_collection.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection = vikingdb_service.get_collection("test_coll_for_sdk") datas = collection.fetch_data(["1", "2", "3"]) for data in datas: print(data.id, data.fields, data.TTL) ================================================ FILE: volcengine/example/viking_db/data_fetch_by_index.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk", "index_hnsw_hybrid") datas = index.fetch_data(["1", "2", "3"]) for data in datas: print(data.id, data.fields) ================================================ FILE: volcengine/example/viking_db/data_upsert.py ================================================ import utils import random import string import volcengine.viking_db as vkdb if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection = vikingdb_service.get_collection("test_coll_for_sdk") datas = [] for i in range(100): data = vkdb.Data( id="1", fields={ "f_id": str(i+1), "f_string": "doc"+str(i / 10), "f_int64": random.randint(1, 100), "f_text": "this is " + ''.join(random.choice(string.ascii_letters[:10]) for _ in range(50)), } ) datas.append(data) collection.upsert_data(datas) ================================================ FILE: volcengine/example/viking_db/example.py ================================================ import asyncio import base64 import os, sys import random from volcengine.viking_db import * sys.path.insert(0, "/data00/home/xiejianqiao.1027/project/volc-sdk-python/volcengine") # from ...viking_db import VikingDBService, Field, FieldType # from ../../viking_db import * if __name__ == '__main__': vikingdb_service = VikingDBService() vikingdb_service.set_ak() vikingdb_service.set_sk() # id = vikingdb_service.create_task(TaskType.Filter_Delete, {"collection_name": "example", "filter": {"like": [2]}}) # print(id) # res = vikingdb_service.update_task("ae6f9a4e-9a68-5374-9687-36017c1ddd3e", task_status=TaskStatus.Confirmed) # id = vikingdb_service.create_task(TaskType.Data_Import, {"tos_path": "demo-1028/demo_1030", "file_type":"json", "ignore_error":False, "collection_name":"sparse"}) # print(id) # task = vikingdb_service.get_task("bc5e952d-3f95-5e0c-b310-548933890308") # print(task.task_status) # tasks = vikingdb_service.list_tasks() # for item in tasks: # print(item.process_info) # res = vikingdb_service.drop_task("01f7f554-46b9-55d6-af6c-b2aa9502d229") # dense_sparse # fields = [ # Field( # field_name="id", # field_type=FieldType.String, # is_primary_key=True # ), # Field( # field_name="vector", # field_type=FieldType.Vector, # dim=10 # ), # Field( # field_name="sparse", # field_type=FieldType.Sparse_Vector, # default_val=0 # ), # ] # res = vikingdb_service.create_collection("sparse", fields) # print(res) # res = vikingdb_service.get_collection("sparse") # for item in res.fields: # print(item.field_type, item.field_name) def gen_random_vector(dim): res = [0, ] * dim for i in range(dim): res[i] = random.random() - 0.5 return res # collection = vikingdb_service.get_collection("sparse") # field1 = {"id": "111", "vector": gen_random_vector(10), "sparse": {"hello1": 0.01, "world1": 0.02}} # field2 = {"id": "222", "vector": gen_random_vector(10), "sparse": {"hello2": 0.02, "world2": 0.03}} # field3 = {"id": "333", "vector": gen_random_vector(10), "sparse": {"hello3": 0.03, "world3": 0.04}} # field4 = {"id": "444", "vector": gen_random_vector(10), "sparse": {"hello4": 0.04, "world4": 0.05}} # data1 = Data(field1) # data2 = Data(field2) # data3 = Data(field3) # data4 = Data(field4) # datas = [data1, data2, data3, data4] # collection.upsert_data(datas) # collection = vikingdb_service.get_collection("example") # res = collection.fetch_data(555) # print(res.fields) # vector_index = VectorIndexParams(distance=DistanceType.COSINE, index_type=IndexType.HNSW_HYBRID, # quant=QuantType.Float) # res = vikingdb_service.create_index("sparse", "sparse", vector_index) # res = vikingdb_service.get_index("sparse", "sparse") # print(res.vector_index) # index = vikingdb_service.get_index("sparse_go", "sparse_go_test5") # res = index.search_by_vector(vector=gen_random_vector(12), sparse_vectors={"he": 0.05}, dense_weight=0.1, retry=True) # print(res) # index = vikingdb_service.get_index("sparse_go", "sparse_go_test5") # res = index.search_by_id("111", dense_weight=0.1) # print(res) # index = vikingdb_service.get_index("sparse", "sparse") # res = index.search_by_id("111", dense_weight=0.1) # print(res) # index = vikingdb_service.get_index("sparse", "sparse") # res = index.search(VectorOrder(vector=gen_random_vector(10), sparse_vectors={"he": 0.05}), dense_weight=0.1) # print(res) # list = [RawData("text", "hello1"), RawData("text", "hello2")] # res = vikingdb_service.embedding_v2(EmbModel("bge-m3"), list) # print(res) # datas = [{ # "query": "退改", # "content": "如果您需要人工服务,可以拨打人工客服电话:4006660921", # "title": "无" # }, { # "query": "退改", # "content": "1、1日票 1.5日票 2日票的退款政策: -到访日前2天的00:00前,免费退款 - 到访日前2天的00:00至到访日前夜23:59期间,退款需扣除服务费(人民币80元) - 到访日当天(00:00 之后),不可退款 2、半日票的退款政策: - 未使用的们票可在所选入...", # "title": "门票退改政策|北京环球影城的门票退改政策" # }, { # "query": "退改", # "content": "如果您需要人工服务,可以拨打人工客服电话:4006660921", # }] # res = vikingdb_service.batch_rerank(datas) # print(res) # 写给用户的样例 # fields = [ # Field( # field_name="doc_id", # field_type=FieldType.String, # is_primary_key=True # ), # Field( # field_name="text_vector", # field_type=FieldType.Vector, # dim=12 # ), # Field( # field_name="like", # field_type=FieldType.Int64, # default_val=0 # ), # Field( # field_name="price", # field_type=FieldType.Float32, # default_val=0 # ), # Field( # field_name="author", # field_type=FieldType.List_String, # default_val=[] # ), # Field( # field_name="aim", # field_type=FieldType.Bool, # default_val=True # ), # ] # res = vikingdb_service.create_collection("example", fields, "This is an example") # # 返回一个collection实例 # print(res) # # res = vikingdb_service.get_collection("example") # # 返回一个collection实例 # print(res.update_person) # # # vikingdb_service.drop_collection("example") # 无返回 # # res = vikingdb_service.list_collections() # 返回一个列表 # for item in res: # print(item.indexes) # # vector_index = VectorIndexParams(distance=DistanceType.COSINE,index_type=IndexType.DiskANN, # quant=QuantType.Float) # res = vikingdb_service.create_index("example1","example1", vector_index, cpu_quota=2, # description="This is an index", scalar_index=['price', 'like'], shard_policy=ShardType.Custom, shard_count=10) # # 返回一个index实例 # print(res) # # res = vikingdb_service.get_index("example", "example") # 返回一个index实例 # print(res.shard_count, res.shard_policy) # # vikingdb_service.drop_index("example", "example") # 无返回 # # res = vikingdb_service.list_indexes("example") # 返回一个列表 # for item in res: # print(item.shard_count) # print(item.shard_policy) # print(item.update_time) # print(item.create_time) # # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # collection = vikingdb_service.get_collection("example") # field1 = {"doc_id": "111", "text_vector": gen_random_vector(12), "like": 1, "price": 1.11, # "author": ["gy"], "aim": True} # field2 = {"doc_id": "222", "text_vector": gen_random_vector(12), "like": 2, "price": 2.22, # "author": ["gy", "xjq"], "aim": False} # field3 = {"doc_id": "333", "text_vector": gen_random_vector(12), "like": 3, "price": 3.33, # "author": ["gy", "xjq"], "aim": False} # field4 = {"doc_id": "444", "text_vector": gen_random_vector(12), "like": 4, "price": 4.44, # "author": ["gy", "xjq"], "aim": False} # data1 = Data(field1) # data2 = Data(field2) # data3 = Data(field3) # data4 = Data(field4) # datas = [] # datas.append(data1) # datas.append(data2) # datas.append(data3) # datas.append(data4) # collection.upsert_data(datas) # 无返回 # # collection = vikingdb_service.get_collection("example") # res = collection.fetch_data("333") # print(res.fields) # res = collection.fetch_data(["111", "222", "333", "444"]) # # 返回一个列表 # for item in res: # print(item) # print(item.fields) # # collection = vikingdb_service.get_collection("example") # collection.delete_data("11") # 无返回 # # index = vikingdb_service.get_index("sparse_go", "sparse_go_test5") # res = index.fetch_data(["111"]) # # 返回一个列表 # for item in res: # print(item) # print(item.fields) # # index = vikingdb_service.get_index("sparse_go", "sparse_go_test5") # res = index.search_by_vector(gen_random_vector(10), sparse_vectors={'1':1.1}) # # 返回一个列表 # print(res) # index = vikingdb_service.get_index("example", "example_index") # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # res = index.search_by_vector(gen_random_vector(10), limit=2, output_fields=["doc_id", "like", "text_vector"], # ) # 返回一个列表 # for item in res: # print(item) # print(item.score) # # index = vikingdb_service.get_index("example", "example_index") # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # res = index.search(order=VectorOrder(gen_random_vector(10)), limit=2, # output_fields=["doc_id", "like", "text_vector"], # filter={"op": "range", "field": "price", "lt": 3.5}) # 返回一个列表 # for item in res: # print(item) # print(item.score) # res = index.search(order=ScalarOrder("price", Order.Desc), limit=6, # output_fields=["price"], # filter={"op": "range", "field": "price", "lt": 5}) # # 返回一个列表 # for item in res: # print(item) # print(item.score) # index = vikingdb_service.get_index("example", "example_index") # res = index.search(limit=5, output_fields=["doc_id", "like"], # filter={"op": "range", "field": "price", "lt": 3.5}) # 返回一个列表 # for item in res: # print(item.fields) # print(item.score) # # 含有text字段的测试 # fields = [ # Field( # field_name="doc_id", # field_type=FieldType.String, # is_primary_key=True # ), # Field( # field_name="text", # field_type=FieldType.Text, # pipeline_name="text_split_bge_large_zh" # ), # Field( # field_name="like", # field_type=FieldType.Int64, # default_val=0 # ), # Field( # field_name="price", # field_type=FieldType.Float32, # default_val=0 # ), # Field( # field_name="author", # field_type=FieldType.List_String, # default_val=[] # ), # Field( # field_name="aim", # field_type=FieldType.Bool, # default_val=True # ), # ] # res = vikingdb_service.create_collection("example_text", fields, "This is an example include text") # # vector_index = VectorIndexParams(distance=DistanceType.IP, index_type=IndexType.FLAT, # quant=QuantType.Int8) # res = vikingdb_service.create_index("example", "example1") # # collection = vikingdb_service.get_collection("example_text") # field1 = {"doc_id": "11", "text": {"text":"this is one"}, "like": 1, "price": 1.11, # "author": ["gy"], "aim": True} # field2 = {"doc_id": "22", "text": {"text":"this is two"}, "like": 2, "price": 2.22, # "author": ["gy", "xjq"], "aim": False} # field3 = {"doc_id": "33", "text": {"text":"this is three"}, "like": 1, "price": 3.33, # "author": ["gy", "xjq"], "aim": False} # field4 = {"doc_id": "44", "text": {"text":"this is four"}, "like": 1, "price": 4.44, # "author": ["gy", "xjq"], "aim": False} # data1 = Data(field1) # data2 = Data(field2) # data3 = Data(field3) # data4 = Data(field4) # datas = [] # datas.append(data1) # datas.append(data2) # datas.append(data3) # datas.append(data4) # collection.upsert_data(datas) # 无返回 # # index = vikingdb_service.get_index("example_text", "example_index_text") # res = index.search_by_text(Text(text="this is five"), filter={"op": "range", "field": "price", "lt": 4}, # limit=3, output_fields=["doc_id", "text", "price", "like"], partition=1) # for item in res: # print(item) # print(item.text) # list = [RawData("text","hello1"), RawData("text","hello2")] # res = vikingdb_service.embedding(EmbModel("bge_large_zh"), list) # print(res) # for item in res: # print(item) # fields = [ # Field( # field_name="like1", # field_type=FieldType.Float32, # default_val=0 # ), # Field( # field_name="price1", # field_type=FieldType.String, # default_val="" # ), # ] # vikingdb_service.update_collection("example",fields,description="change") # res = vikingdb_service.get_collection("example") # print(res.description) # for field in res.fields: # print(field.field_name) # print(field.field_type) # print(field.default_val) # print(field.dim) # print(field.pipeline_name) # print("--------------------") # res = vikingdb_service.get_index("example", "example_index") # print(res.description) # print(res.cpu_quota) # print(res.scalar_index) # # vikingdb_service.update_index("example", "example_index", shard_count=3) # # res = vikingdb_service.get_index("example", "example_index") # print(res.description) # print(res.cpu_quota) # print(res.scalar_index) # score = vikingdb_service.rerank("退改", "如果您需要人工服务,可以拨打人工客服电话:4006660921", "转人工") # print(score) # async def create_collection(): # fields = [ # Field( # field_name="doc_id", # field_type=FieldType.String, # is_primary_key=True # ), # Field( # field_name="text_vector", # field_type=FieldType.Vector, # dim=10 # ), # Field( # field_name="like", # field_type=FieldType.Int64, # default_val=0 # ), # Field( # field_name="price", # field_type=FieldType.Float32, # default_val=0 # ), # Field( # field_name="author", # field_type=FieldType.List_String, # default_val=[] # ), # Field( # field_name="aim", # field_type=FieldType.Bool, # default_val=True # ), # ] # res = await vikingdb_service.async_create_collection("async", fields, "This is an example") # print(res) # async def get_collection(): # res = await vikingdb_service.async_get_collection("async") # for item in res.fields: # print(item.field_type, item.field_name) # async def del_collection(): # await vikingdb_service.async_drop_collection("async") # async def list_collections(): # res = await vikingdb_service.async_list_collections() # print(res) # async def create_index(): # vector_index = VectorIndexParams(distance=DistanceType.COSINE, index_type=IndexType.HNSW, # quant=QuantType.Float) # res = await vikingdb_service.async_create_index("async", "async", vector_index, cpu_quota=2, # description="This is an index", scalar_index=['price', 'like'], shard_policy=ShardType.Custom, shard_count=10) # print(res) # async def get_index(): # res = await vikingdb_service.async_get_index("async", "async") # print(res.shard_count, res.shard_policy) # async def del_index(): # await vikingdb_service.async_drop_index("async", "async") # async def list_index(): # res = await vikingdb_service.async_list_indexes("async") # print(res) # for item in res: # print(item.index_name) # async def embedding(): # list = [RawData("text", "hello1"), RawData("text", "hello2")] # res = await vikingdb_service.async_embedding(EmbModel("bge_large_zh"), list) # print(res) # async def update_index(): # await vikingdb_service.async_update_index("async", "async", shard_count=3) # async def update_collection(): # fields = [ # Field( # field_name="like1", # field_type=FieldType.Float32, # default_val=0 # ), # Field( # field_name="price1", # field_type=FieldType.String, # default_val="" # ), # ] # await vikingdb_service.async_update_collection("async1", fields) # async def rerank(): # score = await vikingdb_service.async_rerank("退改", "如果您需要人工服务,可以拨打人工客服电话:4006660921", # "转人工") # print(score) # async def batch_rerank(): # datas = [{ # "query": "退改", # "content": "如果您需要人工服务,可以拨打人工客服电话:4006660921", # "title": "无" # }, { # "query": "退改", # "content": "1、1日票 1.5日票 2日票的退款政策: -到访日前2天的00:00前,免费退款 - 到访日前2天的00:00至到访日前夜23:59期间,退款需扣除服务费(人民币80元) - 到访日当天(00:00 之后),不可退款 2、半日票的退款政策: - 未使用的们票可在所选入...", # "title": "门票退改政策|北京环球影城的门票退改政策" # }, { # "query": "退改", # "content": "如果您需要人工服务,可以拨打人工客服电话:4006660921", # }] # res = await vikingdb_service.async_batch_rerank(datas) # print(res) # async def embedding_v2(): # list = [RawData("text", "hello1"), RawData("text", "hello2")] # res = await vikingdb_service.async_embedding_v2(EmbModel("bge-m3"), list) # print(res) # async def upsert_data(): # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # collection = await vikingdb_service.async_get_collection("example") # field1 = {"doc_id": "111", "text_vector": gen_random_vector(10), "like": 1, "price": 1.11, # "author": ["gy"], "aim": True} # field2 = {"doc_id": "222", "text_vector": gen_random_vector(10), "like": 2, "price": 2.22, # "author": ["gy", "xjq"], "aim": False} # field3 = {"doc_id": "333", "text_vector": gen_random_vector(10), "like": 3, "price": 3.33, # "author": ["gy", "xjq"], "aim": False} # field4 = {"doc_id": "444", "text_vector": gen_random_vector(10), "like": 4, "price": 4.44, # "author": ["gy", "xjq"], "aim": False} # data1 = Data(field1) # data2 = Data(field2) # data3 = Data(field3) # data4 = Data(field4) # datas = [data1, data2, data3, data4] # await collection.async_upsert_data(datas) # async def fetch_data(): # collection = vikingdb_service.get_collection("async") # res = await collection.async_fetch_data(["111", "222"]) # for item in res: # print(item.fields) # async def del_data(): # collection = vikingdb_service.get_collection("async") # res = await collection.async_delete_data("111") # async def search_by_id(): # index = await vikingdb_service.async_get_index("async", "async") # res = await index.async_search_by_id("222") # for item in res: # print(item.fields) # async def search_by_vector(): # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # index = await vikingdb_service.async_get_index("async", "async") # res = await index.async_search_by_vector(gen_random_vector(10)) # for item in res: # print(item.fields) # async def index_fetch_data(): # index = await vikingdb_service.async_get_index("async", "async") # res = await index.async_fetch_data(["111", "222", "333", "444"]) # for item in res: # print(item.fields) # async def search(): # index = vikingdb_service.get_index("async", "async") # def gen_random_vector(dim): # res = [0, ] * dim # for i in range(dim): # res[i] = random.random() - 0.5 # return res # res = index.search(order=VectorOrder(gen_random_vector(10)), limit=2, # output_fields=["doc_id", "like", "text_vector"], # filter={"op": "range", "field": "price", "lt": 3.5}) # print("-----------search_vector---------") # for item in res: # print(item) # print(item.score) # print("-----------search_scalar---------") # res = index.search(order=ScalarOrder("price", Order.Desc), limit=6, # output_fields=["price"], # filter={"op": "range", "field": "price", "lt": 5}) # for item in res: # print(item) # print(item.score) # print("-----------search_None---------") # res = index.search(limit=5, output_fields=["doc_id", "like"], # filter={"op": "range", "field": "price", "lt": 3.5}) # for item in res: # print(item.fields) # print(item.score) # asyncio.run(create_collection()) # asyncio.run(get_collection()) # asyncio.run(del_collection()) # asyncio.run(list_collections()) # asyncio.run(create_index()) # asyncio.run(get_index()) # asyncio.run(del_index()) # asyncio.run(list_index()) # asyncio.run(embedding()) # asyncio.run(update_index()) # asyncio.run(update_collection()) # asyncio.run(rerank()) # asyncio.run(batch_rerank()) # asyncio.run(embedding_v2()) # asyncio.run(upsert_data()) # asyncio.run(fetch_data()) # asyncio.run(del_data()) # asyncio.run(search_by_id()) # asyncio.run(search_by_vector()) # asyncio.run(index_fetch_data()) # asyncio.run(search()) # with open('', 'rb') as file: # file_content = file.read() # encoded_image_content = base64.b64encode(file_content).decode() # list = [RawData("image", image=encoded_image_content), RawData("image", image=encoded_image_content)] # res = vikingdb_service.embedding_v2(EmbModel(""), list) # print(res) ================================================ FILE: volcengine/example/viking_db/index_create.py ================================================ import utils import volcengine.viking_db as vkdb if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() vector_index = vkdb.VectorIndexParams(distance=vkdb.DistanceType.COSINE, index_type=vkdb.IndexType.HNSW_HYBRID, quant=vkdb.QuantType.Int8) index = vikingdb_service.create_index("test_coll_for_sdk", "index_hnsw_hybrid", vector_index=vector_index) print(index.index_name) ================================================ FILE: volcengine/example/viking_db/index_drop.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() collection = vikingdb_service.drop_index("test_coll_for_sdk_1", "index_sort_2") ================================================ FILE: volcengine/example/viking_db/index_sort.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk_1", "index_sort") index_sort_result = index.sort(query_vector=[0.0, 1.1, 2.2, -1.1], primary_keys=["docx", "doc1", "doc2", "doc3", "doc0"]) print(index_sort_result.primary_key_not_exist) for item in index_sort_result.sort_result: print(item.primary_key, item.score) ================================================ FILE: volcengine/example/viking_db/search_agg.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk", "index_hnsw_hybrid") agg_result = index.search_agg(agg={'op':'count'}) print(agg_result.agg_op, agg_result.group_by_field, agg_result.agg_result) print("==========") agg_result = index.search_agg(agg={'op': 'count', 'field': 'f_string', 'cond': {'gt': 0}}, filter={'op': 'range', 'field': 'f_int64', 'gt': 90}) print(agg_result.agg_op, agg_result.group_by_field, agg_result.agg_result) ================================================ FILE: volcengine/example/viking_db/search_post_process_ops.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk", "index_hnsw") datas = index.search(order=None, limit=5, post_process_input_limit=5, post_process_ops=[ {'op': 'string_like', 'field':'f_string', 'pattern':'%doc9%'}, {'op': 'enum_freq_limiter', 'field':'f_string', 'threshold': 1} ]) for data in datas: print(data.id, data.fields, data.score) ================================================ FILE: volcengine/example/viking_db/search_primary_key_filter.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk", "index_hnsw") datas = index.search(order=None, limit=5, primary_key_in=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], primary_key_not_in=[1]) for data in datas: print(data.id, data.fields, data.score) print("========================") datas = index.search_by_id(id=2, limit=5, output_fields=["f_id", 'f_vector'], primary_key_in=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], primary_key_not_in=[1]) for data in datas: print(data.id, data.fields, data.score) print("========================") datas = index.search_by_vector(vector=[0,0,0,0], limit=10, primary_key_in=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], primary_key_not_in=[5, 6, 7, 8, 9, 10]) for data in datas: print(data.id, data.fields, data.score) print("========================") ================================================ FILE: volcengine/example/viking_db/search_with_multi_modal.py ================================================ import utils if __name__ == '__main__': vikingdb_service = utils.get_vikingdb_service() index = vikingdb_service.get_index("test_coll_for_sdk_with_vectorize", "index_hnsw_hybrid") datas = index.search_with_multi_modal( text="这是一个测试", image="tos://{your_bucket}/{your_object}", limit=5, need_instruction=False) for data in datas: print(data.id, data.fields, data.score) ================================================ FILE: volcengine/example/viking_db/utils.py ================================================ from volcengine.viking_db import VikingDBService import os def get_vikingdb_service(): ak = os.getenv("ak") sk = os.getenv("sk") host = "api-vikingdb.volces.com" region = "cn-beijing" scheme = "http" connection_timeout = 30 socket_timeout = 30 vikingdb_service = VikingDBService( host=host, region=region, scheme=scheme, connection_timeout=connection_timeout, socket_timeout=socket_timeout ) vikingdb_service.set_ak(ak) vikingdb_service.set_sk(sk) return vikingdb_service ================================================ FILE: volcengine/example/viking_knowledgebase/__init__.py ================================================ ================================================ FILE: volcengine/example/viking_knowledgebase/example.py ================================================ import sys import os import asyncio current_directory = os.path.dirname(os.path.abspath(__file__)) seek = os.path.dirname(os.path.dirname(os.path.dirname(current_directory))) sys.path.insert(0, seek) from volcengine.viking_knowledgebase import VikingKnowledgeBaseService, Collection, Doc, Point from volcengine.viking_knowledgebase.common import Field, FieldType, IndexType, EmbddingModelType collection_name = "" viking_knowledgebase_service = VikingKnowledgeBaseService() points = viking_knowledgebase_service.search_collection(collection_name=collection_name,query="", rerank_switch=True, retrieve_count=20) for point in points: print(point.content) print(point.chunk_id) print(point.point_id) print(point.doc_id) print(point.project) print("=======") #假定用户已经在知识库中创建了一个collection,并上传了文档,A公司_2022年财报.pdf,A公司_2023年财报.pdf m_messages = [{ "role": "system", "content": """ system pe """ }, { "role": "user", "content": "22年A公司财报中提到的风险,在23年应对的如何" # 用户提问 } ] # chat_completion without streaming print("#"*10,"chat_completion without streaming","#"*10) res = viking_knowledgebase_service.chat_completion(model="Doubao-pro-32k", messages=m_messages, max_tokens=4096, temperature=0.1) data = res["generated_answer"] token_usage = res["usage"] print(data) print(token_usage) # chat_completion with streaming print("#"*10,"chat_completion with streaming","#"*10) res = viking_knowledgebase_service.chat_completion(model="Doubao-pro-32k", messages=m_messages, max_tokens=4096, temperature=0.1,stream=True) for data in res: print(data,end="",flush=True) print("") print(res.token_usage()) ================================================ FILE: volcengine/example/visual/__init__.py ================================================ ================================================ FILE: volcengine/example/visual/cv_common.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') # 设置超时时间,最大30s # visual_service.set_connection_timeout(30) # # version = 2020-08-26 # # 参考接口文档query部分 传Action、Version # action = "" # version = "" # visual_service.set_api_info(action, version) # # body 参考接口文档 请求Body传参部分 # form = dict() # form["image_base64"] = "image_base64_str" # resp = visual_service.cv_form_api(action, form) # print(resp) # version >= 2022-08-31 # 参考接口文档query部分 传Action、Version action = "" version = "" visual_service.set_api_info(action, version) # body 参考接口文档 请求Body传参部分 form = { "req_key": "xxxx", # ... } resp = visual_service.cv_json_api(action, form) print(resp) ================================================ FILE: volcengine/example/visual/cv_get_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('Sk') form = { "req_key": "xxx", "task_id": "xxx" } resp = visual_service.cv_get_result(form) print(resp) ================================================ FILE: volcengine/example/visual/cv_process.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "xxx", # ... } resp = visual_service.cv_process(form) print(resp) ================================================ FILE: volcengine/example/visual/cv_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('Sk') form = { "req_key": "xxx", # ... } resp = visual_service.cv_submit_task( form) print(resp) ================================================ FILE: volcengine/example/visual/cv_sync2async_get_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('Ak') visual_service.set_sk('Sk') form = { "req_key": "xxx", "task_id": "xxx", "req_json": "{\"logo_info\":{\"add_logo\":true,\"position\":1, \"language\":1,\"opacity\":0.5}}" } resp = visual_service.cv_sync2async_get_result(form) print(resp) ================================================ FILE: volcengine/example/visual/cv_sync2async_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine import visual from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('Sk') form = { "req_key": "xxx", # ... } resp = visual_service.cv_sync2async_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_ai_gufeng.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "ai_gufeng", "image_urls": [ "https://xxx" ] } resp = visual_service.ai_gufeng(form) print(resp) ================================================ FILE: volcengine/example/visual/example_all_age_generation.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "all_age_generation", "target_age": 70 , "image_urls":["https://xxx"] } resp = visual_service.all_age_generation(form) print(resp) ================================================ FILE: volcengine/example/visual/example_body_detection.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key":"face_body_detection", "max_obj_num":100, "binary_data_base64":[""] } resp = visual_service.body_detection(form) print(resp) ================================================ FILE: volcengine/example/visual/example_car_detection.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url": "https://xxx" } resp = visual_service.car_detection(form) print(resp) ================================================ FILE: volcengine/example/visual/example_car_plate_detection.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.car_plate_detection(form) print(resp) ================================================ FILE: volcengine/example/visual/example_car_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.car_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_auth.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key":"cert_auth", "byted_token":"" } resp = visual_service.cert_auth(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_config_get.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "cert_config_get", "config_id": "" } resp = visual_service.cert_config_get(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_config_init.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') #Config接口 # form = { # "req_key":"cert_config_init", # "config_name":"", # "token_api_config":{ # "ref_source":"1" # }, # "h5_config":{ # "redirectUrl":"", # "type":1 # } # } #ConfigPro接口 form = { "req_key": "cert_config_init", "config_name": "", #"config_desc":"", "token_api_config": { "ref_source": "1" } } resp = visual_service.cert_config_init(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_h5_config_init.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') form = { "req_key": "cert_h5_config_init", "h5_config": { "type": "1", "redirect_url": "https://xxx" }, "liveness_config": { "ref_source": "1", "liveness_type": "motion" } } resp = visual_service.cert_h5_config_init(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_h5_token.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') form = { "req_key":"cert_h5_token", "h5_config_id":"", "sts_token":"", "idcard_name":"", "idcard_no":"" } resp = visual_service.cert_h5_token(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_pro_liveness_verify_query.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') form = { "req_key": "cert_pro_liveness_verify_query", "byted_token": "", "omit_data": False, "omit_image_data": False, "omit_video_data": False } resp = visual_service.cert_pro_liveness_verify_query(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_src_face_comp.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "cert_src_face_comp", "idcard_name": "", "idcard_no": "", "image": "" } resp = visual_service.cert_src_face_comp(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_token.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') #Token接口 # form = { # "req_key":"cert_token", # "sts_token":"", # "liveness_type":"motion", # "ref_source":"1", # "idcard_name":"", # "idcard_no":"" # } #TokenPro接口 form = { "req_key": "cert_pro_token", "sts_token": "", "ref_source": "1", "idcard_name": "", "idcard_no": "" } resp = visual_service.cert_token(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_verify.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.sts.StsService import StsService from volcengine.visual.VisualService import VisualService if __name__ == '__main__': # step1 调用AssumeRole接口获取临时ak/sk及token # stsService = StsService() # stsService.set_ak("your-ak") # 子账号长期AK # stsService.set_sk("your-sk") # 子账号长期SK # # params = { # "DurationSeconds": "900", # "RoleSessionName": "just_for_test", # "RoleTrn": "trn:iam::yourAccountID:role/yourRole" # } # # print(stsService.assume_role(params)) # step2 调用CertToken接口,绑定用户身份 visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('your-sts-ak') # sts返回的临时ak visual_service.set_sk('your-sts-sk') # sts返回的临时sk visual_service.set_session_token('your-sts-token') # sts返回的临时SessionToken # visual_service.set_host('host') # below shows the sdk usage for all common apis, # if you cannot find the needed one, please check other example files in the same dir # or contact us for further help form = { 'req_key': 'cert_token', 'sts_token': 'your-sts-token', 'tos_info': {}, 'ref_source': '1', 'liveness_type': 'motion', # 'ref_image': '', 'idcard_name': '', 'idcard_no': '', 'liveness_timeout': 10, 'motion_list': ['0', '1', '2', '3'], 'fixed_motion_list': ['0'], 'motion_count': 4, 'max_liveness_trial': 10, } # 人脸核身Token接口 resp = visual_service.cert_token(form) print(resp) # step3 端上集成-客户端 / h5 # step4 调用Query接口,查询认证数据 # visual_service = VisualService() # # # call below method if you don't set ak and sk in $HOME/.volc/config # visual_service.set_ak('sts-ak') # sts返回的临时ak # visual_service.set_sk('sts-sk') # sts返回的临时sk # visual_service.set_session_token('sts-token') # sts返回的临时SessionToken # # visual_service.set_host('host') # # # below shows the sdk usage for all common apis, # # if you cannot find the needed one, please check other example files in the same dir # # or contact us for further help # # # x-security-token # form = { # 'req_key': 'cert_verify_query', # 'byted_token': '', # } # # # 人脸核身Query接口 # resp = visual_service.cert_verify_query(form) # print(resp) ================================================ FILE: volcengine/example/visual/example_cert_verify1.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') #Verify接口 # form = { # "req_key":"cert_src_verify", # "byted_token":"", # "video_url":"", # "extra":{ # "video_type": "motion" # } # } #VerifyPro接口 form = { "req_key":"cert_pro_src_verify", "byted_token":"", "video_key":"", "tos_bucket":"", "risk_info":"", "extra":{} } resp = visual_service.cert_verify(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cert_verify_query.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') #Query接口 # form = { # "req_key":"cert_verify_query", # "byted_token":"", # "omit_data":False, # } # QueryPro接口 form = { "req_key": "cert_pro_verify_query", "byted_token": "", "omit_data": False, } resp = visual_service.cert_verify_query(form) print(resp) ================================================ FILE: volcengine/example/visual/example_common.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') # visual_service.set_host('host') # below shows the sdk usage for all common apis, # if you cannot find the needed one, please check other example files in the same dir # or contact us for further help form = dict() form["image_base64"] = "image_base64_str" # 车牌检测 # resp = visual_service.car_plate_detection(form) # 人像畸变矫正 # resp = visual_service.distortion_free(form) # 图片拉伸修复 # resp = visual_service.stretch_recovery(form) # 图片流动 # form["motion_ratio"] = 2 # resp = visual_service.image_flow(form) # 图片评分 # resp = visual_service.image_score(form) # 图片配文 # resp = visual_service.poem_material(form) # 表情编辑 # form["service_choice"] = 0 # resp = visual_service.emoticon_edit(form) # 闭眼转睁眼 # resp = visual_service.eye_close2open(form) # 车辆分割 # resp = visual_service.car_segment(form) # 车辆检测 # resp = visual_service.car_detection(form) # 天空分割 # resp = visual_service.sky_segment(form) # 老照片修复 # resp = visual_service.convert_photo(form) # 图像增强 # resp = visual_service.enhance_photo(form) # 通用分割 # resp = visual_service.general_segment(form) # 人体分割 # form["refine"] = 0 # form["return_foreground_image"] = 0 # resp = visual_service.human_segment(form) # 人像漫画风 # form["cartoon_type"] = "jpcartoon_head" # form["rotation"] = 0 # this param is valid only when cartoon_type == jpcartoon_head # resp = visual_service.jpcartoon(form) # 人脸融合 # form["template_base64"] = "template_base64_str" # form["action_id"] = "faceswap" # resp = visual_service.face_swap(form) # 通用OCR # resp = visual_service.ocr_normal(form) # 身份证OCR # resp = visual_service.id_card(form) # 银行卡OCR # resp = visual_service.bank_card(form) # 营业执照OCR # resp = visual_service.clue_license(form) # 驾驶证OCR # resp = visual_service.driving_license(form) # 行驶证OCR # resp = visual_service.vehicle_license(form) # 出租车票OCR # resp = visual_service.taxi_invoice(form) # 火车票OCR # resp = visual_service.train_ticket(form) # 行程单OCR # resp = visual_service.flight_invoice(form) # 增值税发票OCR # resp = visual_service.vat_invoice(form) # 定额发票OCR # resp = visual_service.quota_invoice(form) # 发型编辑 # resp = visual_service.hair_style(form) # 智能变美 # resp = visual_service.face_pretty(form) # 活照片 # resp = visual_service.image_animation(form) # 视频选封面 # resp = visual_service.cover_video(form) # 希区柯克 # resp = visual_service.dolly_zoom(form) # 人像特效 # resp = visual_service.potrait_effect(form) # 图像风格转换 # resp = visual_service.image_style_conversion(form) # 3d游戏风 # resp = visual_service.three_d_game_cartoon(form) # 头发抠图 # resp = visual_service.hair_segment(form) # form["mode"] = 0 # form["refine_mask"] = 0 # form["flip_test"] = 0 # 印章识别 # resp = visual_service.ocr_seal(form) # pdf识别 # resp = visual_service.ocr_pdf(form) # 高速公路过路费 # resp = visual_service.ocr_pass_invoice(form) # 商标证 # resp = visual_service.ocr_trade(form) # 软件著作权 # resp = visual_service.ocr_ruanzhu(form) # 化妆品生产许可证 # resp = visual_service.ocr_cosmetic_product(form) # 表格识别 # resp = visual_service.ocr_table(form) # 智能绘图(文本转图片通用版) # resp = visual_service.t2i_ldm(form) # 智能绘图(名画版) # resp = visual_service.img2img_style(form) # 智能绘图(漫画版) # resp = visual_service.img2img_anime(form) print(resp) ================================================ FILE: volcengine/example/visual/example_convert_photo_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "lens_opr", "image_urls": [ "https://xxx" ], "if_color": 1 } resp = visual_service.convert_photo_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_cv_cancel_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('Ak') visual_service.set_sk('Sk') form = { "req_key": "xxx", "task_id": "123456" } resp = visual_service.cv_cancel_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_distortion_free.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.distortion_free(form) print(resp) ================================================ FILE: volcengine/example/visual/example_dolly_zoom.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('sk') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "video_type":0, "device_type":0, "video_length":2.5 } resp = visual_service.dolly_zoom(form) print(resp) ================================================ FILE: volcengine/example/visual/example_emoticon_edit.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "service_choice":0, "do_risk":False } resp = visual_service.emoticon_edit(form) print(resp) ================================================ FILE: volcengine/example/visual/example_emotion_portrait.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "emotion_portrait", "image_urls": [""], "target_emotion": "jiuwo" } resp = visual_service.emotion_portrait(form) print(resp) ================================================ FILE: volcengine/example/visual/example_enhance_photo_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "lens_lqir", "image_urls": [ "https://xxx" ], "resolution_boundary": "540p", "enable_hdr": False, "enable_wb": False, "result_format": 1, "jpg_quality": 95, "hdr_strength": 1.0 } resp = visual_service.enhance_photo_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_entity_detect.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.entity_detect(form) print(resp) ================================================ FILE: volcengine/example/visual/example_entity_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { # "binary_data_base64": [""], "image_urls": [ "https://"], "req_key": "entity_seg", "return_url": True, "max_entity": 20, "return_format": 0, "refine_mask": 0 } resp = visual_service.entity_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_eye_close2open.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.eye_close2open(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_compare.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key":"face_compare", "image_urls":[ "http://xxx", "http://xxx" ] } resp = visual_service.face_compare(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_fusion_movie.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "facefusionmovie_standard", # "binary_data_base64": ["/9xx"], "image_url": 'https://xxxx, https://xxxx', "video_url": 'https://xxxx', "enable_face_beautify": True, # "ref_img_url": "https://xxxx, https://xxxx" } resp = visual_service.face_fusion_movie(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_fusion_movie_get_result.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "facefusionmovie_standard", "task_id":"" } resp = visual_service.face_fusion_movie_get_result(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_fusion_movie_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "facefusionmovie_standard_v2", "image_url": "https://xxx", "video_url": "https://xxx", "ref_img_url": "https://xxx", "source_similarity": 1, "logo_info": { "add_logo": True, "position": 2, "language": 0, "opacity": 0.9 } } resp = visual_service.face_fusion_movie_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_pretty.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "multi_face": "1", "image_url":"https://xxx", "do_risk":False, "beauty_level":1.0 } resp = visual_service.face_pretty(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_swap.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') #2.0版本 # form = { # "image_url":"", # "template_url":"", # "action_id":"faceswap", # "version":"2.0", # "do_risk":False, # "source_similarity":"1" # } # 2.1版本 form = { "template_url":"", "action_id":"faceswap", "version":"2.1", "do_risk":False, "type":"l2r", "merge_infos":'[{"image_url":"https://xxx","location":1,"template_location":1}]' } resp = visual_service.face_swap(form) print(resp) ================================================ FILE: volcengine/example/visual/example_face_swap_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') form = { # 注意3.0版本req_key传faceswap | | 3.3版本req_key传face_swap3_3 "req_key": "faceswap", "image_urls": [ "https://xxx", "https://xxx", "https://xxx" ], "face_type": "area", "merge_infos": [ { "location": 1, "template_location": 1 }, { "location": 1, "template_location": 2 } ] # "logo_info":{ # "add_logo":True, # "position":2, # "language":0, # "opacity":1.0 # }, # "do_risk":False, # "source_similarity":"1" } resp = visual_service.face_swap_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_faceswap_ai.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('') visual_service.set_sk('') form = { "req_key": "faceswap_ai", "image_urls": [ "https://xxx", "https://xxx" ], "gpen":0.9, "skin":0.9 # "do_risk":False, # "tou_repair":1 } resp = visual_service.faceswap_ai(form) print(resp) ================================================ FILE: volcengine/example/visual/example_general_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "return_foreground_image":0 } resp = visual_service.general_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_goods_detect.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.goods_detect(form) print(resp) ================================================ FILE: volcengine/example/visual/example_goods_segment.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_url": "https://xxx", "method":"human" } resp = visual_service.goods_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_hair_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "mode": 1, "refine_mask": 0 , "image_url":"https://xxx", "flip_test":1 } resp = visual_service.hair_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_hair_style.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "hair_type": "0", "image_url":"https://xxx", "do_risk":False } resp = visual_service.hair_style(form) print(resp) ================================================ FILE: volcengine/example/visual/example_hair_style_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "hair_style", "image_urls":["https://xxx"], "hair_type":801 } resp = visual_service.hair_style_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_high_aes_smart_drawing.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') # 高美感通用v1.2-文生图 # form ={ # "req_key": "high_aes_t2i", # "prompt": "千军万马", # "seed": -1, # "scale": 5.5, # "ddim_steps": 25, # "width": 512, # "height": 512, # "logo_info": { # "add_logo": False, # "position": 0, # "language": 0, # "opacity": 0.3 # } # } # 高美感通用V1.3-文生图 # form = { # "req_key": "high_aes", # "prompt": "千军万马", # "model_version": "general_v1.3", # "seed": -1, # "scale": 3.5, # "ddim_steps": 25, # "width": 512, # "height": 512, # "use_sr": False, # "sr_seed": -1, # "return_url":False, # "logo_info": { # "add_logo": False, # "position": 0, # "language": 0, # "opacity": 0.3 # } # } # 高美感动漫v1.3-文生图/图生图 # form = { # "req_key": "high_aes", # "prompt": "千军万马", # "model_version": "anime_v1.3", # # "binary_data_base64":[""], # "strength": 0.7, # "seed": -1, # "scale": 7, # "ddim_steps": 20, # "width": 1024, # "height": 1024, # "return_url":False, # "logo_info": { # "add_logo": False, # "position": 0, # "language": 0, # "opacity": 0.3 # } # } # 高美感通用V1.4-文生图 form = { "req_key": "high_aes_general_v14", "prompt": "千军万马", "model_version": "general_v1.4", "seed": -1, "scale": 3.0, "ddim_steps": 25, "width": 512, "height": 512, "use_rephraser": True, "return_url":False, "use_predict_tags": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.high_aes_smart_drawing(form) print(resp) ================================================ FILE: volcengine/example/visual/example_high_aes_smart_drawing_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_photoverse_executive_ID_photo", # "binary_data_base64":[], "return_url":True, "image_urls": ["https://"], "beautify_info":{ "whitening":1.0, "dermabrasion":1.0 }, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.high_aes_smart_drawing_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_human_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "refine":0, "return_foreground_image":0 } resp = visual_service.human_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_animation.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "type":1 } resp = visual_service.image_animation(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_correction.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "image_correction", "image_urls": ["https://xxx"] } resp = visual_service.image_correction(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_cut.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_url": "https://xxx", "width": 100, "height": 120, "cut_method": "gauss_padding_reserve_score" } resp = visual_service.image_cut(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_flow.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "motion_ratio":2 } resp = visual_service.image_flow(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_inpaint.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.image_inpaint(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_outpaint.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.image_outpaint(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_score_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "lens_vida_single_pic", "image_urls": [ "https://xxx" ], "vida_mode": "vida_custom", "vida_enable_module": "score_total_ds" } resp = visual_service.image_score_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_search_image_add.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "urls": ["url_1", "url_2"], # "images_base64": ["img_b64_1", "img_b64_2"] } resp = visual_service.image_search_image_add(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_search_image_delete.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "pid": "pid_1", } resp = visual_service.image_search_image_delete(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_search_image_search.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "url": "url_1", # "image_base64": "img_b64_1", "topk": 10 } resp = visual_service.image_search_image_search(form) print(resp) ================================================ FILE: volcengine/example/visual/example_image_style_conversion.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "type": "jzcartoon", "image_url":"https://xx" } resp = visual_service.image_style_conversion(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_anime.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "img2img_anime", "prompt": "", "image_url": "https://xxx", "strength": 0.9, "seed": -1 } resp = visual_service.img2img_anime(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_anime_accelerated_maintain_id.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_anime_accelerated_maintain_id", "positive_prompt": "1girl,beautiful,looking at viewer,portrait,", "return_url": True, "image_urls": [ "https://"], # "binary_data_base64": [], "hyper_switch": True, # "seed": -1, # "step": 18, # "cfg": 4.5, # "face_image": "uri://binary_data?index=0", # "style_image": "uri://binary_data?index=1", # "face_switch": True, # "facestyle_switch": True, # # "style_switch": False, # "width": 1000, # "height": 1000, # "logo_info": { # "add_logo": True, # "position": 2, # "language": 0, # "opacity": 1 # } } resp = visual_service.img2img_anime_accelerated_maintain_id(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_comics_style.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_comic_style", "binary_data_base64":[], "image_urls": [ "https://xxx" ], "sub_req_key": "img2img_comic_style_marvel", "return_url": True, "logo_info": { "add_logo": True, "position": 2, "language": 0, "opacity": 1.0 } } resp = visual_service.img2img_comics_style(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_aes_blueline.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_blueline_style", # "binary_data_base64":[], "image_urls": [ "https://" ], "prompt": [], "sub_prompts": [], "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_map": {'tybluelineman_1102': {'strength_model': 0.2, 'strength_clip': 0.2}, 'blueline_1022': {'strength_model': 0.2, 'strength_clip': 0.2}, 'animeoutlineV4_16': {'strength_model': 0.2, 'strength_clip': 0.2}}, "clip_skip": 1, "controlnet_weight": 1, "sampler_name": "dpmpp_2m", "scheduler": "karras", "long_resolution": 704, "cn_mode": 0, "id_weight": 1.0, "apply_id_layer": "2,3,4,5,6,7,8,9,10,11,12", "tagger_settings": {"switch": False}, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_aes_blueline(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_anylora_makoto.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_makoto_style", # "binary_data_base64":[], "image_urls": [ "https://"], "prompt": "", "sub_prompts": [], "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_map": {'300XHC_anylora_1106': {'strength_model': 0.2, 'strength_clip': 0.2}, 'animeoutlineV4_16': {'strength_model': 0, 'strength_clip': 0}}, "clip_skip": 1, "controlnet_weight": 1, "sampler_name": "dpmpp_2m", "long_resolution": 704, "cn_mode": 0, "id_weight": 1.0, "apply_id_layer": "2,3,4,5,6,7,8,9,10,11,12", "tagger_settings": {"switch": False}, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_anylora_makoto(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_disney_style_no_face.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_disney_3d_style", # "binary_data_base64":[], "image_urls": [ "https://" ], "prompt": "", "sub_prompts": [ ], "u_prompt": "embedding:EasyNegative, nsfw, (worst quality:2), (low quality:2)", "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_map": { "3Dpet_Disney01": { "strength_clip": 0.6, "strength_model": 0.6 } }, "clip_skip": 1, "controlnet_weight": 0.4, "sampler_name": "dpmpp_2m", "scheduler": "karras", "long_resolution": 704, "cn_mode": 0, "id_weight": 1.0, "apply_id_layer": "2,3,4,5,6,7,8,9,10,11,12", "tagger_settings": {"switch": False}, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_disney_style_no_face(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_ether_real_mix.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_real_mix_style", # "binary_data_base64":[], "image_urls": [ "https://" ], "prompt": "", "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_multipers": {'Dragon_v1': 0.6}, "clip_skip": 1, "canny_weight": 0.6, "sampler_name": "DPM++ 2M Karras", "i2i_keep_texture": 1, "long_resolution": 704, "id_scale": 0, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_ether_real_mix(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_ink_and_water.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_water_ink_style", # "binary_data_base64":[], "image_urls": [ "https://"], "prompt": "", "sub_prompts": [""], "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_map": {'Cateye_AT45': {'strength_model': 0.2, 'strength_clip': 0.2},'CATSEYEcp001': {'strength_model': 0.2, 'strength_clip': 0.2}}, "clip_skip": 1, "controlnet_weight": 1, "sampler_name": "dpmpp_2m", "scheduler": "karras", "long_resolution": 832, "cn_mode": 0, "id_weight": 1.0, "apply_id_layer": "2,3,4,5,6,7,8,9,10,11,12", "tagger_settings": {"switch": False}, "vae_choice": 1, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_ink_and_water(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_pastel_boys2d.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_pastel_boys_style", # "binary_data_base64": [], "image_urls": [ "https://"], "prompt": "good looking,(((pure white statue))),(((only white color in picture))), (((white plaster figure))), (Renaissance), ancient Greek mythological statue, monochromatic realism style, rococo, (((plaster texture))), ((white hair)), 8k, best quality, masterpiece, depth, face light,", "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_multipers": { }, "clip_skip": 1, "canny_weight": 0.8, "i2i_keep_texture": 1, "long_resolution": 704, "id_scale": 0, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_pastel_boys2d(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_rev_animated.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_rev_animated_style", # "binary_data_base64":[], "image_urls": [ "https://"], "prompt": "", "strength": 0.8, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_multipers": {'shanzhagaoSomeSortOf_v1Epoch10': 0.6, 'Moxin_10': 0.5, 'Colorwater_v4': 0.3}, "clip_skip": 1, "canny_weight": 1, "sampler_name": "DPM++ 2M Karras", "id_scale": 0, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_rev_animated(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_create_toonyou.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_cartoon_style", # "binary_data_base64":[], "image_urls": [ "https://"], "prompt": "", "sub_prompts": [ ], "strength": 0.6, "seed": -1, "scale": 8, "ddim_steps": 20, "lora_map": { "animeoutlineV4_16": { "strength_clip": 0.2, "strength_model": 0.2 }}, "clip_skip": 1, "controlnet_weight": 1, "long_resolution": 704, "cn_mode": 0, "id_weight": 1.0, "apply_id_layer": "2,3,4,5,6,7,8,9,10,11,12", "tagger_settings": {"switch": False}, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_create_toonyou(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_exquisite_style.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_exquisite_style", "binary_data_base64":[], "image_urls": [ "https://xxx" ], "return_url": True, "logo_info": { "add_logo": True, "position": 2, "language": 0, "opacity": 1.0 } } resp = visual_service.img2img_exquisite_style(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_inpainting.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "i2i_inpainting", "binary_data_base64": [ "" ], # "image_urls":[], "return_url": True, "steps": 30, "strength": 0.8, "scale": 7, "seed": 0, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_inpainting(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_inpainting_edit.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "custom_prompt": "一只小狗", "req_key": "i2i_inpainting_edit", "scale": 5, "seed": -1, "steps": 25, "return_url": True, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 }, # "image_urls":[], "binary_data_base64": [ "" ] } resp = visual_service.img2img_inpainting_edit(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_outpainting.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "i2i_outpainting", "binary_data_base64": [ "" ], "image_urls": [], "custom_prompt": "蓝色海洋", "return_url": True, "steps": 30, "strength": 0.8, "scale": 7.0, "seed": 0, "top": 0.1, "bottom": 0.1, "left": 1, "right": 1, "max_height": 1920, "max_width": 1920, "logo_info": { "add_logo": False, "position": 0, "language": 0, "opacity": 0.3 } } resp = visual_service.img2img_outpainting(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_style.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "img2img_style", "prompt": "", "image_url": "https://xxx", "strength": 0.5, "seed": -1 } resp = visual_service.img2img_style(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_water_color_style.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "img2img_water_paint_style", # "binary_data_base64":[], "image_urls": [ "https://"], "return_url": True, } resp = visual_service.img2img_water_color_style(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2img_xl_sft.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "i2i_xl_sft", # "binary_data_base64":[], "image_urls": [ "https://xxx" ], "prompt": "美女", "seed": -1, "ddim_step": 20, "scale": 7.0, "controlnet_args": [ { "type": "pose", "strength": 0.4, "binary_data_index": 0 } ], "style_reference_args": { "id_weight": 0.2, "style_weight": 0.0, "binary_data_index": 0 }, "return_url": True, "logo_info": { "add_logo": True, "position": 2, "language": 0, "opacity": 1 } } resp = visual_service.img2img_xl_sft(form) print(resp) ================================================ FILE: volcengine/example/visual/example_img2video3d.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "img2video3d", "image_urls": [ "https://xxx" ], "render_spec": { "mode": 2, "long_side": 960, "frame_num": 90, "fps": 30, "use_flow": -1, "speed_shift": [ 0, 1, 0.5, 4, 0.5, 4, 1, 1 ] } } resp = visual_service.img2video3d(form) print(resp) ================================================ FILE: volcengine/example/visual/example_jpcartoon.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "cartoon_type":"jpcartoon", "do_risk":False } resp = visual_service.jpcartoon(form) print(resp) ================================================ FILE: volcengine/example/visual/example_ocr_async_demo.py ================================================ # coding:utf-8 from __future__ import print_function import base64 from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') # visual_service.set_host('host') submit_action = "OCRPdfSubmitTask" query_action = "OCRPdfQueryTask" version = "2021-08-23" visual_service.set_api_info(submit_action, version) visual_service.set_api_info(query_action, version) # below shows the sdk usage for all common apis, # if you cannot find the needed one, please check other example files in the same dir # or contact us for further help # PDF识别 # req_key=ocr_pdf # OCRPdfSubmitTask # OCRPdfQueryTask submit_form = { "req_key": "ocr_pdf", "image_base64": base64.b64encode(open('local.pdf','rb').read()).decode(), "image_url": "http://image.jpeg", } submit_resp = visual_service.ocr_async_api(submit_action, submit_form) query_form = { "req_key": "ocr_pdf", "task_id": "12345678" } query_resp = visual_service.ocr_async_api(query_action, query_form) print(query_resp) ================================================ FILE: volcengine/example/visual/example_ocr_demo.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') # visual_service.set_host('host') action = "" version = "" visual_service.set_api_info(action, version) # below shows the sdk usage for all common apis, # if you cannot find the needed one, please check other example files in the same dir # or contact us for further help form = dict() form["image_base64"] = "image_base64_str" resp = visual_service.ocr_api(action, form) # 通用识别 # 通用OCR # action=OCRNormal, version=2020-08-26 # 多语种OCR # action=MultiLanguageOCR, version=2022-08-31 # 个人卡证 # 银行卡OCR # action=BankCard, version=2020-08-26 # 身份证OCR # action=IDCard, version=2020-08-26 # 驾驶证OCR # action=DrivingLicense, version=2020-08-26 # 行驶证OCR # action=VehicleLicense, version=2020-08-26 # 台胞证 # action=OcrTaibao, version=2021-08-23 # 财务票据 # 混贴报销 # action=OcrFinance, version=2021-08-23 # 出租车票OCR # action=OcrTaxiInvoice, version=2020-08-26 # 火车票OCR # action=OcrTrainTicket, version=2020-08-26 # 行程单OCR # action=OcrFlightInvoice, version=2020-08-26 # 增值税发票OCR # action=OcrVatInvoice, version=2020-08-26 # 定额发票OCR # action=OcrQuotaInvoice, version=2020-08-26 # 高速公路过路费 # action=OcrPassInvoice, version=2021-08-23 # 资质证书 # 食品生产许可证 # action=OcrFoodProduction, version=2021-08-23 # 食品经营许可证 # action=OcrFoodBusiness, version=2020-08-26 # 营业执照OCR # action=OcrClueLicense, version=2020-08-26 # 商标证 # action=OCRTrade, version=2020-12-21 # 软件著作权 # action=OCRRuanzhu, version=2020-12-21 # 化妆品生产许可证 # action=OCRCosmeticProduct, version=2020-12-21 # 行业文档 # 印章识别 # action=OcrSeal, version=2021-08-23 # 合同校验 # action=OcrTextAlignment, version=2021-08-23 # 表格识别 # action=OCRTable, version=2021-08-23 print(resp) ================================================ FILE: volcengine/example/visual/example_ocr_pdf_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import json from six import b from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "ocr_pdf", "task_id": "7394366186341040167" } resp = visual_service.ocr_pdf_query_task(form) print(resp) resp_data = resp['data']['resp_data'] print(eval(f"u'{resp_data}'")) ================================================ FILE: volcengine/example/visual/example_ocr_pdf_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { # "image_url":"", "image_base64":"", "req_key":"ocr_pdf" } resp = visual_service.ocr_pdf_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_over_resolution.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.over_resolution(form) print(resp) ================================================ FILE: volcengine/example/visual/example_over_resolution_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "lens_vida_nnsr", "image_urls": [ "https://xxx" ] } resp = visual_service.over_resolution_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_poem_material.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.poem_material(form) print(resp) ================================================ FILE: volcengine/example/visual/example_potrait_effect.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx", "type":"3d_cartoon", "return_type":1 } resp = visual_service.potrait_effect(form) print(resp) ================================================ FILE: volcengine/example/visual/example_product_search_add_image.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = { "product_id": "test", "image_id": "test", "category_id": 1, "url": "https://xxx", "custom_content": "custom", "int_attr": 1, "str_attr": "str", "crop": True, # "region": { # 'x1': 1, # 'x2': 2, # 'y1': 3, # 'y2': 4, # } } resp = visual_service.product_search_add_image(params) print(resp) ================================================ FILE: volcengine/example/visual/example_product_search_delete_image.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = { "product_id": "test", "image_id": "test", } resp = visual_service.product_search_delete_image(params) print(resp) ================================================ FILE: volcengine/example/visual/example_product_search_search_image.py ================================================ from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = { "category_id": 1, "url": "https://xxx", "custom_content": "custom", "crop": True, "filter": '{"op":"must","field":"strAttr","conds":["str"]}' # "region": { # 'x1': 1, # 'x2': 2, # 'y1': 3, # 'y2': 4, # } } resp = visual_service.product_search_search_image(params) print(resp) ================================================ FILE: volcengine/example/visual/example_sky_segment.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.sky_segment(form) print(resp) ================================================ FILE: volcengine/example/visual/example_still_liveness_img.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key":"still_liveness", "image_urls":[""] } resp = visual_service.still_liveness_img(form) print(resp) ================================================ FILE: volcengine/example/visual/example_stretch_recovery.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.stretch_recovery(form) print(resp) ================================================ FILE: volcengine/example/visual/example_t2i_ldm.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "t2i_ldm", "text": "", "style_term": "contemporary style" } resp = visual_service.t2i_ldm(form) print(resp) ================================================ FILE: volcengine/example/visual/example_text2img_xl_sft.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('AK') visual_service.set_sk('SK') form = { "req_key": "t2i_xl_sft", "prompt": "少女,光影,瘦,白皙,干净,美丽", "width": 1024, "height": 1024, "seed": -1, "ddim_steps": 20, "scale":7.0, "return_url": True, "logo_info": { "add_logo": True, "position": 2, "language": 0, "opacity": 1 } } resp = visual_service.text2img_xl_sft(form) print(resp) ================================================ FILE: volcengine/example/visual/example_three_d_game_cartoon.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "image_url":"https://xxx" } resp = visual_service.three_d_game_cartoon(form) print(resp) ================================================ FILE: volcengine/example/visual/example_tupo_cartoon.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "tupo_cartoon", # "binary_data_base64": ["/9xx"], "image_urls": ['https://xxxx'], } resp = visual_service.tupo_cartoon(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_cover_selection.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "video_url": "" } resp = visual_service.video_cover_selection(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_highlight_extraction_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() params = { "task_id": "get from submit_task resp" } resp = visual_service.video_highlight_extraction_query_task(params) print(resp) ================================================ FILE: volcengine/example/visual/example_video_highlight_extraction_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "video_url": "", "game": -1, } resp = visual_service.video_highlight_extraction_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_inpaint_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() params = { "task_id": "get from submit_task resp" } resp = visual_service.video_inpaint_query_task(params) print(resp) ================================================ FILE: volcengine/example/visual/example_video_inpaint_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function import time import base64 from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "method": "search", "video_url": "" } resp = visual_service.video_inpaint_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_over_resolution_get_result_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key": "lens_video_nnsr", "task_id":"" } resp = visual_service.video_over_resolution_get_result_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_over_resolution_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() params = { "task_id": "get from submit_task resp" } resp = visual_service.video_over_resolution_query_task(params) print(resp) ================================================ FILE: volcengine/example/visual/example_video_over_resolution_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "output_resolution": "output_resolution", "video_url": "" } resp = visual_service.video_over_resolution_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_over_resolution_submit_task_v2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you don't set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "req_key":"lens_video_nnsr", "url":"https://xxx" } resp = visual_service.video_over_resolution_submit_task_v2(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_retargeting_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() params = { "task_id": "get from submit_task resp" } resp = visual_service.video_retargeting_query_task(params) print(resp) ================================================ FILE: volcengine/example/visual/example_video_retargeting_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "strategy": "STATIC_CROPPING", "aspect_ratio": 1, "crop_size": 1, "video_url": "" } resp = visual_service.video_retargeting_submit_task(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_scene_detect.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.video_scene_detect(form) print(resp) ================================================ FILE: volcengine/example/visual/example_video_summarization_query_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') params = dict() params = { "task_id": "get from submit_task resp" } resp = visual_service.video_summarization_query_task(params) print(resp) ================================================ FILE: volcengine/example/visual/example_video_summarization_submit_task.py ================================================ # coding:utf-8 from __future__ import print_function import time from volcengine.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') form = { "result_duration": 5, "result_width": 1280, "video_url": "" } resp = visual_service.video_summarization_submit_task(form) print(resp) ================================================ FILE: volcengine/example/vms/__init__.py ================================================ ================================================ FILE: volcengine/example/vms/examplae_sigle_batch_append.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") single_append_body = { "List": [ { "Phone": "your phone", "Resource": "9b39e17fb12444c78f20d6551469a6f0", "NumberPoolNo": "NP162213338604093530", "NumberType": 0, "TriggerTime": "2022-03-12 19:18:00", "Type": 0, "SingleOpenId": "9b39e17fb12444c78f20d6551469a6e0" } ], } print(vms_service.single_batch_append(single_append_body)) ================================================ FILE: volcengine/example/vms/example_batch_append_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") batch_append_task = { "TaskOpenId": "106d2984fbf0480480cbc8b98d609592", "PhoneList": [ { "Phone": "your phone", } ], } print(vms_service.batch_append_task(batch_append_task)) ================================================ FILE: volcengine/example/vms/example_bind_axb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_axb_form = { "NumberPoolNo": "NP161156328504091435", "PhoneNoA": "13700000001", "PhoneNoB": "13700000002", "PhoneNoX": "13700000003", "ExpireTime": "1632920195", "UserData": "this is my user data", } print(vms_service.bind_axb(bind_axb_form)) ================================================ FILE: volcengine/example/vms/example_bind_axb_for_axne.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_axb_for_axne_form = { "NumberPoolNo": "NP167091951102821491", "ParentSubId": "S16729859759534216e440", "PhoneNoB": "13500000001", "EnableDuration": 360, } print(vms_service.bind_axb_for_axne(bind_axb_for_axne_form)) ================================================ FILE: volcengine/example/vms/example_bind_axg.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("ak") vms_service.set_sk("sk") bind_axg_json = { "NumberPoolNo": "NP162981168404095092", "PhoneNoA": "13700000001", "PhoneNoB": "13700000002", "PhoneNoX": "13700000005", "ExpireTime": "1632920195", } print(vms_service.bind_axg(bind_axg_json)) ================================================ FILE: volcengine/example/vms/example_bind_axn.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_axn_form = { "NumberPoolNo": "NP162981168404095092", "PhoneNoA": "13700000001", "PhoneNoB": "13700000002", "PhoneNoX": "13700000005", "ExpireTime": "1632920195", "UserData": "this is my user data", } print(vms_service.bind_axn(bind_axn_form)) ================================================ FILE: volcengine/example/vms/example_bind_axne.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_axne_form = { "NumberPoolNo": "NP167091934402820309", "PhoneNoA": "13700000017", "PhoneNoB": "13700000018", "UserData": "this is my user data", "CityCode": "010", "ExpireTime":"1673071556", } print(vms_service.bind_axne(bind_axne_form)) ================================================ FILE: volcengine/example/vms/example_bind_axyb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_axyb_form = { "NumberPoolNo": "NP166375725010908111", "PhoneNoA": "13700000017", "CityCode": "010", "UserData": "this is my user data", "ExpireTime": "1673071556", "YbEnableDuration": 600, "NumberPoolNoY": "NP166265127202826653" } print(vms_service.bind_axyb(bind_axyb_form)) ================================================ FILE: volcengine/example/vms/example_bind_yb_for_axyb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") bind_yb_for_axyb_form = { "NumberPoolNo": "NP166191438910906190", "ParentSubId": "S16722126795817211a93e", "PhoneNoB": "13500000001", "EnableDuration": 360, } print(vms_service.bind_yb_for_axyb(bind_yb_for_axyb_form)) ================================================ FILE: volcengine/example/vms/example_click2_call.py ================================================ from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") click2_call_form = { "Caller": "137XXXX8257", "Callee": "158XXXX9130", "CallerNumberPoolNo": "NP163517154204092175", "CalleeNumberPoolNo": "NP163517154204092175", } print(vms_service.click2_call(click2_call_form)) ================================================ FILE: volcengine/example/vms/example_click2_call_lite.py ================================================ from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") click2_call_lite_form = { "Caller": "137XXXX8257", "Callee": "158XXXX9130", "NumberPoolNo": "NPXXXXX810901043", } print(vms_service.click2_call_lite(click2_call_lite_form)) ================================================ FILE: volcengine/example/vms/example_commit_resource_upload.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") body = { "FileName": "ecb1be9b71974916a529b936702783cb.mp3", } print(vms_service.commit_resource_upload(body)) ================================================ FILE: volcengine/example/vms/example_create_number_pool.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "Name": "testsipv1", "ServiceType": 100, "SubServiceType": 101 } print(vms_service.create_number_pool(form)) ================================================ FILE: volcengine/example/vms/example_create_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") create_task_body = { "Name": "你好", "Resource": "9b39e17fb12444c78f20d6551469a6f0", "Type": 0, "NumberPoolNo": "NP162213338604093530", "Concurrency": 2, "PhoneList": [ { "Phone": "your phone", } ], "StartTime": "2022-03-01 00:00:00", "EndTime": "2022-03-12 01:30:00", "SelectNumberRule": 5, } print(vms_service.create_task(create_task_body)) ================================================ FILE: volcengine/example/vms/example_create_tts.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") body = { "Name": "我的tts测试", "TtsTemplateContent": "测试文本", "Remark": "测试", "TtsOption":"{\"loop\":0,\"loop_interval\":0,\"speed\":10,\"volume\":10,\"pitch\":10,\"voice_type\":\"BV001_streaming\",\"lang\":\"ch\",\"voice\":\"other\"}" } vms_service.create_tts(body) ================================================ FILE: volcengine/example/vms/example_delete_resource.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") delete_resource_param = { "ResourceKey": "4bb4b9b137264148998de1c227e9f652", } print(vms_service.delete_resource(delete_resource_param)) ================================================ FILE: volcengine/example/vms/example_enable_or_disable_number.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "NumberList": "xxx", "EnableCode": 2 } print(vms_service.enable_or_disable_number(form)) ================================================ FILE: volcengine/example/vms/example_fetch_resource.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") body = { "Url": "公网url,使用前需要申请正向代理", "Name": "测试文件" } vms_service.fetch_resource(body) ================================================ FILE: volcengine/example/vms/example_get_reource_upload_url.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") body = { "FileName": "ecb1be9b71974916a529b936702783cb.mp3", } print(vms_service.get_resource_upload_url(body)) ================================================ FILE: volcengine/example/vms/example_number_list.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "NumberPoolNo": "xxx", "NumberPoolTypeCode": 101, "Limit": 5, "Offset": 0 } print(vms_service.number_list(form)) ================================================ FILE: volcengine/example/vms/example_number_pool_list.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "ServiceType": 100, "SubServiceType": 101, "Limit": 5, "Offset": 0 } print(vms_service.number_pool_list(form)) ================================================ FILE: volcengine/example/vms/example_open_update_resource.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") params = { "ResourceKey": "1ca08a45a937411ebd78e572cef87086", "Name": "123.mp3" } print(vms_service.open_update_resource(params)) ================================================ FILE: volcengine/example/vms/example_pause_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") pause_task_param = { "TaskOpenId": "ecb1be9b71974916a529b936702783cb", } print(vms_service.pause_task(pause_task_param)) ================================================ FILE: volcengine/example/vms/example_query_can_call.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") query_call_call_form = { "CustomerNumberList": "188xxxx1647", "BusinessLineId": "200000001", "CallType": 1, } print(vms_service.query_call_call(query_call_call_form)) ================================================ FILE: volcengine/example/vms/example_query_open_get_resource.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") body = { "Type": 0, "Keyword": "0f299353da3343e58373132b9e3b75d4" } print(vms_service.query_open_get_resource(body)) ================================================ FILE: volcengine/example/vms/example_query_subscription.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") query_subscription_form = { "NumberPoolNo": "NP161156328504091435", "SubId": "S16329001153159fa121d9", } print(vms_service.query_subscription(query_subscription_form)) ================================================ FILE: volcengine/example/vms/example_query_subscription_for_list.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") query_subscription_for_list_form = { "NumberPoolNo": "NP161156328504091435", "PhoneNoX": "13700000003", "Status": 1, "Offset": 0, "Limit": 20, } print(vms_service.query_subscription_for_list(query_subscription_for_list_form)) ================================================ FILE: volcengine/example/vms/example_query_usable_resource.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") params = { "Type": 0, } print(vms_service.query_usable_resource(params)) ================================================ FILE: volcengine/example/vms/example_remuse_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") pause_task_param = { "TaskOpenId": "ecb1be9b71974916a529b936702783cb", } print(vms_service.resume_task(pause_task_param)) ================================================ FILE: volcengine/example/vms/example_select_number.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "NumberPoolNo": "xxx" } print(vms_service.select_number(form)) ================================================ FILE: volcengine/example/vms/example_select_number_and_bind_axb_form.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") select_number_and_bind_axb_form = { "NumberPoolNo": "NP161156328504091435", "PhoneNoA": "13700000001", "PhoneNoB": "13700000002", "ExpireTime": "1632920195", } print(vms_service.select_number_and_bind_axb(select_number_and_bind_axb_form)) ================================================ FILE: volcengine/example/vms/example_select_number_and_bind_axn.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") select_number_and_bind_axn_form = { "NumberPoolNo": "NP167092127702825445", "PhoneNoA": "13700000001", "PhoneNoB": "13700000002", "UserData": "this is my user data", "CityCode": "010", "ExpireTime": "1673071556", } print(vms_service.select_number_and_bind_axn(select_number_and_bind_axn_form)) ================================================ FILE: volcengine/example/vms/example_single_cancle.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") params = { "SingleOpenId": "9b39e17fb12444c78f20d6551469a6e0" } print(vms_service.single_cancel(params)) ================================================ FILE: volcengine/example/vms/example_single_info.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") params = { "SingleOpenId": "9b39e17fb12444c78f20d6551469a6e0" } print(vms_service.single_info(params)) ================================================ FILE: volcengine/example/vms/example_stop_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") pause_task_param = { "TaskOpenId": "ecb1be9b71974916a529b936702783cb", } print(vms_service.stop_task(pause_task_param)) ================================================ FILE: volcengine/example/vms/example_unbind_axb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") unbind_axb_form = { "NumberPoolNo": "NP161156328504091435", "SubId": "S16328999093159b70bc71", } print(vms_service.unbind_axb(unbind_axb_form)) ================================================ FILE: volcengine/example/vms/example_unbind_axn.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") unbind_axn_form = { "NumberPoolNo": "NP162981168404095092", "SubId": "S16329006138991e7e1003", } print(vms_service.unbind_axn(unbind_axn_form)) ================================================ FILE: volcengine/example/vms/example_unbind_axne.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") unbind_axne_form = { "NumberPoolNo": "NP167091934402820309", "SubId": "S16729852979534c6e4719", } print(vms_service.unbind_axne(unbind_axne_form)) ================================================ FILE: volcengine/example/vms/example_unbind_axyb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") unbind_axyb_form = { "NumberPoolNo": "NP166375725010908111", "SubId": "S16729852979534c6e4719", } print(vms_service.unbind_axyb(unbind_axyb_form)) ================================================ FILE: volcengine/example/vms/example_update_axb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") update_axb_form = { "NumberPoolNo": "NP161156328504091435", "SubId": "S1632900399315954ffbfd", "UpdateType": "updateExpireTime", "ExpireTime": "1632923795", } print(vms_service.update_axb(update_axb_form)) ================================================ FILE: volcengine/example/vms/example_update_axn.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") update_axn_form = { "NumberPoolNo": "NP162981168404095092", "SubId": "S16329006138991e7e1003", "UpdateType": "updatePhoneNoB", "PhoneNoB": "13700000004", } print(vms_service.update_axn(update_axn_form)) ================================================ FILE: volcengine/example/vms/example_update_axne.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") update_axne_form = { "NumberPoolNo": "NP167091934402820309", "SubId": "S1672985491953460b645f", "UpdateType": "updatePhoneNoB", "PhoneNoB": "189000000001", } print(vms_service.update_axne(update_axne_form)) ================================================ FILE: volcengine/example/vms/example_update_axyb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") update_axyb_form = { "NumberPoolNo": "NP167091934402820309", "SubId": "S1672985491953460b641f", "UpdateType": "UpdatePhoneNoA", "PhoneNoA": "18900000001", } print(vms_service.update_axyb(update_axyb_form)) ================================================ FILE: volcengine/example/vms/example_update_number_pool.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") form = { "Name": "testsipv2", "ServiceType": 100, "SubServiceType": 101, "NumberPoolNo": "todo" } print(vms_service.update_number_pool(form)) ================================================ FILE: volcengine/example/vms/example_update_task.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") update_task_body = { "TaskOpenId": "106d2984fbf0480480cbc8b98d609592", "Concurrency": 3, "StartTime": "2022-03-02 00:00:00", "EndTime": "2022-03-13 01:30:00", "Recall": 1 } print(vms_service.update_task(update_task_body)) ================================================ FILE: volcengine/example/vms/example_upgrade_ax_to_axb.py ================================================ # coding:utf-8 from volcengine.vms.VmsService import VmsService if __name__ == '__main__': vms_service = VmsService() vms_service.set_ak("your ak") vms_service.set_sk("your sk") upgrade_ax_to_axb_form = { "NumberPoolNo": "NP161156328504091435", "SubId": "S163290034831599ce523b", "PhoneNoB": "13700000002", "UserData": "this is my user data", } print(vms_service.upgrade_ax_to_axb(upgrade_ax_to_axb_form)) ================================================ FILE: volcengine/example/vod/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/callback/AddCallbackSubscriptionExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodAddCallbackSubscriptionRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodAddCallbackSubscriptionRequest() req.SpaceName = 'your space name' req.Url = 'your url' req.ContentType = 'your ContentType' resp = vod_service.add_callback_subscription(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/callback/SetCallbackEvent.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodSetCallbackEventRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodSetCallbackEventRequest() req.SpaceName = 'your space name' # AuthEnabled 1: enable;0: disable req.AuthEnabled = '1' req.PrivateKey = 'your private key' resp = vod_service.set_callback_event(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/callback/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/cdn/AddOrUpdateCertificate.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import AddOrUpdateCertificateV2Request if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = AddOrUpdateCertificateV2Request() req.SpaceName = 'your space name' req.Domain = 'your domain' req.DomainType = 'your DomainType' req.CertificateId = 'your CertificateId' req.HttpsStatus = 'your HttpsStatus' resp = vod_service.add_or_update_certificate(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/CreateCdnPreloadTaskExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCreateCdnPreloadTaskRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodCreateCdnPreloadTaskRequest() req.SpaceName = 'your space name' resp = vod_service.create_cdn_preload_task(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/CreateCdnRefreshTaskExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCreateCdnRefreshTaskRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodCreateCdnRefreshTaskRequest() req.SpaceName = 'your space name' resp = vod_service.create_cdn_refresh_task(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/CreateDomainExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCreateDomainV2Request if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodCreateDomainV2Request() req.SpaceName = 'your space name' resp = vod_service.create_domain(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/DescribeCdnIpExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeIPInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeIPInfoRequest() req.Ips = "1.1.1.1" resp = vod_service.describe_ip_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/DescribeDomainConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeDomainConfigRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeDomainConfigRequest() req.SpaceName = 'your space name' req.DomainType = 'your domain type' req.Domain = 'your domain' resp = vod_service.describe_domain_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/DescribeDomainVerifyContentExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeDomainVerifyContentRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeDomainVerifyContentRequest() req.Domain = 'your domain' resp = vod_service.describe_domain_verify_content(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/DescribeVodDomainBandwidthDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeVodDomainBandwidthDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeVodDomainBandwidthDataRequest() req.DomainList = "" req.DomainInSpaceList = "" req.StartTime = "" req.EndTime = "" req.Aggregation = 0 req.BandwidthType = "" req.Area = "" req.RegionList = "" resp = vod_service.describe_vod_domain_bandwidth_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/DescribeVodDomainTrafficDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeVodDomainTrafficDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeVodDomainTrafficDataRequest() req.DomainList = "" req.DomainInSpaceList = "" req.StartTime = "" req.EndTime = "" req.Aggregation = 0 req.TrafficType = "" req.Area = "" req.RegionList = "" resp = vod_service.describe_vod_domain_traffic_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnAccessLogExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnAccessLogRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnAccessLogRequest() req.SpaceName = 'your space name' req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 resp = vod_service.list_cdn_access_log(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnPvDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnPvDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnPvDataRequest() req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 resp = vod_service.list_cdn_pv_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnStatusDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnStatusDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnStatusDataRequest() req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 resp = vod_service.list_cdn_status_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnTasksExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnTasksRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnTasksRequest() req.SpaceName = 'your space name' req.TaskId = 'your task_id' req.DomainName = 'your domain' req.TaskType = 'your task type' req.Status = 'your status' req.StartTimestamp = 0 req.EndTimestamp = 0 req.PageNum = 1 req.PageSize = 10 resp = vod_service.list_cdn_tasks(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnTopAccessExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnTopAccessRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnTopAccessRequest() req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 req.SortType = 'your sort type' req.Item = 'your item' resp = vod_service.list_cdn_top_access(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnTopAccessUrlExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnTopAccessUrlRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnTopAccessUrlRequest() req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 req.SortType = 'your sort type' resp = vod_service.list_cdn_top_access_url(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListCdnUsageDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListCdnUsageDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListCdnUsageDataRequest() req.Domains = 'your domian' req.StartTimestamp = 0 req.EndTimestamp = 0 resp = vod_service.list_cdn_usage_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/ListDomainExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListDomainRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListDomainRequest() req.SpaceName = 'your space name' resp = vod_service.list_domain(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/UpdateDomainAuthConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateDomainAuthConfigV2Request if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateDomainAuthConfigV2Request() req.SpaceName = 'your space name' resp = vod_service.update_domain_auth_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/UpdateDomainConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateDomainConfigRequest from volcengine.vod.models.business.vod_cdn_pb2 import VodDomainConfig if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateDomainConfigRequest() req.SpaceName = 'your space name' req.DomainType = 'your domain type' req.Domain = 'your domain' config = VodDomainConfig() req.Config.CopyFrom(config) resp = vod_service.update_domain_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/UpdateDomainExpireExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateDomainExpireV2Request if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateDomainExpireV2Request() #req.SpaceName = 'your space name' resp = vod_service.update_domain_expire(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/UpdateDomainUrlAuthConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateDomainUrlAuthConfigV2Request if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateDomainUrlAuthConfigV2Request() req.SpaceName = 'your space name' req.DomainType= 'your DomainType' req.Domain = 'your Domain' req.MainKey = 'your MainKey' req.BackupKey = 'your BackupKey' req.Status = 'your Status' resp = vod_service.update_domain_url_auth_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/VerifyDomainOwnerExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodVerifyDomainOwnerRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodVerifyDomainOwnerRequest() req.Domain = 'your domain' req.VerifyType = 'your verify type' resp = vod_service.verify_domain_owner(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/cdn/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/measure/DescribeVodEnhanceImageData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodEnhanceImageDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodEnhanceImageDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.TaskTypeList = 'your TaskTypeList' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.RegionList = "" resp = vod_service.describe_vod_enhance_image_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodMostPlayedStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodMostPlayedStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodMostPlayedStatisDataRequest() req.Space = 'your Space' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.OrderType = 'your OrderType' req.TopN = 0 resp = vod_service.describe_vod_most_played_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodPlayedStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodPlayedStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodPlayedStatisDataRequest() req.Space = 'your Space' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.VidList = 'your VidList' req.OrderType = 'your OrderType' resp = vod_service.describe_vod_played_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodRealtimeMediaData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodRealtimeMediaDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodRealtimeMediaDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.ProcessType = 'your ProcessType' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' resp = vod_service.describe_vod_realtime_media_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodRealtimeMediaDetailData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodRealtimeMediaDetailDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodRealtimeMediaDetailDataRequest() req.Region = 'your Region' req.Space = 'your Space' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.PageSize = 0 req.PageNum = 0 resp = vod_service.describe_vod_realtime_media_detail_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSnapshotData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSnapshotDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSnapshotDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.SnapshotType = 'your SnapshotType' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "" resp = vod_service.describe_vod_snapshot_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceAIStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceAIStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceAIStatisDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.MediaAiType = 'your MediaAiType' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "your RegionList" resp = vod_service.describe_vod_space_a_i_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceDetectStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceDetectStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceDetectStatisDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.DetectType = 'your DetectType' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "your RegionList" resp = vod_service.describe_vod_space_detect_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceEditDetailData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceEditDetailDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceEditDetailDataRequest() req.Region = 'your Region' req.Space = 'your Space' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.PageSize = 0 req.PageNum = 0 resp = vod_service.describe_vod_space_edit_detail_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceEditStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceEditStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceEditStatisDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.Specification = 'your Specification' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "" resp = vod_service.describe_vod_space_edit_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceSubtitleStatisData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceSubtitleStatisDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceSubtitleStatisDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.SubtitleType = 'your SubtitleType' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "your RegionList" resp = vod_service.describe_vod_space_subtitle_statis_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceTranscodeData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceTranscodeDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceTranscodeDataRequest() req.SpaceList = 'your SpaceList' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.TranscodeType = 'your TranscodeType' req.Specification = 'your Specification' req.TaskStageList = 'your TaskStageList' req.Aggregation = 0 req.DetailFieldList = 'your DetailFieldList' req.RegionList = "your RegionList" resp = vod_service.describe_vod_space_transcode_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodSpaceWorkflowDetailData.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodSpaceWorkflowDetailDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodSpaceWorkflowDetailDataRequest() req.Region = 'your Region' req.Space = 'your Space' req.StartTime = 'your StartTime' req.EndTime = 'your EndTime' req.PageSize = 0 req.PageNum = 0 resp = vod_service.describe_vod_space_workflow_detail_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/measure/DescribeVodVidTrafficFileLogExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import DescribeVodVidTrafficFileLogRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = DescribeVodVidTrafficFileLogRequest() req.SpaceList = "your SpaceList" req.StartTime = "your StartTime" req.EndTime = "your EndTime" resp = vod_service.describe_vod_vid_traffic_file_log(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/measure/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/media/DeleteMaterial.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDeleteMaterialRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req20 = VodDeleteMaterialRequest() req20.SpaceName="SpaceName" req20.Mid = "mid" resp = vod_service.delete_material(req20) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/DeleteMediaTosFile.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDeleteMediaTosFileRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req20 = VodDeleteMediaTosFileRequest() req20.SpaceName="SpaceName" req20.FileNames.append("fileName") resp = vod_service.delete_media_tos_file(req20) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/GetAdAuditResultByVidExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetAdAuditResultByVidRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetAdAuditResultByVidRequest() req.SpaceName = "your SpaceName" req.Vid = "your Vid" req.FileIds.append("your FileIds") resp = vod_service.get_ad_audit_result_by_vid(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/GetFileInfos.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetFileInfosRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req20 = VodGetFileInfosRequest() req20.SpaceName = "SpaceName" # url encode req20.EncodedFileNames = "EncodedFileNames" # non-required param req20.BucketName = "BucketName" req20.NeedDownloadUrl = True req20.DownloadUrlNetworkType = "NetworkType" req20.DownloadUrlExpire = 3600 resp = vod_service.get_file_infos(req20) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/GetInnerAuditURLsExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetInnerAuditURLsRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetInnerAuditURLsRequest() req.SpaceName = "your SpaceName" req.Vid = "your Vid" req.FileNames.append("your FileNames") resp = vod_service.get_inner_audit_u_r_ls(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/GetSubtitleAuthToken.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetSubtitleInfoListRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req11 = VodGetSubtitleInfoListRequest() req11.Vid = 'vid' token = vod_service.get_subtitle_auth_token(req11, 60) except Exception: raise else: print(token) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/GetSubtitleToken.py ================================================ ================================================ FILE: volcengine/example/vod/media/ListBlockObjectTasks.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListBlockObjectTasksRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req20 = VodListBlockObjectTasksRequest() req20.SpaceName = "SpaceName" resp = vod_service.list_block_object_tasks(req20) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/ListFileMetaInfosByFileNames.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListFileMetaInfosByFileNamesRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListFileMetaInfosByFileNamesRequest() req.SpaceName = 'spacename' req.BucketName = 'bucketname' req.FileNameEncodeds = 'a/b/c/d.jpg' resp = vod_service.list_file_meta_infos_by_file_names(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/MediaExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetMediaInfosRequest, VodGetRecommendedPosterRequest, \ VodUpdateMediaPublishStatusRequest, VodUpdateMediaInfoRequest, VodDeleteMediaRequest, VodDeleteTranscodesRequest, \ VodGetMediaListRequest, VodCreateVideoClassificationRequest, VodUpdateVideoClassificationRequest, \ VodDeleteVideoClassificationRequest, VodListVideoClassificationsRequest, VodListSnapshotsRequest, \ VodUpdateMediaStorageClassRequest, VodExtractMediaMetaTaskRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: vids = 'vid1,vid2' req = VodGetMediaInfosRequest() req.Vids = vids resp = vod_service.get_media_infos(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) try: vids = 'vid1,vid2' req2 = VodGetRecommendedPosterRequest() req2.Vids = vids resp2 = vod_service.get_recommended_poster(req2) except Exception: raise else: print(resp2) if resp2.ResponseMetadata.Error.Code == '': print(resp2.Result) else: print(resp2.ResponseMetadata.Error) print('*' * 100) try: vid = 'vid' status = 'Unpublished' req3 = VodUpdateMediaPublishStatusRequest() req3.Vid = vid req3.Status = status resp3 = vod_service.update_media_publish_status(req3) except Exception: raise else: print(resp3) if resp3.ResponseMetadata.Error.Code == '': print('update media publish status success') else: print(resp3.ResponseMetadata.Error) print('*' * 100) try: req4 = VodUpdateMediaInfoRequest() req4.Vid = 'vid' req4.Title.value = 'title' req4.Description.value = 'description' req4.Tags.value = 'tag1,tag2' req4.ClassificationId.value = 0 resp4 = vod_service.update_media_info(req4) except Exception: raise else: print(resp4) if resp4.ResponseMetadata.Error.Code == '': print('update media info success') else: print(resp4.ResponseMetadata.Error) print('*' * 100) try: vids = 'vid1,vid2' callBackArgs = 'CallBackArgs' req5 = VodDeleteMediaRequest() req5.Vids = vids req5.CallbackArgs = callBackArgs resp5 = vod_service.delete_media(req5) except Exception: raise else: print(resp5) if resp5.ResponseMetadata.Error.Code == '': print('delete media info success') else: print(resp5.ResponseMetadata.Error) print('*' * 100) try: vid = 'vid' fileIds = 'fileId1,fileId2' callBackArgs = 'CallBackArgs' req6 = VodDeleteTranscodesRequest() req6.Vid = vid req6.FileIds = fileIds req6.CallbackArgs = callBackArgs resp6 = vod_service.delete_transcodes(req6) except Exception: raise else: print(resp6) if resp6.ResponseMetadata.Error.Code == '': print('delete transcodes info success') else: print(resp6.ResponseMetadata.Error) print('*' * 100) try: req7 = VodGetMediaListRequest() req7.SpaceName = 'your space name' req7.Vid = 'your vid' req7.Status = 'Published' #Published/Unpublished req7.Order = 'Desc' #Desc/Asc req7.StartTime = '1999-01-01T00:00:00Z' req7.EndTime = '2021-04-01T00:00:00Z' req7.Offset = '0' req7.PageSize = '10' req7.ClassificationId = 1 resp7 = vod_service.get_media_list(req7) except Exception: raise else: print(resp7) if resp7.ResponseMetadata.Error.Code == '': print(resp7.Result) else: print(resp7.ResponseMetadata.Error) print('*' * 100) try: req8 = VodCreateVideoClassificationRequest() req8.SpaceName = 'your space' req8.Level = 1 req8.ParentId = 0 req8.Classification = 'your classification' resp8 = vod_service.create_video_classification(req8) except Exception: raise else: print(resp8) if resp8.ResponseMetadata.Error.Code == '': print(resp8.Result) else: print(resp8.ResponseMetadata.Error) print('*' * 100) try: req9 = VodUpdateVideoClassificationRequest() req9.SpaceName = 'your space' req9.ClassificationId = 0 req9.Classification = 'your classification' resp9 = vod_service.update_video_classification(req9) except Exception: raise else: print(resp9) if resp9.ResponseMetadata.Error.Code == '': print(resp9.Result) else: print(resp9.ResponseMetadata.Error) print('*' * 100) try: req10 = VodDeleteVideoClassificationRequest() req10.SpaceName = 'your space' req10.ClassificationId = 0 resp10 = vod_service.delete_video_classification(req10) except Exception: raise else: print(resp10) if resp10.ResponseMetadata.Error.Code == '': print(resp10.Result) else: print(resp10.ResponseMetadata.Error) print('*' * 100) try: req11 = VodListVideoClassificationsRequest() req11.SpaceName = 'your space' req11.ClassificationId = 0 resp11 = vod_service.list_video_classifications(req11) except Exception: raise else: print(resp11) if resp11.ResponseMetadata.Error.Code == '': print(resp11.Result) else: print(resp11.ResponseMetadata.Error) print('*' * 100) try: req12 = VodListSnapshotsRequest() req12.Vid = "your vid" resp12 = vod_service.list_snapshots(req12) except Exception: raise else: print(resp12) if resp12.ResponseMetadata.Error.Code == '': print(resp12.Result) else: print(resp12.ResponseMetadata.Error) try: vids = "vid1" fileIds = "fileid1" req13 = VodUpdateMediaStorageClassRequest() req13.Vids = vids req13.FileIds = fileIds req13.StorageClass = "your storage class" req13.CallbackArgs = "your callbackargs" resp13 = vod_service.update_media_storage_class(req13) except Exception: raise else: print(resp13) if resp13.ResponseMetadata.Error.Code == '': print(resp13.Result) else: print(resp13.ResponseMetadata.Error) print('*' * 100) try: req14 = VodExtractMediaMetaTaskRequest() req14.Vid = "vid" resp14 = vod_service.extract_media_meta_task(req14) except Exception: raise else: print(resp14) if resp14.ResponseMetadata.Error.Code == '': print(resp14.Result) else: print(resp14.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/SubmitBlockObjectTasks.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodSubmitBlockObjectTasksRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req20 = VodSubmitBlockObjectTasksRequest() req20.SpaceName = "SpaceName" resp = vod_service.submit_block_object_tasks(req20) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/media/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/play/CreateHlsDecryptionKeyExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCreateHlsDecryptionKeyRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodCreateHlsDecryptionKeyRequest() req.SpaceName = "your SpaceName" resp = vod_service.create_hls_decryption_key(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetAllPlayInfoExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetAllPlayInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetAllPlayInfoRequest() req.Vids = 'your Vids' req.Formats = 'your Formats' req.Codecs = 'your Codecs' req.Definitions = 'your Definitions' req.FileTypes = 'your FileTypes' req.LogoTypes = 'your LogoTypes' req.NeedEncryptStream = 'your NeedEncryptStream' req.Ssl = 'your Ssl' req.NeedThumbs = 'your NeedThumbs' req.NeedBarrageMask = 'your NeedBarrageMask' req.CdnType = 'your CdnType' req.UnionInfo = 'your UnionInfo' req.PlayScene = 'your PlayScene' req.DrmExpireTimestamp = 'your DrmExpireTimestamp' req.HDRType = 'your HDRType' req.KeyFrameAlignmentVersion = 'your KeyFrameAlignmentVersion' req.UserAction = 'your UserAction' req.Quality = 'your Quality' resp = vod_service.get_all_play_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetHlsDrmAuthTokenExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: expireSeconds = 60000 resp = vod_service.get_sha1_hls_drm_auth_token(expireSeconds) except Exception: raise else: print(resp) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetPlayAuthTokenExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetPlayInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: vid = 'your vid' req = VodGetPlayInfoRequest() req.Vid = vid expire = 60 # seconds resp = vod_service.get_play_auth_token(req, expire) except Exception: raise else: print(resp) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetPlayInfoExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetPlayInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: vid = 'your vid' req = VodGetPlayInfoRequest() req.Vid = vid req.Ssl = '1' req.NeedOriginal = '1' req.UnionInfo = 'your unionInfo' resp = vod_service.get_play_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.PlayInfoList[0].MainPlayUrl) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetPlayInfoWithLiveTimeShiftSceneExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetPlayInfoWithLiveTimeShiftSceneRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetPlayInfoWithLiveTimeShiftSceneRequest() req.StoreUris = 'uri1,uri2,uri3' req.SpaceName = 'your space name' req.Ssl = '0 or 1' req.ExpireTimestamp = 'unix timestamp' req.NeedComposeBucketName = '0 or 1' resp = vod_service.get_play_info_with_live_time_shift_scene(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.PlayInfoList[0].MainPlayUrl) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetPrivateDrmPlayAuthExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetPrivateDrmPlayAuthRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: vid = 'your vid' req = VodGetPrivateDrmPlayAuthRequest() req.Vid = vid req.DrmType = 'your drm type' req.PlayAuthIds = 'a,b,c (your PlayAuthIds)' req.UnionInfo = 'your unionInfo' resp = vod_service.get_private_drm_play_auth(req) except Exception: raise else: print(resp) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/GetPrivateDrmPlayAuthTokenExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetPrivateDrmPlayAuthRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: vid = 'your vid' req = VodGetPrivateDrmPlayAuthRequest() req.Vid = vid req.DrmType = 'your drm type' req.PlayAuthIds = 'a,b,c (your PlayAuthIds)' req.UnionInfo = 'your unionInfo' expire = 60 # seconds resp = vod_service.get_private_drm_play_auth_token(req, expire) except Exception: raise else: print(resp) print('*' * 100) ================================================ FILE: volcengine/example/vod/play/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/space/CreateSpaceExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCreateSpaceRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodCreateSpaceRequest() req.SpaceName = 'your space name' req.ProjectName = 'your space name' resp = vod_service.create_space(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/space/DescribeUploadSpaceConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeUploadSpaceConfigRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeUploadSpaceConfigRequest() req.SpaceName = "your SpaceName" resp = vod_service.describe_upload_space_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/space/DescribeVodSpaceStorageDataExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodDescribeVodSpaceStorageDataRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodDescribeVodSpaceStorageDataRequest() req.SpaceList = "your SpaceList" req.StartTime = "your StartTime" req.EndTime = "your EndTime" req.Aggregation = 0 req.Type = "" req.RegionList = "your RegionList" resp = vod_service.describe_vod_space_storage_data(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/space/ListSpaceExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodListSpaceRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodListSpaceRequest() resp = vod_service.list_space(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/space/UpdateSpaceExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateSpaceRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateSpaceRequest() req.SpaceName = 'your space name' req.Description = 'your desc' resp = vod_service.update_space(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/space/UpdateSpaceUploadConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateSpaceUploadConfigRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateSpaceUploadConfigRequest() req.SpaceName = 'your space name' req.ConfigKey = 'your config key' req.ConfigValue = 'your config value' resp = vod_service.update_space_upload_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/space/UpdateUploadSpaceConfigExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUpdateUploadSpaceConfigRequest from volcengine.vod.models.business.vod_space_pb2 import CustomPosterConfig from volcengine.vod.models.business.vod_space_pb2 import TranscodeConfig if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodUpdateUploadSpaceConfigRequest() req.SpaceName = "your SpaceName" req.AutoPoster = "your AutoPoster" req.CustomPosterConfig.CopyFrom(CustomPosterConfig()) req.GetPosterMode = "your GetPosterMode" req.AutoPosterCandidate = "your AutoPosterCandidate" req.AutoTranscode = "your AutoTranscode" req.TranscodeConfig.CopyFrom(TranscodeConfig()) req.AutoSetVideoStatus = "your AutoSetVideoStatus" req.UploadOverwrite = "your UploadOverwrite" req.CallbackReturnPlayUrl = "your CallbackReturnPlayUrl" req.CallbackReturnRunId = "your CallbackReturnRunId" req.GetMetaMode = "your GetMetaMode" req.AutoGetArchiveVideoMeta = "your AutoGetArchiveVideoMeta" req.AutoGetIAVideoMeta = "your AutoGetIAVideoMeta" req.MetaGetMd5 = "your MetaGetMd5" resp = vod_service.update_upload_space_config(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) print('*' * 100) ================================================ FILE: volcengine/example/vod/space/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/subtitle/SubtitleExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import * if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req8 = VodGetSubtitleInfoListRequest() req8.Vid = 'vid' req8.FileIds = 'fileIds' req8.Formats = 'format' req8.Languages = 'language' req8.LanguageIds = 'languageIds' req8.SubtitleIds = 'subtitleIds' req8.Status = 'Published' #Published/Unpublished req8.Title = 'title' req8.Tag = 'tag' req8.Ssl = 'ssl' req8.Offset = 'offset' req8.PageSize = 'pageSize' resp8 = vod_service.get_subtitle_info_list(req8) except Exception: raise else: print(resp8) if resp8.ResponseMetadata.Error.Code == '': print('get subtitle info list success') else: print(resp8.ResponseMetadata.Error) print('*' * 100) try: req9 = VodUpdateSubtitleStatusRequest() req9.Vid = 'vid' req9.FileIds = 'fileId1,fileId2' req9.Formats = 'format1,format2' req9.Languages = 'language1,language2' req9.Status = 'Published' #Published/Unpublished resp9 = vod_service.update_subtitle_status(req9) except Exception: raise else: print(resp9) if resp9.ResponseMetadata.Error.Code == '': print('update subtitle status success') else: print(resp9.ResponseMetadata.Error) print('*' * 100) try: req10 = VodUpdateSubtitleInfoRequest() req10.Vid = 'vid' req10.FileId = 'fileIds' req10.Format = 'format' req10.Language = 'language' req10.Title.value = 'title' req10.Tag.value = 'tag' resp10 = vod_service.update_subtitle_info(req10) except Exception: raise else: print(resp10) if resp10.ResponseMetadata.Error.Code == '': print('update subtitle info success') else: print(resp10.ResponseMetadata.Error) print('*' * 100) try: req11 = VodGetSubtitleInfoListRequest() req11.Vid = 'vid' token = vod_service.get_subtitle_auth_token(req11, 60) except Exception: raise else: print(token) print('*' * 100) ================================================ FILE: volcengine/example/vod/subtitle/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/upload/ApplyUploadInfoExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodApplyUploadInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space' try: req = VodApplyUploadInfoRequest() req.SpaceName = space_name resp = vod_service.apply_upload_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.UploadAddress.StoreInfos[0].StoreUri) print(resp.Result.Data.UploadAddress.StoreInfos[0].Auth) print(resp.Result.Data.UploadAddress.UploadHosts[0]) print(resp.Result.Data.UploadAddress.SessionKey) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/CommitUploadInfoExample.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.util.Functions import Function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCommitUploadInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space' session = '' try: req = VodCommitUploadInfoRequest() req.SpaceName = space_name req.SessionKey = session get_meta_function = Function.get_meta_func() snapshot_function = Function.get_snapshot_func(2.3) req.Functions = json.dumps([get_meta_function, snapshot_function]) resp = vod_service.commit_upload_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Vid) print(resp.Result.Data.PosterUri) print(resp.Result.Data.SourceInfo.Height) print(resp.Result.Data.SourceInfo.Width) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/QueryUploadTaskInfo.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodQueryUploadTaskInfoRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') jobId = 'url jobId' jobIds = [jobId] comma = ',' s = comma.join(jobIds) req = VodQueryUploadTaskInfoRequest() req.JobIds = s try: resp = vod_service.query_upload_task_info(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.MediaInfoList[0].State) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/UploadMaterial.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.util.Functions import Function from volcengine.vod.VodService import VodService from volcengine.const.Const import * from volcengine.vod.models.request.request_vod_pb2 import VodUploadMaterialRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space name' file_path = 'your file path' get_meta_function = Function.get_meta_func() snapshot_function = Function.get_snapshot_func(2.3) add_option_function = Function.get_add_material_option_info_func(title='素材测试视频', tags='test', description='素材测试,视频文件', category=CATEGORY_VIDEO, record_type=2, format_input='MP4') try: req = VodUploadMaterialRequest() req.FileType = FILE_TYPE_MEDIA req.SpaceName = space_name req.FilePath = file_path req.Functions = json.dumps([get_meta_function, snapshot_function, add_option_function]) req.CallbackArgs = '' req.FileExtension = '.mp4' req.UploadHostPrefer = '' resp = vod_service.upload_material(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Mid) print(resp.Result.Data.PosterUri) print(resp.Result.Data.SourceInfo.FileName) print(resp.Result.Data.SourceInfo.Height) print(resp.Result.Data.SourceInfo.Width) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) if __name__ == '__main__': vod_service = VodService() # call below method if you dont set ak and sk in $HOME/.vcloud/config vod_service.set_ak('your ak') vod_service.set_sk('your sk') space_name = 'your space name' file_path = 'your file path' get_meta_function = Function.get_meta_func() snapshot_function = Function.get_snapshot_func(0) add_option_function = Function.get_add_material_option_info_func(title='素材测试图片', tags='test', description='素材测试,图片文件', category=CATEGORY_IMAGE, record_type=2, format_input='jpg') try: req = VodUploadMaterialRequest() req.FileType = FILE_TYPE_IMAGE req.SpaceName = space_name req.FilePath = file_path req.Functions = json.dumps([get_meta_function, snapshot_function, add_option_function]) req.CallbackArgs = '' req.FileName = '' req.FileExtension = '.jpg' req.UploadHostPrefer = '' resp = vod_service.upload_material(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Mid) print(resp.Result.Data.PosterUri) print(resp.Result.Data.SourceInfo.FileName) print(resp.Result.Data.SourceInfo.Height) print(resp.Result.Data.SourceInfo.Width) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) if __name__ == '__main__': vod_service = VodService() # call below method if you dont set ak and sk in $HOME/.vcloud/config vod_service.set_ak('your ak') vod_service.set_sk('your sk') space_name = 'your space name' file_path = 'your file path' get_meta_function = Function.get_meta_func() add_option_function = Function.get_add_material_option_info_func(title='素材测试字幕', tags='test', description='素材测试,字幕文件', category=CATEGORY_FONT, record_type=2, format_input='vtt') try: req = VodUploadMaterialRequest() req.FileType = FILE_TYPE_OBJECT req.SpaceName = space_name req.FilePath = file_path req.Functions = json.dumps([get_meta_function, add_option_function]) req.CallbackArgs = '' req.FileName = '' req.FileExtension = '.vtt' req.UploadHostPrefer = '' resp = vod_service.upload_material(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Mid) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/UploadMedia.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.util.Functions import Function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUploadMediaRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space name' file_path = 'your file path' get_meta_function = Function.get_meta_func() snapshot_function = Function.get_snapshot_func(2.3) get_start_workflow_func = Function.get_start_workflow_template_func( [{"TemplateIds": ["imp template id"], "TemplateType": "imp"}, {"TemplateIds": ["transcode template id"], "TemplateType": "transcode"}]) apply_function = Function.get_add_option_info_func("title1", "tag1", "desc1", 0, False) try: req = VodUploadMediaRequest() req.SpaceName = space_name req.FilePath = file_path req.Functions = json.dumps([get_meta_function, snapshot_function, get_start_workflow_func]) req.CallbackArgs = '' req.FileName = 'hello/vod.mp4' req.FileExtension = '.mp4' req.StorageClass = 0 req.UploadHostPrefer = '' resp = vod_service.upload_media(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Vid) print(resp.Result.Data.PosterUri) print(resp.Result.Data.SourceInfo.FileName) print(resp.Result.Data.SourceInfo.Height) print(resp.Result.Data.SourceInfo.Width) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/UploadMediaHLS.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.util.Functions import Function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUploadMediaRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space name' file_path = 'your m3u8 file path' # e.g., /path/to/video.m3u8 get_meta_function = Function.get_meta_func() snapshot_function = Function.get_snapshot_func(2.3) get_start_workflow_func = Function.get_start_workflow_template_func( [{"TemplateIds": ["imp template id"], "TemplateType": "imp"}, {"TemplateIds": ["transcode template id"], "TemplateType": "transcode"}]) apply_function = Function.get_add_option_info_func("title1", "tag1", "desc1", 0, False) try: req = VodUploadMediaRequest() req.SpaceName = space_name req.FilePath = file_path req.Functions = json.dumps([get_meta_function, snapshot_function, get_start_workflow_func]) req.CallbackArgs = '' # The path in the storage space, should be set to prevent overwriting existing hls ts files req.FileName = 'hello/video.m3u8' req.FileExtension = '.m3u8' req.StorageClass = 0 req.UploadHostPrefer = '' # Set SupportParseManifest to True to enable HLS manifest parsing and segment uploading req.SupportParseManifest = True resp = vod_service.upload_media(req) except Exception as e: print(f"Error: {e}") raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data.Vid) print(resp.Result.Data.PosterUri) print(resp.Result.Data.SourceInfo.FileName) print(resp.Result.Data.SourceInfo.Height) print(resp.Result.Data.SourceInfo.Width) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/UploadSts2.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') sts2 = vod_service.get_upload_sts2_with_expired_time(60 * 60) print(sts2) sts2 = vod_service.get_upload_sts2() print(sts2) ================================================ FILE: volcengine/example/vod/upload/UploadUrl.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodUrlUploadRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') space_name = 'your space' url = '' try: req = VodUrlUploadRequest() req.SpaceName = space_name url_set = req.URLSets.add() url_set.SourceUrl = url url_set.FileExtension = '.mp4' impTemplate = url_set.Templates.add() impTemplate.TemplateIds.extend(['imp template id']) impTemplate.TemplateType = 'imp' transcodeTemplate = url_set.Templates.add() transcodeTemplate.TemplateIds.extend(['transcode template id']) transcodeTemplate.TemplateType = 'transcode' url_set.CallbackArgs = 'my python callback args' customUrlHeaders = {'your header key': 'your header value'} url_set.CustomURLHeaders.update(**customUrlHeaders) resp = vod_service.upload_media_by_url(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result.Data) print(resp.Result.Data[0].JobId) print(resp.Result.Data[0].SourceUrl) else: print(resp.ResponseMetadata.Error) print(resp.ResponseMetadata.RequestId) ================================================ FILE: volcengine/example/vod/upload/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/vedit/AsyncVCreativeTaskExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodAsyncVCreativeTaskRequest import json if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: paramObj = { 'input': 'vid://{your vid}', 'style': '漫画风', 'resolution': '720p' } paramStr = json.dumps(paramObj) req = VodAsyncVCreativeTaskRequest() req.Uploader = "your Uploader" req.ParamStr = paramStr req.Scene = "videostyletrans" req.CallbackArgs = "your CallbackArgs" resp = vod_service.async_v_creative_task(req) except Exception: raise else: l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/CancelDirectEditTask.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodCancelDirectEditTaskRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') req = VodCancelDirectEditTaskRequest() req.ReqId = 'your ReqId' resp = vod_service.cancel_direct_edit_task(req) l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/GetDirectEditProgress.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetDirectEditProgressRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') req = VodGetDirectEditProgressRequest() req.ReqId = 'your ReqId' resp = vod_service.get_direct_edit_progress(req) l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/GetDirectEditResult.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetDirectEditResultRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') req = VodGetDirectEditResultRequest() req.ReqIds.extend(['your ReqId']) resp = vod_service.get_direct_edit_result(req) l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/GetVCreativeTaskResultExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetVCreativeTaskResultRequest import json if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetVCreativeTaskResultRequest() req.VCreativeId = "your VCreativeId" resp = vod_service.get_v_creative_task_result(req) except Exception: raise else: l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/SubmitDirectEditTaskAsync.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodSubmitDirectEditTaskAsyncRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') req = VodSubmitDirectEditTaskAsyncRequest() req.Uploader = 'your uploader' req.Application = 'VideoTrackToB' req.Priority = 0 req.CallbackUri = 'your callback uri' req.CallbackArgs = 'your callback args' editParam = { "Canvas": { "Height": 2160, "Width": 3840 }, "Output": { "Alpha": False, "Codec": { "AudioBitrate": 128, "AudioCodec": "aac", "Crf": 23, "Preset": "slow", "VideoCodec": "h264" }, "DisableAudio": False, "DisableVideo": False, "Fps": 30 }, "Track": [ [ { "ID": "video1", "Source": "your source", "TargetTime": [ 0, 10000 ], "Type": "video" } ] ], "Upload": { "SpaceName": "your uploader", "VideoName": "your video name" }, "Uploader": "your uploader" } req.EditParam = json.dumps(editParam).encode('utf-8') resp = vod_service.submit_direct_edit_task_async(req) l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/SubmitDirectEditTaskSync.py ================================================ # coding:utf-8 from __future__ import print_function import json from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodSubmitDirectEditTaskSyncRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') req = VodSubmitDirectEditTaskSyncRequest() req.Uploader = 'your uploader' req.Application = 'SimpleCut' editParam = { "Source": "your source", "Upload": { "SpaceName": "your uploader", "StorageBind": False }, "CutList": [ { "StartTime": 9, "EndTime": 78 }, { "StartTime": 157, "EndTime": 370 } ] } req.EditParam = json.dumps(editParam).encode('utf-8') resp = vod_service.submit_direct_edit_task_sync(req) l = json.loads(resp) print(json.dumps(l, ensure_ascii=False, indent=4)) print("****") ================================================ FILE: volcengine/example/vod/vedit/__init__.py ================================================ ================================================ FILE: volcengine/example/vod/workflow/GetWorkflowExecutionExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetWorkflowExecutionStatusRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetWorkflowExecutionStatusRequest() req.RunId = 'your RunId' resp = vod_service.get_workflow_execution(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/workflow/GetWorkflowExecutionResultExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodGetWorkflowResultRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodGetWorkflowResultRequest() req.RunId = 'your RunId' resp = vod_service.get_workflow_execution_result(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/workflow/RetrieveTranscodeResultExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.request.request_vod_pb2 import VodRetrieveTranscodeResultRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodRetrieveTranscodeResultRequest() req.Vid = 'your vid' req.ResultType = 'your resultType' resp = vod_service.retrieve_transcode_result(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/workflow/WorkflowExample.py ================================================ # coding:utf-8 from __future__ import print_function from volcengine.vod.VodService import VodService from volcengine.vod.models.business.vod_workflow_pb2 import WorkflowParams from volcengine.vod.models.request.request_vod_pb2 import VodStartWorkflowRequest if __name__ == '__main__': # Create a VOD instance in the specified region. # vod_service = VodService('cn-north-1') vod_service = VodService() # Configure your Access Key ID (AK) and Secret Access Key (SK) in the environment variables or in the local ~/.volc/config file. For detailed instructions, see https://www.volcengine.com/docs/4/65646. # The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed. # During testing, you may use the following code snippet. However, do not store the AK and SK directly in your project code to prevent potential leakage and safeguard the security of all resources associated with your account. # vod_service.set_ak('your ak') # vod_service.set_sk('your sk') try: req = VodStartWorkflowRequest() req.Vid = 'your vid' req.TemplateId = 'your template id' req.Input.MergeFrom(WorkflowParams()) req.Priority = 0 req.CallbackArgs = 'your callback args' req.ClientToken = 'your ClientToken' resp = vod_service.start_workflow(req) except Exception: raise else: print(resp) if resp.ResponseMetadata.Error.Code == '': print(resp.Result) else: print(resp.ResponseMetadata.Error) ================================================ FILE: volcengine/example/vod/workflow/__init__.py ================================================ ================================================ FILE: volcengine/game_protect/GameProtectService.py ================================================ import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo import redo from requests import exceptions class GameProtectService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(GameProtectService, "_instance"): with GameProtectService._instance_lock: if not hasattr(GameProtectService, "_instance"): GameProtectService._instance = object.__new__(cls) return GameProtectService._instance def __init__(self): self.service_info = GameProtectService.get_service_info() self.api_info = GameProtectService.get_api_info() super(GameProtectService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'game_protect', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = {"RiskResult": ApiInfo("GET", "/", {"Action": "RiskResult", "Version": "2021-04-25"}, {}, {})} return api_info @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def risk_result(self, params, body): params['Service'] = 'anti_plugin' res = self.get("RiskResult", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/game_protect/__init__.py ================================================ ================================================ FILE: volcengine/iam/IamService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo class IamService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(IamService, "_instance"): with IamService._instance_lock: if not hasattr(IamService, "_instance"): IamService._instance = object.__new__(cls) return IamService._instance def __init__(self): self.service_info = IamService.get_service_info() self.api_info = IamService.get_api_info() super(IamService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("iam.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'iam', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = { # Access Key "CreateAccessKey": ApiInfo("GET", "/", {"Action": "CreateAccessKey", "Version": "2018-01-01"}, {}, {}), "DeleteAccessKey": ApiInfo("GET", "/", {"Action": "DeleteAccessKey", "Version": "2018-01-01"}, {}, {}), "ListAccessKeys": ApiInfo("GET", "/", {"Action": "ListAccessKeys", "Version": "2018-01-01"}, {}, {}), "UpdateAccessKey": ApiInfo("GET", "/", {"Action": "UpdateAccessKey", "Version": "2018-01-01"}, {}, {}), # User "CreateUser": ApiInfo("GET", "/", {"Action": "CreateUser", "Version": "2018-01-01"}, {}, {}), "GetUser": ApiInfo("GET", "/", {"Action": "GetUser", "Version": "2018-01-01"}, {}, {}), "UpdateUser": ApiInfo("GET", "/", {"Action": "UpdateUser", "Version": "2018-01-01"}, {}, {}), "ListUsers": ApiInfo("GET", "/", {"Action": "ListUsers", "Version": "2018-01-01"}, {}, {}), "DeleteUser": ApiInfo("GET", "/", {"Action": "DeleteUser", "Version": "2018-01-01"}, {}, {}), "CreateLoginProfile": ApiInfo("GET", "/", {"Action": "CreateLoginProfile", "Version": "2018-01-01"}, {}, {}), "GetLoginProfile": ApiInfo("GET", "/", {"Action": "GetLoginProfile", "Version": "2018-01-01"}, {}, {}), "UpdateLoginProfile": ApiInfo("GET", "/", {"Action": "UpdateLoginProfile", "Version": "2018-01-01"}, {}, {}), "DeleteLoginProfile": ApiInfo("GET", "/", {"Action": "DeleteLoginProfile", "Version": "2018-01-01"}, {}, {}), # Role "CreateRole": ApiInfo("GET", "/", {"Action": "CreateRole", "Version": "2018-01-01"}, {}, {}), "GetRole": ApiInfo("GET", "/", {"Action": "GetRole", "Version": "2018-01-01"}, {}, {}), "UpdateRole": ApiInfo("GET", "/", {"Action": "UpdateRole", "Version": "2018-01-01"}, {}, {}), "ListRoles": ApiInfo("GET", "/", {"Action": "ListRoles", "Version": "2018-01-01"}, {}, {}), "DeleteRole": ApiInfo("GET", "/", {"Action": "DeleteRole", "Version": "2018-01-01"}, {}, {}), "CreateServiceLinkedRole": ApiInfo("GET", "/", {"Action": "CreateServiceLinkedRole", "Version": "2018-01-01"}, {}, {}), # Identity Provider "CreateSAMLProvider": ApiInfo("POST", "/", {"Action": "CreateSAMLProvider", "Version": "2018-01-01"}, {}, {}), "GetSAMLProvider": ApiInfo("GET", "/", {"Action": "GetSAMLProvider", "Version": "2018-01-01"}, {}, {}), "UpdateSAMLProvider": ApiInfo("POST", "/", {"Action": "UpdateSAMLProvider", "Version": "2018-01-01"}, {}, {}), "ListSAMLProviders": ApiInfo("GET", "/", {"Action": "ListSAMLProviders", "Version": "2018-01-01"}, {}, {}), "DeleteSAMLProvider": ApiInfo("GET", "/", {"Action": "DeleteSAMLProvider", "Version": "2018-01-01"}, {}, {}), # Policy "CreatePolicy": ApiInfo("GET", "/", {"Action": "CreatePolicy", "Version": "2018-01-01"}, {}, {}), "GetPolicy": ApiInfo("GET", "/", {"Action": "GetPolicy", "Version": "2018-01-01"}, {}, {}), "ListPolicies": ApiInfo("GET", "/", {"Action": "ListPolicies", "Version": "2018-01-01"}, {}, {}), "UpdatePolicy": ApiInfo("GET", "/", {"Action": "UpdatePolicy", "Version": "2018-01-01"}, {}, {}), "DeletePolicy": ApiInfo("GET", "/", {"Action": "DeletePolicy", "Version": "2018-01-01"}, {}, {}), "AttachUserPolicy": ApiInfo("GET", "/", {"Action": "AttachUserPolicy", "Version": "2018-01-01"}, {}, {}), "DetachUserPolicy": ApiInfo("GET", "/", {"Action": "DetachUserPolicy", "Version": "2018-01-01"}, {}, {}), "ListAttachedUserPolicies": ApiInfo("GET", "/", {"Action": "ListAttachedUserPolicies", "Version": "2018-01-01"}, {}, {}), "AttachRolePolicy": ApiInfo("GET", "/", {"Action": "AttachRolePolicy", "Version": "2018-01-01"}, {}, {}), "DetachRolePolicy": ApiInfo("GET", "/", {"Action": "DetachRolePolicy", "Version": "2018-01-01"}, {}, {}), "ListAttachedRolePolicies": ApiInfo("GET", "/", {"Action": "ListAttachedRolePolicies", "Version": "2018-01-01"}, {}, {}), "ListEntitiesForPolicy": ApiInfo("GET", "/", {"Action": "ListEntitiesForPolicy", "Version": "2018-01-01"}, {}, {}), } return api_info # Access Key def create_access_key(self, params): res = self.get("CreateAccessKey", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_access_key(self, params): res = self.get("DeleteAccessKey", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_access_keys(self, params): res = self.get("ListAccessKeys", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_access_key(self, params): res = self.get("UpdateAccessKey", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json # User def create_user(self, params): res = self.get("CreateUser", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_user(self, params): res = self.get("GetUser", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_user(self, params): res = self.get("UpdateUser", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_users(self, params): res = self.get("ListUsers", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_user(self, params): res = self.get("DeleteUser", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_login_profile(self, params): res = self.get("CreateLoginProfile", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_login_profile(self, params): res = self.get("GetLoginProfile", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_login_profile(self, params): res = self.get("UpdateLoginProfile", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_login_profile(self, params): res = self.get("DeleteLoginProfile", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json # Role def create_role(self, params): res = self.get("CreateRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_role(self, params): res = self.get("GetRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_role(self, params): res = self.get("UpdateRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_roles(self, params): res = self.get("ListRoles", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_role(self, params): res = self.get("DeleteRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_service_linked_role(self, params): res = self.get("CreateServiceLinkedRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json # Identity Provider def create_saml_provider(self, params): res = self.post("CreateSAMLProvider", {}, params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_saml_provider(self, params): res = self.get("GetSAMLProvider", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_saml_provider(self, params): res = self.post("UpdateSAMLProvider", {}, params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_saml_providers(self, params): res = self.get("ListSAMLProviders", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_saml_provider(self, params): res = self.get("DeleteSAMLProvider", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json # Policy def create_policy(self, params): res = self.get("CreatePolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_policy(self, params): res = self.get("GetPolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_policies(self, params): res = self.get("ListPolicies", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_policy(self, params): res = self.get("UpdatePolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_policy(self, params): res = self.get("DeletePolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def attach_user_policy(self, params): res = self.get("AttachUserPolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def detach_user_policy(self, params): res = self.get("DetachUserPolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_attached_user_policies(self, params): res = self.get("ListAttachedUserPolicies", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def attach_role_policy(self, params): res = self.get("AttachRolePolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def detach_role_policy(self, params): res = self.get("DetachRolePolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_attached_role_policies(self, params): res = self.get("ListAttachedRolePolicies", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_entities_for_policy(self, params): res = self.get("ListEntitiesForPolicy", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/iam/__init__.py ================================================ ================================================ FILE: volcengine/image_registry/ImageRegistryService.py ================================================ import json import threading import redo from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from requests import exceptions class ImageRegistryService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(ImageRegistryService, "_instance"): with ImageRegistryService._instance_lock: if not hasattr(ImageRegistryService, "_instance"): ImageRegistryService._instance = object.__new__(cls) return ImageRegistryService._instance def __init__(self): self.service_info = ImageRegistryService.get_service_info() self.api_info = ImageRegistryService.get_api_info() super(ImageRegistryService, self).__init__( self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'cr', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = { "DeleteNamespaceBasic": ApiInfo( "POST", "/", {"Action": "DeleteNamespaceBasic", "Version": "2021-03-03"}, {}, {}), "CreateNamespaceBasic": ApiInfo( "POST", "/", {"Action": "CreateNamespaceBasic", "Version": "2021-03-03"}, {}, {}), "ValidateNamespaceBasic": ApiInfo( "POST", "/", {"Action": "ValidateNamespaceBasic", "Version": "2021-03-03"}, {}, {}), "GetNamespaceBasic": ApiInfo( "POST", "/", {"Action": "GetNamespaceBasic", "Version": "2021-03-03"}, {}, {}), "ListNamespacesBasic": ApiInfo( "POST", "/", {"Action": "ListNamespacesBasic", "Version": "2021-03-03"}, {}, {}), "ValidateRepositoryBasic": ApiInfo( "POST", "/", {"Action": "ValidateRepositoryBasic", "Version": "2021-03-03"}, {}, {}), "DeleteRepositoryBasic": ApiInfo( "POST", "/", {"Action": "DeleteRepositoryBasic", "Version": "2021-03-03"}, {}, {}), "CreateRepositoryBasic": ApiInfo( "POST", "/", {"Action": "CreateRepositoryBasic", "Version": "2021-03-03"}, {}, {}), "UpdateRepositoryBasic": ApiInfo( "POST", "/", {"Action": "UpdateRepositoryBasic", "Version": "2021-03-03"}, {}, {}), "GetRepositoryBasic": ApiInfo( "POST", "/", {"Action": "GetRepositoryBasic", "Version": "2021-03-03"}, {}, {}), "ListRepositoriesBasic": ApiInfo( "POST", "/", {"Action": "ListRepositoriesBasic", "Version": "2021-03-03"}, {}, {}), "DeleteTagBasic": ApiInfo( "POST", "/", {"Action": "DeleteTagBasic", "Version": "2021-03-03"}, {}, {}), "ListTagsBasic": ApiInfo( "POST", "/", {"Action": "ListTagsBasic", "Version": "2021-03-03"}, {}, {}), "GetTagBasic": ApiInfo( "POST", "/", {"Action": "GetTagBasic", "Version": "2021-03-03"}, {}, {}), "GetTagAdditionBasic": ApiInfo( "POST", "/", {"Action": "GetTagAdditionBasic", "Version": "2021-03-03"}, {}, {})} return api_info @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_namespace_basic(self, params, body): res = self.json("DeleteNamespaceBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_namespace_basic(self, params, body): res = self.json("CreateNamespaceBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def validate_namespace_basic(self, params, body): res = self.json("ValidateNamespaceBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_namespace_basic(self, params, body): res = self.json("GetNamespaceBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_namespaces_basic(self, params, body): res = self.json("ListNamespacesBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def validate_repository_basic(self, params, body): res = self.json("ValidateRepositoryBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_repository_basic(self, params, body): res = self.json("DeleteRepositoryBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_repository_basic(self, params, body): res = self.json("CreateRepositoryBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def update_repository_basic(self, params, body): res = self.json("UpdateRepositoryBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_repository_basic(self, params, body): res = self.json("GetRepositoryBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_repositories_basic(self, params, body): res = self.json("ListRepositoriesBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_tag_basic(self, params, body): res = self.json("DeleteTagBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def list_tags_basic(self, params, body): res = self.json("ListTagsBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_tag_basic(self, params, body): res = self.json("GetTagBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @ redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_tag_addition_basic(self, params, body): res = self.json("GetTagAdditionBasic", params, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/image_registry/__init__.py ================================================ ================================================ FILE: volcengine/imagex/ImageXConfig.py ================================================ # coding:utf-8 from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.const.Const import * IMAGEX_SERVICE_NAME = "ImageX" IMAGEX_API_VERSION = "2018-08-01" ResourceServiceIdTRN = "trn:ImageX:*:*:ServiceId/%s" ResourceStoreKeyTRN = "trn:ImageX:*:*:StoreKeys/%s" UPLOAD_THREADS = 3 MinChunkSize = 1024 * 1024 * 20 LargeFileSize = 1024 * 1024 * 1024 service_info_map = { REGION_CN_NORTH1: ServiceInfo( "imagex.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_CN_NORTH1), 10, 10, "https"), REGION_AP_SINGAPORE1: ServiceInfo( "imagex-ap-singapore-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_AP_SINGAPORE1), 10, 10, "https"), REGION_US_EAST1: ServiceInfo( "imagex-us-east-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_US_EAST1), 10, 10, "https"), } api_info = { "GetImageServiceSubscription": ApiInfo("GET", "/", {"Action": "GetImageServiceSubscription", "Version": IMAGEX_API_VERSION}, {}, {}), "CreateImageService": ApiInfo("POST", "/", {"Action": "CreateImageService", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageService": ApiInfo("GET", "/", {"Action": "GetImageService", "Version": IMAGEX_API_VERSION}, {}, {}), "GetAllImageServices": ApiInfo("GET", "/", {"Action": "GetAllImageServices", "Version": IMAGEX_API_VERSION}, {}, {}), "DeleteImageService": ApiInfo("POST", "/", {"Action": "DeleteImageService", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateImageAuthKey": ApiInfo("POST", "/", {"Action": "UpdateImageAuthKey", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageAuthKey": ApiInfo("GET", "/", {"Action": "GetImageAuthKey", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateImageObjectAccess": ApiInfo("POST", "/", {"Action": "UpdateImageObjectAccess", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateImageMirrorConf": ApiInfo("POST", "/", {"Action": "UpdateImageMirrorConf", "Version": IMAGEX_API_VERSION}, {}, {}), "DelDomain": ApiInfo("POST", "/", {"Action": "DelDomain", "Version": IMAGEX_API_VERSION}, {}, {}), # 域名管理 "GetServiceDomains": ApiInfo("GET", "/", {"Action": "GetServiceDomains", "Version": IMAGEX_API_VERSION}, {}, {}), "GetDomainConfig": ApiInfo("GET", "/", {"Action": "GetDomainConfig", "Version": IMAGEX_API_VERSION}, {}, {}), "SetDefaultDomain": ApiInfo("POST", "/", {"Action": "SetDefaultDomain", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateResponseHeader": ApiInfo("POST", "/", {"Action": "UpdateResponseHeader", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateRefer": ApiInfo("POST", "/", {"Action": "UpdateRefer", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateHttps": ApiInfo("POST", "/", {"Action": "UpdateHttps", "Version": IMAGEX_API_VERSION}, {}, {}), "GetResponseHeaderValidateKeys": ApiInfo("GET", "/", {"Action": "GetResponseHeaderValidateKeys", "Version": IMAGEX_API_VERSION}, {}, {}), # 模板管理 "CreateImageTemplate": ApiInfo("POST", "/", {"Action": "CreateImageTemplate", "Version": IMAGEX_API_VERSION}, {}, {}), "DeleteImageTemplate": ApiInfo("POST", "/", {"Action": "DeleteImageTemplate", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageTemplate": ApiInfo("GET", "/", {"Action": "GetImageTemplate", "Version": IMAGEX_API_VERSION}, {}, {}), "GetAllImageTemplates": ApiInfo("GET", "/", {"Action": "GetAllImageTemplates", "Version": IMAGEX_API_VERSION}, {}, {}), "GetTemplatesFromBin": ApiInfo("GET", "/", {"Action": "GetTemplatesFromBin", "Version": IMAGEX_API_VERSION}, {}, {}), "CreateTemplatesFromBin": ApiInfo("POST", "/", {"Action": "CreateTemplatesFromBin", "Version": IMAGEX_API_VERSION}, {}, {}), "DeleteTemplatesFromBin": ApiInfo("POST", "/", {"Action": "DeleteTemplatesFromBin", "Version": IMAGEX_API_VERSION}, {}, {}), # 资源管理相关 "ApplyImageUpload": ApiInfo("GET", "/", {"Action": "ApplyImageUpload", "Version": IMAGEX_API_VERSION}, {}, {}), "CommitImageUpload": ApiInfo("POST", "/", {"Action": "CommitImageUpload", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageUploadFile": ApiInfo("GET", "/", {"Action": "GetImageUploadFile", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageUploadFiles": ApiInfo("GET", "/", {"Action": "GetImageUploadFiles", "Version": IMAGEX_API_VERSION}, {}, {}), "DeleteImageUploadFiles": ApiInfo("POST", "/", {"Action": "DeleteImageUploadFiles", "Version": IMAGEX_API_VERSION}, {}, {}), "PreviewImageUploadFile": ApiInfo("GET", "/", {"Action": "PreviewImageUploadFile", "Version": IMAGEX_API_VERSION}, {}, {}), "CreateImageContentTask": ApiInfo("POST", "/", {"Action": "CreateImageContentTask", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageContentTaskDetail": ApiInfo("POST", "/", {"Action": "GetImageContentTaskDetail", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageContentBlockList": ApiInfo("POST", "/", {"Action": "GetImageContentBlockList", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageUpdateFiles": ApiInfo("GET", "/", {"Action": "GetImageUpdateFiles", "Version": IMAGEX_API_VERSION}, {}, {}), "FetchImageUrl": ApiInfo("POST", "/", {"Action": "FetchImageUrl", "Version": IMAGEX_API_VERSION}, {}, {}), "GetUrlFetchTask": ApiInfo("GET", "/", {"Action": "GetUrlFetchTask", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateServiceName": ApiInfo("POST", "/", {"Action": "UpdateServiceName", "Version": IMAGEX_API_VERSION}, {}, {}), "UpdateImageStorageTTL": ApiInfo("POST", "/", {"Action": "UpdateImageStorageTTL", "Version": IMAGEX_API_VERSION}, {}, {}), "DescribeImageVolcCdnAccessLog": ApiInfo("POST", "/", {"Action": "DescribeImageVolcCdnAccessLog", "Version": IMAGEX_API_VERSION}, {}, {}), # 其他 API "GetImageOCRV2": ApiInfo("POST", "/", {"Action": "GetImageOCRV2", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageQuality": ApiInfo("POST", "/", {"Action": "GetImageQuality", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageEraseModels": ApiInfo("GET", "/", {"Action": "GetImageEraseModels", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageEnhanceResult": ApiInfo("POST", "/", {"Action": "GetImageEnhanceResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageEnhanceResultWithData": ApiInfo("POST", "/", {"Action": "GetImageEnhanceResultWithData", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageBgFillResult": ApiInfo("POST", "/", {"Action": "GetImageBgFillResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageDuplicateDetection": ApiInfo("POST", "/", {"Action": "GetImageDuplicateDetection", "Version": IMAGEX_API_VERSION}, {}, {}), "GetDedupTaskStatus": ApiInfo("GET", "/", {"Action": "GetImageDuplicateDetection", "Version": IMAGEX_API_VERSION}, {}, {}), "GetDenoisingImage": ApiInfo("POST", "/", {"Action": "GetDenoisingImage", "Version": IMAGEX_API_VERSION}, {}, {}), "GetSegmentImage": ApiInfo("POST", "/", {"Action": "GetSegmentImage", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageComicResult": ApiInfo("POST", "/", {"Action": "GetImageComicResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageSuperResolutionResult": ApiInfo("POST", "/", {"Action": "GetImageSuperResolutionResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageSmartCropResult": ApiInfo("POST", "/", {"Action": "GetImageSmartCropResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetLicensePlateDetection": ApiInfo("POST", "/", {"Action": "GetLicensePlateDetection", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImagePSDetection": ApiInfo("POST", "/", {"Action": "GetImagePSDetection", "Version": IMAGEX_API_VERSION}, {}, {}), "GetPrivateImageType": ApiInfo("POST", "/", {"Action": "GetPrivateImageType", "Version": IMAGEX_API_VERSION}, {}, {}), "CreateImageHmEmbed": ApiInfo("POST", "/", {"Action": "CreateImageHmEmbed", "Version": IMAGEX_API_VERSION}, {}, {}), "CreateImageHmExtract": ApiInfo("POST", "/", {"Action": "CreateImageHmExtract", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageEraseResult": ApiInfo("POST", "/", {"Action": "GetImageEraseResult", "Version": IMAGEX_API_VERSION}, {}, {}), "GetImageStyleResult": ApiInfo("POST", "/", {"Action": "GetImageStyleResult", "Version": IMAGEX_API_VERSION}, {}, {}), } ================================================ FILE: volcengine/imagex/ImageXService.py ================================================ # coding:utf-8 import json import os from six.moves import queue import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.util.Util import * from volcengine.Policy import * from volcengine.imagex.ImageXConfig import * from retry import retry class Uploader: def __init__(self, imagex_service, host, store_infos=None, file_paths_or_bytes=None): if store_infos is None: store_infos = [] if file_paths_or_bytes is None: file_paths_or_bytes = [] self.imagex_service = imagex_service self.host = host self.store_infos = store_infos self.file_paths_or_bytes = file_paths_or_bytes self.queue = queue.Queue() self.queue_lock = threading.Lock() self.successOids = [] self.results = [] for i in range(len(store_infos)): self.queue.put(i) def async_upload(self): while not self.queue.empty(): self.queue_lock.acquire() if self.queue.empty(): self.queue_lock.release() break idx = self.queue.get() self.queue_lock.release() store_info = self.store_infos[idx] file_paths_or_bytes = self.file_paths_or_bytes[idx] try: if isinstance(file_paths_or_bytes, bytes): self.upload_by_host(store_info, file_paths_or_bytes) elif isinstance(file_paths_or_bytes, str): file_path = file_paths_or_bytes file_size = os.path.getsize(file_path) data = open(file_path, "rb") if file_size < MinChunkSize: self.upload_by_host(store_info, data.read()) elif file_size > LargeFileSize: self.chunk_upload(store_info, data, file_size, True) else: self.chunk_upload(store_info, data, file_size, False) data.close() else: raise Exception("Uploader only accept bytes or path data") self.successOids.append(store_info['StoreUri']) self.results.append({ 'Uri': store_info['StoreUri'], 'UriStatus': 2000, }) except Exception as e: self.results.append({ 'Uri': store_info['StoreUri'], 'UriStatus': 2001, 'Error': e, }) @retry(tries=3, delay=1, backoff=2) def upload_by_host(self, store_info, img_data): url = 'https://{}/{}'.format(self.host, store_info['StoreUri']) check_sum = crc32(img_data) & 0xFFFFFFFF check_sum = "%08x" % check_sum headers = {'Content-CRC32': check_sum, 'Authorization': store_info['Auth']} upload_status, resp = self.imagex_service.put_data(url, img_data, headers) if not upload_status: raise Exception('upload by host: upload url %s status false, resp: %s' % (url, resp)) def chunk_upload(self, store_info, f, size, is_large_file): upload_id = self.init_upload_part(store_info, is_large_file) n = size // MinChunkSize last_num = n - 1 parts = [] for i in range(0, last_num): data = f.read(MinChunkSize) part_number = i if is_large_file: part_number = i + 1 part = self.upload_part(store_info, upload_id, part_number, data, is_large_file) parts.append(part) data = f.read() if is_large_file: last_num = last_num + 1 part = self.upload_part(store_info, upload_id, last_num, data, is_large_file) parts.append(part) return self.upload_merge_part(store_info, upload_id, parts, is_large_file) @retry(tries=3, delay=1, backoff=2) def init_upload_part(self, store_info, is_large_file): url = 'https://{}/{}?uploads'.format(self.host, store_info['StoreUri']) headers = {'Authorization': store_info['Auth']} if is_large_file: headers['X-Storage-Mode'] = 'gateway' upload_status, resp = self.imagex_service.put_data(url, None, headers) resp = json.loads(resp) if not upload_status: raise Exception("init upload error") if resp.get('success') is None or resp['success'] != 0: raise Exception("init upload error") return resp['payload']['uploadID'] @retry(tries=3, delay=1, backoff=2) def upload_part(self, store_info, upload_id, part_number, data, is_large_file): url = 'https://{}/{}?partNumber={}&uploadID={}'.format(self.host, store_info['StoreUri'], part_number, upload_id) check_sum = crc32(data) & 0xFFFFFFFF check_sum = "%08x" % check_sum headers = {'Content-CRC32': check_sum, 'Authorization': store_info['Auth']} if is_large_file: headers['X-Storage-Mode'] = 'gateway' upload_status, resp = self.imagex_service.put_data(url, data, headers) if not upload_status: raise Exception(url + json.dumps(resp)) resp = json.loads(resp) if resp.get('success') is None or resp['success'] != 0: raise Exception("upload part error") return check_sum # noinspection DuplicatedCode @staticmethod def generate_merge_body(check_sum_list): if len(check_sum_list) == 0: raise Exception('crc32 list empty') s = [] for i in range(len(check_sum_list)): s.append('{}:{}'.format(i, check_sum_list[i])) comma = ',' return comma.join(s) @retry(tries=3, delay=1, backoff=2) def upload_merge_part(self, store_info, upload_id, check_sum_list, is_large_file): url = 'https://{}/{}?uploadID={}'.format(self.host, store_info['StoreUri'], upload_id) data = self.generate_merge_body(check_sum_list) headers = {'Authorization': store_info['Auth']} if is_large_file: headers['X-Storage-Mode'] = 'gateway' upload_status, resp = self.imagex_service.put_data(url, data, headers) resp = json.loads(resp) if not upload_status: raise Exception("init upload error") if resp.get('success') is None or resp['success'] != 0: raise Exception("init upload error") class ImageXService(Service): def __init__(self, region=REGION_CN_NORTH1): self.service_info = ImageXService.get_service_info(region) self.api_info = ImageXService.get_api_info() super(ImageXService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('ImageX not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info # upload def apply_upload(self, params): res = self.get('ApplyImageUpload', params, doseq=1) if res == '': raise Exception("ApplyImageUpload: empty response") res_json = json.loads(res) return res_json def commit_upload(self, params, body): res = self.json('CommitImageUpload', params, body) if res == '': raise Exception("CommitImageUpload: empty response") res_json = json.loads(res) return res_json # upload local image file # noinspection DuplicatedCode def upload_image(self, params, file_paths): for p in file_paths: if not os.path.isfile(p): raise Exception("no such file on file path %s" % p) apply_upload_request = { 'ServiceId': params['ServiceId'], 'SessionKey': params.get('SessionKey', ''), 'UploadNum': len(file_paths), 'StoreKeys': params.get('StoreKeys', []), 'Overwrite': str(params.get('Overwrite', False)), } resp = self.apply_upload(apply_upload_request) if 'Error' in resp['ResponseMetadata']: raise Exception(resp['ResponseMetadata']) result = resp['Result'] reqid = result['RequestId'] addr = result['UploadAddress'] if len(addr['UploadHosts']) == 0: raise Exception("no upload host found, reqid %s" % reqid) elif len(addr['StoreInfos']) != len(file_paths): raise Exception("store info len %d != upload num %d, reqid %s" % ( len(result['StoreInfos']), len(file_paths), reqid)) session_key = addr['SessionKey'] host = addr['UploadHosts'][0] uploader = self.do_upload(file_paths, host, addr['StoreInfos']) if len(uploader.successOids) == 0: raise Exception("no file uploaded") if params.get('SkipCommit', False): return {'Results': uploader.results} commit_upload_request = { 'ServiceId': params['ServiceId'], 'SkipMeta': params.get('SkipMeta', False) } commit_upload_body = { 'SessionKey': session_key, 'SuccessOids': uploader.successOids, 'Functions': params.get('Functions', []), 'OptionInfos': params.get('OptionInfos', []) } resp = self.commit_upload( commit_upload_request, json.dumps(commit_upload_body)) if 'Error' in resp['ResponseMetadata']: raise Exception(resp['ResponseMetadata']) return resp['Result'] # upload image data # noinspection DuplicatedCode def upload_image_data(self, params, img_datas): for data in img_datas: if not isinstance(data, bytes): raise Exception("upload of non-bytes not supported") apply_upload_request = { 'ServiceId': params['ServiceId'], 'SessionKey': params.get('SessionKey', ''), 'UploadNum': len(img_datas), 'StoreKeys': params.get('StoreKeys', []), 'Overwrite': str(params.get('Overwrite', False)), } resp = self.apply_upload(apply_upload_request) if 'Error' in resp['ResponseMetadata']: raise Exception(resp['ResponseMetadata']) result = resp['Result'] reqid = result['RequestId'] addr = result['UploadAddress'] if len(addr['UploadHosts']) == 0: raise Exception("no upload host found, reqid %s" % reqid) elif len(addr['StoreInfos']) != len(img_datas): raise Exception("store info len %d != upload num %d, reqid %s" % ( len(result['StoreInfos']), len(img_datas), reqid)) session_key = addr['SessionKey'] host = addr['UploadHosts'][0] uploader = self.do_upload(img_datas, host, addr['StoreInfos']) if len(uploader.successOids) == 0: raise Exception("no file uploaded") if params.get('SkipCommit', False): return {'Results': uploader.results} commit_upload_request = { 'ServiceId': params['ServiceId'], 'SkipMeta': params.get('SkipMeta', False) } commit_upload_body = { 'SessionKey': session_key, 'SuccessOids': uploader.successOids, 'Functions': params.get('Functions', []), 'OptionInfos': params.get('OptionInfos', []) } resp = self.commit_upload( commit_upload_request, json.dumps(commit_upload_body)) if 'Error' in resp['ResponseMetadata']: raise Exception(resp['ResponseMetadata']) return resp['Result'] def do_upload(self, file_paths_or_bytes, host, store_infos): threads = [] uploader = Uploader(self, host, store_infos, file_paths_or_bytes) for i in range(UPLOAD_THREADS): thread = threading.Thread(target=uploader.async_upload) thread.start() threads.append(thread) for i in range(UPLOAD_THREADS): threads[i].join() return uploader def get_upload_auth_token(self, params): apply_token = self.get_sign_url('ApplyImageUpload', params) commit_token = self.get_sign_url('CommitImageUpload', params) ret = {'Version': 'v1', 'ApplyUploadToken': apply_token, 'CommitUploadToken': commit_token} data = json.dumps(ret) if sys.version_info[0] == 3: return base64.b64encode(data.encode('utf-8')).decode('utf-8') else: return base64.b64encode(data.decode('utf-8')) # tag 字段如下,可选择所需字段传入 # upload_policy_dict = { # "FileSizeUpLimit": "xxx", # "FileSizeBottomLimit": "xxx", # "ContentTypeBlackList":[ # "xxx" # ], # "ContentTypeWhiteList":[ # "xxx" # ] # } # policy_str = json.dumps(upload_policy_dict) # # tag = { # "UploadOverwrite": "true", # "UploadPolicy": policy_str, # } def get_upload_auth(self, service_ids, expire=60 * 60, key_ptn='', tag=dict): apply_res = [] commit_res = [] if len(service_ids) == 0: apply_res.append(ResourceServiceIdTRN % '*') commit_res.append(ResourceServiceIdTRN % '*') else: for sid in service_ids: apply_res.append(ResourceServiceIdTRN % sid) commit_res.append(ResourceServiceIdTRN % sid) apply_res.append(ResourceStoreKeyTRN % key_ptn) inline_policy = Policy([ Statement.new_allow_statement( ['ImageX:ApplyImageUpload'], apply_res), Statement.new_allow_statement( ['ImageX:CommitImageUpload'], commit_res) ]) for k, v in tag.items(): inline_policy.statements.append(Statement.new_allow_statement([k], [str(v)])) return self.sign_sts2(inline_policy, expire) def delete_images(self, service_id, uris): query = { 'ServiceId': service_id } body = { 'StoreUris': uris } res = self.json('DeleteImageUploadFiles', query, json.dumps(body)) if res == '': raise Exception("DeleteImageUploadFiles: empty response") res_json = json.loads(res) if 'Error' in res_json['ResponseMetadata']: raise Exception(res_json['ResponseMetadata']) return res_json['Result'] def create_image_content_task(self, args): query = { 'ServiceId': args['ServiceId'] } res = self.imagex_post('CreateImageContentTask', query, json.dumps(args)) if res == '': raise Exception("%s: empty response" % 'CreateImageContentTask') res_json = json.loads(res) return res_json def get_image_content_task_detail(self, args): query = { 'ServiceId': args['ServiceId'] } res = self.imagex_post('GetImageContentTaskDetail', query, json.dumps(args)) if res == '': raise Exception("%s: empty response" % 'CreateImageContentTask') res_json = json.loads(res) return res_json def get_image_content_block_list(self, args): query = { 'ServiceId': args['ServiceId'] } res = self.imagex_post('GetImageContentBlockList', query, json.dumps(args)) if res == '': raise Exception("%s: empty response" % 'CreateImageContentTask') res_json = json.loads(res) return res_json def get_image_info(self, service_id, store_uri): query = { 'ServiceId': service_id, 'StoreUri': store_uri, } res = self.get('PreviewImageUploadFile', query) if res == '': raise Exception("empty response") res_json = json.loads(res) if 'Error' in res_json['ResponseMetadata']: raise Exception(res_json['ResponseMetadata']) return res_json['Result'] def imagex_get(self, action, params, doseq=0): res = self.get(action, params, doseq) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(json.dumps(res)) return res_json def imagex_post(self, action, params, body): res = self.json(action, params, body) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(json.dumps(res)) return res_json def imagex_request(self, action, params, body, files): res = self.request(action, params, body, files) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(json.dumps(res)) return res_json def fetch_image_url(self, request): res = self.imagex_post('FetchImageUrl', request, json.dumps(request)) if res == '': raise Exception("empty response") res_json = json.loads(res) if 'Error' in res_json['ResponseMetadata']: raise Exception(res_json['ResponseMetadata']) return res_json['Result'] def get_url_fetch_task(self, query): res = self.imagex_get('GetUrlFetchTask', query) if res == '': raise Exception("empty response") res_json = json.loads(res) if 'Error' in res_json['ResponseMetadata']: raise Exception(res_json['ResponseMetadata']) return res_json['Result'] def update_image_storage_ttl(self, request): res = self.imagex_post('UpdateImageStorageTTL', {}, json.dumps(request)) if res == '': raise Exception("empty response") res_json = json.loads(res) if 'Error' in res_json['ResponseMetadata']: raise Exception(res_json['ResponseMetadata']) return res_json['Result'] def get_image_ocr_v2(self, params): query = { 'ServiceId': params['ServiceId'] } body = { 'Scene': params['Scene'], 'StoreUri': params.get('StoreUri', None), 'ImageUrl': params.get('ImageUrl', None), 'InstrumentName': params.get('InstrumentName', None) } res = self.imagex_post('GetImageOCRV2', query, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageOCR') res_json = json.loads(res) return res_json def get_image_segment(self, params): res = self.post('GetSegmentImage', params, {}) if res == '': raise Exception("%s: empty response" % 'GetSegmentImage') res_json = json.loads(res) return res_json def get_image_quality(self, params): body = { 'ImageUrl': params['ImageUrl'], 'VqType': params.get('VqType', None) } res = self.imagex_post('GetImageQuality', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageQuality') res_json = json.loads(res) return res_json def get_image_erase_models(self, params): res = self.imagex_get('GetImageEraseModels', params) if res == '': raise Exception("%s: empty response" % 'GetImageEraseModels') res_json = json.loads(res) return res_json def get_image_erase_result(self, params): body = { 'ServiceId': params['ServiceId'], 'StoreUri': params['StoreUri'], 'Model': params['Model'], 'BBox': params.get('BBox', None) } res = self.imagex_post('GetImageEraseResult', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageEraseResult') res_json = json.loads(res) return res_json def get_image_enhance_result(self, params): body = { 'ServiceId': params['ServiceId'], 'StoreUri': params['StoreUri'], 'Model': params['Model'], 'DisableAr': params.get('DisableAr', None), 'DisableSharp': params.get('DisableSharp', None), 'Resolution': params.get('Resolution', None) } res = self.imagex_post('GetImageEnhanceResult', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageEnhanceResult') res_json = json.loads(res) return res_json def get_image_enhance_result_with_data(self, input, data): params = { "ServiceId": input["ServiceId"] } res = self.imagex_request('GetImageEnhanceResultWithData', params, body={ 'Input': json.dumps(input), }, files={ 'Data': ('img', data), }) if res == '': raise Exception("%s: empty response" % 'GetImageEnhanceResult') res_json = json.loads(res) return res_json def get_image_bg_fill_result(self, params): body = { 'ServiceId': params['ServiceId'], 'StoreUri': params['StoreUri'], 'Model': params['Model'], 'Top': params.get('Top', None), 'Bottom': params.get('Bottom', None), 'Left': params.get('Left', None), 'Right': params.get('Right', None) } res = self.imagex_post('GetImageBgFillResult', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageBgFillResult') res_json = json.loads(res) return res_json def get_image_duplicate_detection(self, body): query = { 'ServiceId': body['ServiceId'], } res = self.imagex_post('GetImageDuplicateDetection', query, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageDuplicateDetection') res_json = json.loads(res) return res_json def get_image_duplicate_task_status(self, query): res = self.imagex_get('GetDedupTaskStatus', query) if res == '': raise Exception("%s: empty response" % 'GetDedupTaskStatus') res_json = json.loads(res) return res_json def get_image_comic_result(self, params): body = { 'ServiceId': params['ServiceId'], 'StoreUri': params['StoreUri'] } res = self.imagex_post('GetImageComicResult', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageComicResult') res_json = json.loads(res) return res_json def get_image_super_resolution_result(self, params): body = { 'ServiceId': params['ServiceId'], 'StoreUri': params['StoreUri'], 'Multiple': params.get('Multiple', None) } res = self.imagex_post('GetImageSuperResolutionResult', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetImageSuperResolutionResult') res_json = json.loads(res) return res_json def get_license_plate_detection(self, params): body = { 'ImageUri': params['ImageUri'] } res = self.imagex_post('GetLicensePlateDetection', params, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'GetLicensePlateDetection') res_json = json.loads(res) return res_json def get_image_style_result(self, args): query = { 'ServiceId': args['ServiceId'], } res = self.imagex_post('GetImageStyleResult', query, json.dumps(args)) if res == '': raise Exception("%s: empty response" % 'GetImageStyleResult') res_json = json.loads(res) return res_json def describe_imagex_domain_traffic_data(self, query): res = self.imagex_get('DescribeImageXDomainTrafficData', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXDomainTrafficData') res_json = json.loads(res) return res_json def describe_imagex_domain_bandwidth_data(self, query): res = self.imagex_get('DescribeImageXDomainBandwidthData', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXDomainBandwidthData') res_json = json.loads(res) return res_json def describe_imagex_bucket_usage(self, query): res = self.imagex_get('DescribeImageXBucketUsage', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXBucketUsage') res_json = json.loads(res) return res_json def describe_imagex_request_cnt_usage(self, query): res = self.imagex_get('DescribeImageXRequestCntUsage', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXRequestCntUsage') res_json = json.loads(res) return res_json def describe_imagex_base_op_usage(self, query): res = self.imagex_get('DescribeImageXBaseOpUsage', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXBaseOpUsage') res_json = json.loads(res) return res_json def describe_imagex_compress_usage(self, query): res = self.imagex_get('DescribeImageXCompressUsage', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCompressUsage') res_json = json.loads(res) return res_json def describe_imagex_edge_request(self, query): res = self.imagex_get('DescribeImageXEdgeRequest', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXEdgeRequest') res_json = json.loads(res) return res_json def describe_imagex_hit_rate_traffic_data(self, query): res = self.imagex_get('DescribeImageXHitRateTrafficData', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXHitRateTrafficData') res_json = json.loads(res) return res_json def describe_imagex_hit_rate_request_data(self, query): res = self.imagex_get('DescribeImageXHitRateRequestData', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXHitRateRequestData') res_json = json.loads(res) return res_json def describe_imagex_cdntop_request_data(self, query): res = self.imagex_get('DescribeImageXCDNTopRequestData', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCDNTopRequestData') res_json = json.loads(res) return res_json def describe_imagex_summary(self, query): res = self.imagex_get('DescribeImageXSummary', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSummary') res_json = json.loads(res) return res_json def describe_imagex_edge_request_bandwidth(self, query): res = self.imagex_get('DescribeImageXEdgeRequestBandwidth', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXEdgeRequestBandwidth') res_json = json.loads(res) return res_json def describe_imagex_edge_request_traffic(self, query): res = self.imagex_get('DescribeImageXEdgeRequestTraffic', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXEdgeRequestTraffic') res_json = json.loads(res) return res_json def describe_imagex_edge_request_regions(self, query): res = self.imagex_get('DescribeImageXEdgeRequestRegions', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXEdgeRequestRegions') res_json = json.loads(res) return res_json def describe_imagex_mirror_request_traffic(self, body): res = self.imagex_post('DescribeImageXMirrorRequestTraffic', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXMirrorRequestTraffic') res_json = json.loads(res) return res_json def describe_imagex_mirror_request_bandwidth(self, body): res = self.imagex_post('DescribeImageXMirrorRequestBandwidth', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXMirrorRequestBandwidth') res_json = json.loads(res) return res_json def describe_imagex_mirror_request_http_code_by_time(self, body): res = self.imagex_post('DescribeImageXMirrorRequestHttpCodeByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXMirrorRequestHttpCodeByTime') res_json = json.loads(res) return res_json def describe_imagex_mirror_request_http_code_overview(self, body): res = self.imagex_post('DescribeImageXMirrorRequestHttpCodeOverview', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXMirrorRequestHttpCodeOverview') res_json = json.loads(res) return res_json def describe_imagex_service_quality(self, query): res = self.imagex_get('DescribeImageXServiceQuality', query) if res == '': raise Exception("%s: empty response" % 'DescribeImageXServiceQuality') res_json = json.loads(res) return res_json def get_imagex_query_apps(self, query): res = self.imagex_get('GetImageXQueryApps', query) if res == '': raise Exception("%s: empty response" % 'GetImageXQueryApps') res_json = json.loads(res) return res_json def get_imagex_query_regions(self, query): res = self.imagex_get('GetImageXQueryRegions', query) if res == '': raise Exception("%s: empty response" % 'GetImageXQueryRegions') res_json = json.loads(res) return res_json def get_imagex_query_dims(self, query): res = self.imagex_get('GetImageXQueryDims', query) if res == '': raise Exception("%s: empty response" % 'GetImageXQueryDims') res_json = json.loads(res) return res_json def get_imagex_query_vals(self, query): res = self.imagex_get('GetImageXQueryVals', query) if res == '': raise Exception("%s: empty response" % 'GetImageXQueryVals') res_json = json.loads(res) return res_json def describe_imagex_upload_success_rate_by_time(self, body): res = self.imagex_post('DescribeImageXUploadSuccessRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadSuccessRateByTime') res_json = json.loads(res) return res_json def describe_imagex_upload_error_code_all(self, body): res = self.imagex_post('DescribeImageXUploadErrorCodeAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadErrorCodeAll') res_json = json.loads(res) return res_json def describe_imagex_upload_error_code_by_time(self, body): res = self.imagex_post('DescribeImageXUploadErrorCodeByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadErrorCodeByTime') res_json = json.loads(res) return res_json def describe_imagex_upload_count_by_time(self, body): res = self.imagex_post('DescribeImageXUploadCountByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadCountByTime') res_json = json.loads(res) return res_json def describe_imagex_upload_file_size(self, body): res = self.imagex_post('DescribeImageXUploadFileSize', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadFileSize') res_json = json.loads(res) return res_json def describe_imagex_upload_speed(self, body): res = self.imagex_post('DescribeImageXUploadSpeed', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadSpeed') res_json = json.loads(res) return res_json def describe_imagex_upload_duration(self, body): res = self.imagex_post('DescribeImageXUploadDuration', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadDuration') res_json = json.loads(res) return res_json def describe_imagex_upload_segment_speed_by_time(self, body): res = self.imagex_post('DescribeImageXUploadSegmentSpeedByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXUploadSegmentSpeedByTime') res_json = json.loads(res) return res_json def describe_imagex_cdn_success_rate_by_time(self, body): res = self.imagex_post('DescribeImageXCdnSuccessRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnSuccessRateByTime') res_json = json.loads(res) return res_json def describe_imagex_cdn_success_rate_all(self, body): res = self.imagex_post('DescribeImageXCdnSuccessRateAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnSuccessRateAll') res_json = json.loads(res) return res_json def describe_imagex_cdn_error_code_by_time(self, body): res = self.imagex_post('DescribeImageXCdnErrorCodeByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnErrorCodeByTime') res_json = json.loads(res) return res_json def describe_imagex_cdn_error_code_all(self, body): res = self.imagex_post('DescribeImageXCdnErrorCodeAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnErrorCodeAll') res_json = json.loads(res) return res_json def describe_imagex_cdn_duration_detail_by_time(self, body): res = self.imagex_post('DescribeImageXCdnDurationDetailByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnDurationDetailByTime') res_json = json.loads(res) return res_json def describe_imagex_cdn_duration_all(self, body): res = self.imagex_post('DescribeImageXCdnDurationAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnDurationAll') res_json = json.loads(res) return res_json def describe_imagex_cdn_reuse_rate_by_time(self, body): res = self.imagex_post('DescribeImageXCdnReuseRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnReuseRateByTime') res_json = json.loads(res) return res_json def describe_imagex_cdn_reuse_rate_all(self, body): res = self.imagex_post('DescribeImageXCdnReuseRateAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnReuseRateAll') res_json = json.loads(res) return res_json def describe_imagex_cdn_protocol_rate_by_time(self, body): res = self.imagex_post('DescribeImageXCdnProtocolRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXCdnProtocolRateByTime') res_json = json.loads(res) return res_json def describe_imagex_client_error_code_all(self, body): res = self.imagex_post('DescribeImageXClientErrorCodeAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientErrorCodeAll') res_json = json.loads(res) return res_json def describe_imagex_client_error_code_by_time(self, body): res = self.imagex_post('DescribeImageXClientErrorCodeByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientErrorCodeByTime') res_json = json.loads(res) return res_json def describe_imagex_client_decode_success_rate_by_time(self, body): res = self.imagex_post('DescribeImageXClientDecodeSuccessRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientDecodeSuccessRateByTime') res_json = json.loads(res) return res_json def describe_imagex_client_decode_duration_by_time(self, body): res = self.imagex_post('DescribeImageXClientDecodeDurationByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientDecodeDurationByTime') res_json = json.loads(res) return res_json def describe_imagex_client_queue_duration_by_time(self, body): res = self.imagex_post('DescribeImageXClientQueueDurationByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientQueueDurationByTime') res_json = json.loads(res) return res_json def describe_imagex_client_load_duration_all(self, body): res = self.imagex_post('DescribeImageXClientLoadDurationAll', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientLoadDurationAll') res_json = json.loads(res) return res_json def describe_imagex_client_load_duration(self, body): res = self.imagex_post('DescribeImageXClientLoadDuration', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientLoadDuration') res_json = json.loads(res) return res_json def describe_imagex_client_failure_rate(self, body): res = self.imagex_post('DescribeImageXClientFailureRate', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientFailureRate') res_json = json.loads(res) return res_json def describe_imagex_client_sdk_ver_by_time(self, body): res = self.imagex_post('DescribeImageXClientSdkVerByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientSdkVerByTime') res_json = json.loads(res) return res_json def describe_imagex_client_file_size(self, body): res = self.imagex_post('DescribeImageXClientFileSize', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientFileSize') res_json = json.loads(res) return res_json def describe_imagex_client_top_file_size(self, body): res = self.imagex_post('DescribeImageXClientTopFileSize', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientTopFileSize') res_json = json.loads(res) return res_json def describe_imagex_client_count_by_time(self, body): res = self.imagex_post('DescribeImageXClientCountByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientCountByTime') res_json = json.loads(res) return res_json def describe_imagex_client_score_by_time(self, body): res = self.imagex_post('DescribeImageXClientScoreByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientScoreByTime') res_json = json.loads(res) return res_json def describe_imagex_client_demotion_rate_by_time(self, body): res = self.imagex_post('DescribeImageXClientDemotionRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientDemotionRateByTime') res_json = json.loads(res) return res_json def describe_imagex_client_top_demotion_url(self, body): res = self.imagex_post('DescribeImageXClientTopDemotionURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientTopDemotionURL') res_json = json.loads(res) return res_json def describe_imagex_client_quality_rate_by_time(self, body): res = self.imagex_post('DescribeImageXClientQualityRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientQualityRateByTime') res_json = json.loads(res) return res_json def describe_imagex_client_top_quality_url(self, body): res = self.imagex_post('DescribeImageXClientTopQualityURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXClientTopQualityURL') res_json = json.loads(res) return res_json def describe_imagex_sensible_count_by_time(self, body): res = self.imagex_post('DescribeImageXSensibleCountByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleCountByTime') res_json = json.loads(res) return res_json def describe_imagex_sensible_cache_hit_rate_by_time(self, body): res = self.imagex_post('DescribeImageXSensibleCacheHitRateByTime', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleCacheHitRateByTime') res_json = json.loads(res) return res_json def describe_imagex_sensible_top_size_url(self, body): res = self.imagex_post('DescribeImageXSensibleTopSizeURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleTopSizeURL') res_json = json.loads(res) return res_json def describe_imagex_sensible_top_ram_url(self, body): res = self.imagex_post('DescribeImageXSensibleTopRamURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleTopRamURL') res_json = json.loads(res) return res_json def describe_imagex_sensible_top_resolution_url(self, body): res = self.imagex_post('DescribeImageXSensibleTopResolutionURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleTopResolutionURL') res_json = json.loads(res) return res_json def describe_imagex_sensible_top_unknown_url(self, body): res = self.imagex_post('DescribeImageXSensibleTopUnknownURL', [], json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageXSensibleTopUnknownURL') res_json = json.loads(res) return res_json def describeImageVolcCdnAccessLog(self, query, body): res = self.imagex_post('DescribeImageVolcCdnAccessLog', query, json.dumps(body)) if res == '': raise Exception("%s: empty response" % 'DescribeImageVolcCdnAccessLog') res_json = json.loads(res) return res_json ================================================ FILE: volcengine/imagex/__init__.py ================================================ from volcengine.ApiInfo import ApiInfo from volcengine.imagex.ImageXConfig import api_info, IMAGEX_API_VERSION def init(): for v in ["DescribeImageXDomainTrafficData", "DescribeImageXDomainBandwidthData", "DescribeImageXBucketUsage", "DescribeImageXRequestCntUsage", "DescribeImageXBaseOpUsage", "DescribeImageXCompressUsage", "DescribeImageXEdgeRequest", "DescribeImageXHitRateTrafficData", "DescribeImageXHitRateRequestData", "DescribeImageXCDNTopRequestData", "DescribeImageXSummary", "DescribeImageXEdgeRequestBandwidth", "DescribeImageXEdgeRequestTraffic", "DescribeImageXEdgeRequestRegions", "DescribeImageXServiceQuality", "GetImageXQueryApps", "GetImageXQueryRegions", "GetImageXQueryDims", "GetImageXQueryVals", ]: api_info[v] = ApiInfo("GET", "/", {"Action": v, "Version": IMAGEX_API_VERSION}, {}, {}) for v in ["DescribeImageXMirrorRequestTraffic", "DescribeImageXMirrorRequestBandwidth", "DescribeImageXMirrorRequestHttpCodeByTime", "DescribeImageXMirrorRequestHttpCodeOverview", "DescribeImageXUploadSuccessRateByTime", "DescribeImageXUploadErrorCodeAll", "DescribeImageXUploadErrorCodeByTime", "DescribeImageXUploadCountByTime", "DescribeImageXUploadFileSize", "DescribeImageXUploadSpeed", "DescribeImageXUploadDuration", "DescribeImageXUploadSegmentSpeedByTime", "DescribeImageXCdnSuccessRateByTime", "DescribeImageXCdnSuccessRateAll", "DescribeImageXCdnErrorCodeByTime", "DescribeImageXCdnErrorCodeAll", "DescribeImageXCdnDurationDetailByTime", "DescribeImageXCdnDurationAll", "DescribeImageXCdnReuseRateByTime", "DescribeImageXCdnReuseRateAll", "DescribeImageXCdnProtocolRateByTime", "DescribeImageXClientErrorCodeAll", "DescribeImageXClientErrorCodeByTime", "DescribeImageXClientDecodeSuccessRateByTime", "DescribeImageXClientDecodeDurationByTime", "DescribeImageXClientQueueDurationByTime", "DescribeImageXClientLoadDurationAll", "DescribeImageXClientLoadDuration", "DescribeImageXClientFailureRate", "DescribeImageXClientSdkVerByTime", "DescribeImageXClientFileSize", "DescribeImageXClientTopFileSize", "DescribeImageXClientCountByTime", "DescribeImageXClientScoreByTime", "DescribeImageXClientDemotionRateByTime", "DescribeImageXClientTopDemotionURL", "DescribeImageXClientQualityRateByTime", "DescribeImageXClientTopQualityURL", "DescribeImageXSensibleCountByTime", "DescribeImageXSensibleCacheHitRateByTime", "DescribeImageXSensibleTopSizeURL", "DescribeImageXSensibleTopRamURL", "DescribeImageXSensibleTopResolutionURL", "DescribeImageXSensibleTopUnknownURL", ]: api_info[v] = ApiInfo("POST", "/", {"Action": v, "Version": IMAGEX_API_VERSION}, {}, {}) init() ================================================ FILE: volcengine/imagex/v2/__init__.py ================================================ __version__ = '1.0.0' ================================================ FILE: volcengine/imagex/v2/const.py ================================================ # coding:utf-8 IMAGEX_SERVICE_NAME = "ImageX" IMAGEX_API_VERSION = "2018-08-01" ResourceServiceIdTRN = "trn:ImageX:*:*:ServiceId/%s" ResourceStoreKeyTRN = "trn:ImageX:*:*:StoreKeys/%s" UPLOAD_THREADS = 3 MinChunkSize = 1024 * 1024 * 20 LargeFileSize = 1024 * 1024 * 1024 ================================================ FILE: volcengine/imagex/v2/helper/__init__.py ================================================ ================================================ FILE: volcengine/imagex/v2/helper/file_section_reader.py ================================================ # coding:utf-8 import os class FileSectionReader(object): def __init__(self, file_object, size, init_offset=None, can_reset=False): self.file_object = file_object self.size = size self.offset = 0 self.init_offset = init_offset self.can_reset = can_reset if init_offset: self.file_object.seek(init_offset, os.SEEK_SET) def read(self, amt=None): if self.offset >= self.size: return '' if (amt is None or amt < 0) or (amt + self.offset >= self.size): data = self.file_object.read(self.size - self.offset) self.offset = self.size return data self.offset += amt return self.file_object.read(amt) @property def len(self): return self.size def reset(self): if self.can_reset: self.offset = 0 if self.init_offset is not None: self.file_object.seek(self.init_offset, os.SEEK_SET) ================================================ FILE: volcengine/imagex/v2/imagex_config.py ================================================ # coding:utf-8 from volcengine.ServiceInfo import ServiceInfo from volcengine.Credentials import Credentials from volcengine.ApiInfo import ApiInfo service_info_map = { 'cn-north-1': ServiceInfo( 'imagex.volcengineapi.com', {'Accept': 'application/json'}, Credentials('', '', 'ImageX', 'cn-north-1'), 10, 10, "https"), 'ap-singapore-1': ServiceInfo( 'imagex-ap-singapore-1.volcengineapi.com', {'Accept': 'application/json'}, Credentials('', '', 'ImageX', 'ap-singapore-1'), 10, 10, "https"), 'us-east-1': ServiceInfo( 'imagex-us-east-1.volcengineapi.com', {'Accept': 'application/json'}, Credentials('', '', 'ImageX', 'us-east-1'), 10, 10, "https"), 'ap-southeast-1': ServiceInfo( 'imagex.ap-southeast-1.volcengineapi.com', {'Accept': 'application/json'}, Credentials('', '', 'ImageX', 'ap-southeast-1'), 10, 10, "https") } api_info = { "UpdateImageDomainVolcOrigin": ApiInfo("POST", "/", {"Action": "UpdateImageDomainVolcOrigin", "Version": "2018-08-01"}, {}, {}), "DelDomain": ApiInfo("POST", "/", {"Action": "DelDomain", "Version": "2023-05-01"}, {}, {}), "AddDomainV1": ApiInfo("POST", "/", {"Action": "AddDomainV1", "Version": "2018-08-01"}, {}, {}), "UpdateImageDomainIPAuth": ApiInfo("POST", "/", {"Action": "UpdateImageDomainIPAuth", "Version": "2018-08-01"}, {}, {}), "UpdateRefer": ApiInfo("POST", "/", {"Action": "UpdateRefer", "Version": "2018-08-01"}, {}, {}), "UpdateImageDomainUaAccess": ApiInfo("POST", "/", {"Action": "UpdateImageDomainUaAccess", "Version": "2018-08-01"}, {}, {}), "UpdateHttps": ApiInfo("POST", "/", {"Action": "UpdateHttps", "Version": "2018-08-01"}, {}, {}), "UpdateImageDomainDownloadSpeedLimit": ApiInfo("POST", "/", {"Action": "UpdateImageDomainDownloadSpeedLimit", "Version": "2018-08-01"}, {}, {}), "UpdateResponseHeader": ApiInfo("POST", "/", {"Action": "UpdateResponseHeader", "Version": "2018-08-01"}, {}, {}), "UpdateImageDomainAreaAccess": ApiInfo("POST", "/", {"Action": "UpdateImageDomainAreaAccess", "Version": "2018-08-01"}, {}, {}), "UpdateDomainAdaptiveFmt": ApiInfo("POST", "/", {"Action": "UpdateDomainAdaptiveFmt", "Version": "2023-05-01"}, {}, {}), "UpdateImageDomainConfig": ApiInfo("POST", "/", {"Action": "UpdateImageDomainConfig", "Version": "2018-08-01"}, {}, {}), "UpdateAdvance": ApiInfo("POST", "/", {"Action": "UpdateAdvance", "Version": "2018-08-01"}, {}, {}), "UpdateImageDomainBandwidthLimit": ApiInfo("POST", "/", {"Action": "UpdateImageDomainBandwidthLimit", "Version": "2018-08-01"}, {}, {}), "UpdateSlimConfig": ApiInfo("POST", "/", {"Action": "UpdateSlimConfig", "Version": "2023-05-01"}, {}, {}), "SetDefaultDomain": ApiInfo("POST", "/", {"Action": "SetDefaultDomain", "Version": "2023-05-01"}, {}, {}), "DescribeImageVolcCdnAccessLog": ApiInfo("POST", "/", {"Action": "DescribeImageVolcCdnAccessLog", "Version": "2018-08-01"}, {}, {}), "VerifyDomainOwner": ApiInfo("POST", "/", {"Action": "VerifyDomainOwner", "Version": "2023-05-01"}, {}, {}), "GetResponseHeaderValidateKeys": ApiInfo("GET", "/", {"Action": "GetResponseHeaderValidateKeys", "Version": "2023-05-01"}, {}, {}), "GetDomainConfig": ApiInfo("GET", "/", {"Action": "GetDomainConfig", "Version": "2018-08-01"}, {}, {}), "GetDomainOwnerVerifyContent": ApiInfo("GET", "/", {"Action": "GetDomainOwnerVerifyContent", "Version": "2023-05-01"}, {}, {}), "GetServiceDomains": ApiInfo("GET", "/", {"Action": "GetServiceDomains", "Version": "2018-08-01"}, {}, {}), "DeleteImageMonitorRules": ApiInfo("POST", "/", {"Action": "DeleteImageMonitorRules", "Version": "2018-08-01"}, {}, {}), "DeleteImageMonitorRecords": ApiInfo("POST", "/", {"Action": "DeleteImageMonitorRecords", "Version": "2018-08-01"}, {}, {}), "CreateImageMonitorRule": ApiInfo("POST", "/", {"Action": "CreateImageMonitorRule", "Version": "2018-08-01"}, {}, {}), "UpdateImageMonitorRule": ApiInfo("POST", "/", {"Action": "UpdateImageMonitorRule", "Version": "2018-08-01"}, {}, {}), "UpdateImageMonitorRuleStatus": ApiInfo("POST", "/", {"Action": "UpdateImageMonitorRuleStatus", "Version": "2018-08-01"}, {}, {}), "GetImageAlertRecords": ApiInfo("POST", "/", {"Action": "GetImageAlertRecords", "Version": "2018-08-01"}, {}, {}), "GetImageMonitorRules": ApiInfo("GET", "/", {"Action": "GetImageMonitorRules", "Version": "2018-08-01"}, {}, {}), "CreateImageSettingRule": ApiInfo("POST", "/", {"Action": "CreateImageSettingRule", "Version": "2023-05-01"}, {}, {}), "DeleteImageSettingRule": ApiInfo("POST", "/", {"Action": "DeleteImageSettingRule", "Version": "2023-05-01"}, {}, {}), "UpdateImageSettingRulePriority": ApiInfo("POST", "/", {"Action": "UpdateImageSettingRulePriority", "Version": "2023-05-01"}, {}, {}), "UpdateImageSettingRule": ApiInfo("POST", "/", {"Action": "UpdateImageSettingRule", "Version": "2023-05-01"}, {}, {}), "GetImageSettings": ApiInfo("GET", "/", {"Action": "GetImageSettings", "Version": "2023-05-01"}, {}, {}), "GetImageSettingRuleHistory": ApiInfo("GET", "/", {"Action": "GetImageSettingRuleHistory", "Version": "2023-05-01"}, {}, {}), "GetImageSettingRules": ApiInfo("GET", "/", {"Action": "GetImageSettingRules", "Version": "2023-05-01"}, {}, {}), "CreateImageMigrateTask": ApiInfo("POST", "/", {"Action": "CreateImageMigrateTask", "Version": "2023-05-01"}, {}, {}), "DeleteImageMigrateTask": ApiInfo("POST", "/", {"Action": "DeleteImageMigrateTask", "Version": "2023-05-01"}, {}, {}), "ExportFailedMigrateTask": ApiInfo("GET", "/", {"Action": "ExportFailedMigrateTask", "Version": "2023-05-01"}, {}, {}), "UpdateImageTaskStrategy": ApiInfo("POST", "/", {"Action": "UpdateImageTaskStrategy", "Version": "2023-05-01"}, {}, {}), "TerminateImageMigrateTask": ApiInfo("POST", "/", {"Action": "TerminateImageMigrateTask", "Version": "2023-05-01"}, {}, {}), "GetVendorBuckets": ApiInfo("POST", "/", {"Action": "GetVendorBuckets", "Version": "2023-05-01"}, {}, {}), "GetImageMigrateTasks": ApiInfo("GET", "/", {"Action": "GetImageMigrateTasks", "Version": "2023-05-01"}, {}, {}), "RerunImageMigrateTask": ApiInfo("POST", "/", {"Action": "RerunImageMigrateTask", "Version": "2023-05-01"}, {}, {}), "GetImageAddOnTag": ApiInfo("GET", "/", {"Action": "GetImageAddOnTag", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCubeUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXCubeUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSourceRequestBandwidth": ApiInfo("GET", "/", {"Action": "DescribeImageXSourceRequestBandwidth", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSourceRequestTraffic": ApiInfo("GET", "/", {"Action": "DescribeImageXSourceRequestTraffic", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSourceRequest": ApiInfo("GET", "/", {"Action": "DescribeImageXSourceRequest", "Version": "2023-05-01"}, {}, {}), "DescribeImageXStorageUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXStorageUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXBucketRetrievalUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXBucketRetrievalUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXAddOnQPSUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXAddOnQPSUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXAIRequestCntUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXAIRequestCntUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSummary": ApiInfo("GET", "/", {"Action": "DescribeImageXSummary", "Version": "2023-05-01"}, {}, {}), "DescribeImageXDomainTrafficData": ApiInfo("GET", "/", {"Action": "DescribeImageXDomainTrafficData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXDomainBandwidthData": ApiInfo("GET", "/", {"Action": "DescribeImageXDomainBandwidthData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXDomainBandwidthNinetyFiveData": ApiInfo("GET", "/", {"Action": "DescribeImageXDomainBandwidthNinetyFiveData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXBucketUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXBucketUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXBillingRequestCntUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXBillingRequestCntUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXRequestCntUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXRequestCntUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXBaseOpUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXBaseOpUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCompressUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXCompressUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXScreenshotUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXScreenshotUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXVideoClipDurationUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXVideoClipDurationUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXMultiCompressUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXMultiCompressUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXEdgeRequest": ApiInfo("GET", "/", {"Action": "DescribeImageXEdgeRequest", "Version": "2023-05-01"}, {}, {}), "DescribeImageXEdgeRequestBandwidth": ApiInfo("GET", "/", {"Action": "DescribeImageXEdgeRequestBandwidth", "Version": "2023-05-01"}, {}, {}), "DescribeImageXEdgeRequestTraffic": ApiInfo("GET", "/", {"Action": "DescribeImageXEdgeRequestTraffic", "Version": "2023-05-01"}, {}, {}), "DescribeImageXEdgeRequestRegions": ApiInfo("GET", "/", {"Action": "DescribeImageXEdgeRequestRegions", "Version": "2023-05-01"}, {}, {}), "DescribeImageXMirrorRequestHttpCodeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXMirrorRequestHttpCodeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXMirrorRequestHttpCodeOverview": ApiInfo("POST", "/", {"Action": "DescribeImageXMirrorRequestHttpCodeOverview", "Version": "2023-05-01"}, {}, {}), "DescribeImageXMirrorRequestTraffic": ApiInfo("POST", "/", {"Action": "DescribeImageXMirrorRequestTraffic", "Version": "2023-05-01"}, {}, {}), "DescribeImageXMirrorRequestBandwidth": ApiInfo("POST", "/", {"Action": "DescribeImageXMirrorRequestBandwidth", "Version": "2023-05-01"}, {}, {}), "DescribeImageXServerQPSUsage": ApiInfo("GET", "/", {"Action": "DescribeImageXServerQPSUsage", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHitRateTrafficData": ApiInfo("GET", "/", {"Action": "DescribeImageXHitRateTrafficData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHitRateRequestData": ApiInfo("GET", "/", {"Action": "DescribeImageXHitRateRequestData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCDNTopRequestData": ApiInfo("GET", "/", {"Action": "DescribeImageXCDNTopRequestData", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeFileInSizeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeFileInSizeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeFileOutSizeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeFileOutSizeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeSuccessCountByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeSuccessCountByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeSuccessRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeSuccessRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeDurationByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeDurationByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXHeifEncodeErrorCodeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXHeifEncodeErrorCodeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXExceedResolutionRatioAll": ApiInfo("POST", "/", {"Action": "DescribeImageXExceedResolutionRatioAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXExceedFileSize": ApiInfo("POST", "/", {"Action": "DescribeImageXExceedFileSize", "Version": "2023-05-01"}, {}, {}), "DescribeImageXExceedCountByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXExceedCountByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXServiceQuality": ApiInfo("GET", "/", {"Action": "DescribeImageXServiceQuality", "Version": "2023-05-01"}, {}, {}), "GetImageXQueryApps": ApiInfo("GET", "/", {"Action": "GetImageXQueryApps", "Version": "2023-05-01"}, {}, {}), "GetImageXQueryRegions": ApiInfo("GET", "/", {"Action": "GetImageXQueryRegions", "Version": "2023-05-01"}, {}, {}), "GetImageXQueryDims": ApiInfo("GET", "/", {"Action": "GetImageXQueryDims", "Version": "2023-05-01"}, {}, {}), "GetImageXQueryVals": ApiInfo("GET", "/", {"Action": "GetImageXQueryVals", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadCountByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadCountByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadDuration": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadDuration", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadSuccessRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadSuccessRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadFileSize": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadFileSize", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadErrorCodeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadErrorCodeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadErrorCodeAll": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadErrorCodeAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadSpeed": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadSpeed", "Version": "2023-05-01"}, {}, {}), "DescribeImageXUploadSegmentSpeedByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXUploadSegmentSpeedByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnSuccessRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnSuccessRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnSuccessRateAll": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnSuccessRateAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnErrorCodeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnErrorCodeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnErrorCodeAll": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnErrorCodeAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnDurationDetailByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnDurationDetailByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnDurationAll": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnDurationAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnReuseRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnReuseRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnReuseRateAll": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnReuseRateAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXCdnProtocolRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXCdnProtocolRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientFailureRate": ApiInfo("POST", "/", {"Action": "DescribeImageXClientFailureRate", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientDecodeSuccessRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientDecodeSuccessRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientDecodeDurationByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientDecodeDurationByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientQueueDurationByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientQueueDurationByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientErrorCodeByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientErrorCodeByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientErrorCodeAll": ApiInfo("POST", "/", {"Action": "DescribeImageXClientErrorCodeAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientLoadDuration": ApiInfo("POST", "/", {"Action": "DescribeImageXClientLoadDuration", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientLoadDurationAll": ApiInfo("POST", "/", {"Action": "DescribeImageXClientLoadDurationAll", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientSdkVerByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientSdkVerByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientFileSize": ApiInfo("POST", "/", {"Action": "DescribeImageXClientFileSize", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientTopFileSize": ApiInfo("POST", "/", {"Action": "DescribeImageXClientTopFileSize", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientCountByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientCountByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientQualityRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientQualityRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientTopQualityURL": ApiInfo("POST", "/", {"Action": "DescribeImageXClientTopQualityURL", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientDemotionRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientDemotionRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientTopDemotionURL": ApiInfo("POST", "/", {"Action": "DescribeImageXClientTopDemotionURL", "Version": "2023-05-01"}, {}, {}), "DescribeImageXClientScoreByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXClientScoreByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleCountByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleCountByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleCacheHitRateByTime": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleCacheHitRateByTime", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleTopSizeURL": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleTopSizeURL", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleTopResolutionURL": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleTopResolutionURL", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleTopRamURL": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleTopRamURL", "Version": "2023-05-01"}, {}, {}), "DescribeImageXSensibleTopUnknownURL": ApiInfo("POST", "/", {"Action": "DescribeImageXSensibleTopUnknownURL", "Version": "2023-05-01"}, {}, {}), "CreateBatchProcessTask": ApiInfo("POST", "/", {"Action": "CreateBatchProcessTask", "Version": "2023-05-01"}, {}, {}), "GetBatchProcessResult": ApiInfo("POST", "/", {"Action": "GetBatchProcessResult", "Version": "2023-05-01"}, {}, {}), "GetBatchTaskInfo": ApiInfo("GET", "/", {"Action": "GetBatchTaskInfo", "Version": "2023-05-01"}, {}, {}), "AIProcess": ApiInfo("POST", "/", {"Action": "AIProcess", "Version": "2023-05-01"}, {}, {}), "CreateImageAITask": ApiInfo("POST", "/", {"Action": "CreateImageAITask", "Version": "2023-05-01"}, {}, {}), "CreateImageAIProcessQueue": ApiInfo("POST", "/", {"Action": "CreateImageAIProcessQueue", "Version": "2023-05-01"}, {}, {}), "DeleteImageAIProcessQueue": ApiInfo("POST", "/", {"Action": "DeleteImageAIProcessQueue", "Version": "2023-05-01"}, {}, {}), "CreateImageAIProcessCallback": ApiInfo("POST", "/", {"Action": "CreateImageAIProcessCallback", "Version": "2023-05-01"}, {}, {}), "UpdateImageAIProcessQueue": ApiInfo("POST", "/", {"Action": "UpdateImageAIProcessQueue", "Version": "2023-05-01"}, {}, {}), "UpdateImageAIProcessQueueStatus": ApiInfo("POST", "/", {"Action": "UpdateImageAIProcessQueueStatus", "Version": "2023-05-01"}, {}, {}), "DeleteImageAIProcessDetail": ApiInfo("POST", "/", {"Action": "DeleteImageAIProcessDetail", "Version": "2023-05-01"}, {}, {}), "GetImageAIProcessQueues": ApiInfo("GET", "/", {"Action": "GetImageAIProcessQueues", "Version": "2023-05-01"}, {}, {}), "GetImageAITasks": ApiInfo("GET", "/", {"Action": "GetImageAITasks", "Version": "2023-05-01"}, {}, {}), "GetImageAIDetails": ApiInfo("GET", "/", {"Action": "GetImageAIDetails", "Version": "2023-05-01"}, {}, {}), "UpdateImageResourceStatus": ApiInfo("POST", "/", {"Action": "UpdateImageResourceStatus", "Version": "2023-05-01"}, {}, {}), "UpdateFileStorageClass": ApiInfo("POST", "/", {"Action": "UpdateFileStorageClass", "Version": "2023-05-01"}, {}, {}), "GetImageStorageFiles": ApiInfo("GET", "/", {"Action": "GetImageStorageFiles", "Version": "2018-08-01"}, {}, {}), "DeleteImageUploadFiles": ApiInfo("POST", "/", {"Action": "DeleteImageUploadFiles", "Version": "2018-08-01"}, {}, {}), "CreateFileRestore": ApiInfo("POST", "/", {"Action": "CreateFileRestore", "Version": "2023-05-01"}, {}, {}), "UpdateImageUploadFiles": ApiInfo("POST", "/", {"Action": "UpdateImageUploadFiles", "Version": "2023-05-01"}, {}, {}), "CommitImageUpload": ApiInfo("POST", "/", {"Action": "CommitImageUpload", "Version": "2018-08-01"}, {}, {}), "UpdateImageFileCT": ApiInfo("POST", "/", {"Action": "UpdateImageFileCT", "Version": "2018-08-01"}, {}, {}), "ApplyVpcUploadInfo": ApiInfo("GET", "/", {"Action": "ApplyVpcUploadInfo", "Version": "2023-05-01"}, {}, {}), "ApplyImageUpload": ApiInfo("GET", "/", {"Action": "ApplyImageUpload", "Version": "2018-08-01"}, {}, {}), "GetImageUploadFile": ApiInfo("GET", "/", {"Action": "GetImageUploadFile", "Version": "2023-05-01"}, {}, {}), "GetImageUploadFiles": ApiInfo("GET", "/", {"Action": "GetImageUploadFiles", "Version": "2018-08-01"}, {}, {}), "GetImageUpdateFiles": ApiInfo("GET", "/", {"Action": "GetImageUpdateFiles", "Version": "2023-05-01"}, {}, {}), "PreviewImageUploadFile": ApiInfo("GET", "/", {"Action": "PreviewImageUploadFile", "Version": "2023-05-01"}, {}, {}), "GetImageEraseResult": ApiInfo("POST", "/", {"Action": "GetImageEraseResult", "Version": "2023-05-01"}, {}, {}), "GetImageService": ApiInfo("GET", "/", {"Action": "GetImageService", "Version": "2018-08-01"}, {}, {}), "GetAllImageServices": ApiInfo("GET", "/", {"Action": "GetAllImageServices", "Version": "2018-08-01"}, {}, {}), "CreateImageCompressTask": ApiInfo("POST", "/", {"Action": "CreateImageCompressTask", "Version": "2018-08-01"}, {}, {}), "FetchImageUrl": ApiInfo("POST", "/", {"Action": "FetchImageUrl", "Version": "2023-05-01"}, {}, {}), "UpdateImageStorageTTL": ApiInfo("POST", "/", {"Action": "UpdateImageStorageTTL", "Version": "2023-05-01"}, {}, {}), "GetCompressTaskInfo": ApiInfo("GET", "/", {"Action": "GetCompressTaskInfo", "Version": "2018-08-01"}, {}, {}), "GetUrlFetchTask": ApiInfo("GET", "/", {"Action": "GetUrlFetchTask", "Version": "2018-08-01"}, {}, {}), "GetResourceURL": ApiInfo("GET", "/", {"Action": "GetResourceURL", "Version": "2023-05-01"}, {}, {}), "CreateImageFromUri": ApiInfo("POST", "/", {"Action": "CreateImageFromUri", "Version": "2023-05-01"}, {}, {}), "UpdateImageFileKey": ApiInfo("POST", "/", {"Action": "UpdateImageFileKey", "Version": "2018-08-01"}, {}, {}), "CreateImageContentTask": ApiInfo("POST", "/", {"Action": "CreateImageContentTask", "Version": "2023-05-01"}, {}, {}), "GetImageContentTaskDetail": ApiInfo("POST", "/", {"Action": "GetImageContentTaskDetail", "Version": "2023-05-01"}, {}, {}), "GetImageContentBlockList": ApiInfo("POST", "/", {"Action": "GetImageContentBlockList", "Version": "2023-05-01"}, {}, {}), "CreateImageTranscodeQueue": ApiInfo("POST", "/", {"Action": "CreateImageTranscodeQueue", "Version": "2023-05-01"}, {}, {}), "DeleteImageTranscodeQueue": ApiInfo("POST", "/", {"Action": "DeleteImageTranscodeQueue", "Version": "2023-05-01"}, {}, {}), "UpdateImageTranscodeQueue": ApiInfo("POST", "/", {"Action": "UpdateImageTranscodeQueue", "Version": "2023-05-01"}, {}, {}), "UpdateImageTranscodeQueueStatus": ApiInfo("POST", "/", {"Action": "UpdateImageTranscodeQueueStatus", "Version": "2023-05-01"}, {}, {}), "GetImageTranscodeQueues": ApiInfo("GET", "/", {"Action": "GetImageTranscodeQueues", "Version": "2023-05-01"}, {}, {}), "CreateImageTranscodeTask": ApiInfo("POST", "/", {"Action": "CreateImageTranscodeTask", "Version": "2023-05-01"}, {}, {}), "GetImageTranscodeDetails": ApiInfo("GET", "/", {"Action": "GetImageTranscodeDetails", "Version": "2023-05-01"}, {}, {}), "CreateImageTranscodeCallback": ApiInfo("POST", "/", {"Action": "CreateImageTranscodeCallback", "Version": "2023-05-01"}, {}, {}), "DeleteImageTranscodeDetail": ApiInfo("POST", "/", {"Action": "DeleteImageTranscodeDetail", "Version": "2023-05-01"}, {}, {}), "GetImagePSDetection": ApiInfo("POST", "/", {"Action": "GetImagePSDetection", "Version": "2023-05-01"}, {}, {}), "GetImageSuperResolutionResult": ApiInfo("POST", "/", {"Action": "GetImageSuperResolutionResult", "Version": "2023-05-01"}, {}, {}), "GetDenoisingImage": ApiInfo("POST", "/", {"Action": "GetDenoisingImage", "Version": "2023-05-01"}, {}, {}), "GetImageDuplicateDetection": ApiInfo("POST", "/", {"Action": "GetImageDuplicateDetection", "Version": "2018-08-01"}, {}, {}), "GetImageOCRV2": ApiInfo("POST", "/", {"Action": "GetImageOCRV2", "Version": "2018-08-01"}, {}, {}), "GetImageBgFillResult": ApiInfo("POST", "/", {"Action": "GetImageBgFillResult", "Version": "2023-05-01"}, {}, {}), "GetSegmentImage": ApiInfo("POST", "/", {"Action": "GetSegmentImage", "Version": "2023-05-01"}, {}, {}), "GetImageSmartCropResult": ApiInfo("POST", "/", {"Action": "GetImageSmartCropResult", "Version": "2023-05-01"}, {}, {}), "GetImageComicResult": ApiInfo("POST", "/", {"Action": "GetImageComicResult", "Version": "2023-05-01"}, {}, {}), "GetImageEnhanceResult": ApiInfo("POST", "/", {"Action": "GetImageEnhanceResult", "Version": "2018-08-01"}, {}, {}), "GetImageQuality": ApiInfo("POST", "/", {"Action": "GetImageQuality", "Version": "2018-08-01"}, {}, {}), "GetLicensePlateDetection": ApiInfo("POST", "/", {"Action": "GetLicensePlateDetection", "Version": "2023-05-01"}, {}, {}), "GetPrivateImageType": ApiInfo("POST", "/", {"Action": "GetPrivateImageType", "Version": "2018-08-01"}, {}, {}), "CreateCVImageGenerateTask": ApiInfo("POST", "/", {"Action": "CreateCVImageGenerateTask", "Version": "2023-05-01"}, {}, {}), "CreateHiddenWatermarkImage": ApiInfo("POST", "/", {"Action": "CreateHiddenWatermarkImage", "Version": "2023-05-01"}, {}, {}), "CreateHmExtractTask": ApiInfo("POST", "/", {"Action": "CreateHmExtractTask", "Version": "2023-05-01"}, {}, {}), "UpdateImageExifData": ApiInfo("POST", "/", {"Action": "UpdateImageExifData", "Version": "2023-05-01"}, {}, {}), "GetImageDetectResult": ApiInfo("POST", "/", {"Action": "GetImageDetectResult", "Version": "2023-05-01"}, {}, {}), "GetCVImageGenerateResult": ApiInfo("POST", "/", {"Action": "GetCVImageGenerateResult", "Version": "2023-05-01"}, {}, {}), "CreateImageHmExtract": ApiInfo("POST", "/", {"Action": "CreateImageHmExtract", "Version": "2023-05-01"}, {}, {}), "GetCVTextGenerateImage": ApiInfo("POST", "/", {"Action": "GetCVTextGenerateImage", "Version": "2023-05-01"}, {}, {}), "GetCVImageGenerateTask": ApiInfo("POST", "/", {"Action": "GetCVImageGenerateTask", "Version": "2023-05-01"}, {}, {}), "CreateImageHmEmbed": ApiInfo("POST", "/", {"Action": "CreateImageHmEmbed", "Version": "2023-05-01"}, {}, {}), "GetCVAnimeGenerateImage": ApiInfo("POST", "/", {"Action": "GetCVAnimeGenerateImage", "Version": "2023-05-01"}, {}, {}), "GetComprehensiveEnhanceImage": ApiInfo("POST", "/", {"Action": "GetComprehensiveEnhanceImage", "Version": "2023-05-01"}, {}, {}), "GetImageAiGenerateTask": ApiInfo("GET", "/", {"Action": "GetImageAiGenerateTask", "Version": "2018-08-01"}, {}, {}), "GetProductAIGCResult": ApiInfo("POST", "/", {"Action": "GetProductAIGCResult", "Version": "2023-05-01"}, {}, {}), "GetImageEraseModels": ApiInfo("GET", "/", {"Action": "GetImageEraseModels", "Version": "2023-05-01"}, {}, {}), "GetDedupTaskStatus": ApiInfo("GET", "/", {"Action": "GetDedupTaskStatus", "Version": "2018-08-01"}, {}, {}), "GetImageHmExtractTaskInfo": ApiInfo("POST", "/", {"Action": "GetImageHmExtractTaskInfo", "Version": "2023-05-01"}, {}, {}), "CreateImageService": ApiInfo("POST", "/", {"Action": "CreateImageService", "Version": "2023-05-01"}, {}, {}), "DeleteImageService": ApiInfo("POST", "/", {"Action": "DeleteImageService", "Version": "2023-05-01"}, {}, {}), "UpdateImageAuthKey": ApiInfo("POST", "/", {"Action": "UpdateImageAuthKey", "Version": "2023-05-01"}, {}, {}), "UpdateResEventRule": ApiInfo("POST", "/", {"Action": "UpdateResEventRule", "Version": "2018-08-01"}, {}, {}), "UpdateServiceName": ApiInfo("POST", "/", {"Action": "UpdateServiceName", "Version": "2023-05-01"}, {}, {}), "UpdateStorageRules": ApiInfo("POST", "/", {"Action": "UpdateStorageRules", "Version": "2023-05-01"}, {}, {}), "UpdateStorageRulesV2": ApiInfo("POST", "/", {"Action": "UpdateStorageRulesV2", "Version": "2023-05-01"}, {}, {}), "UpdateImageObjectAccess": ApiInfo("POST", "/", {"Action": "UpdateImageObjectAccess", "Version": "2023-05-01"}, {}, {}), "UpdateImageUploadOverwrite": ApiInfo("POST", "/", {"Action": "UpdateImageUploadOverwrite", "Version": "2018-08-01"}, {}, {}), "UpdateImageMirrorConf": ApiInfo("POST", "/", {"Action": "UpdateImageMirrorConf", "Version": "2018-08-01"}, {}, {}), "GetImageServiceSubscription": ApiInfo("GET", "/", {"Action": "GetImageServiceSubscription", "Version": "2023-05-01"}, {}, {}), "GetImageAuthKey": ApiInfo("GET", "/", {"Action": "GetImageAuthKey", "Version": "2023-05-01"}, {}, {}), "CreateImageAnalyzeTask": ApiInfo("POST", "/", {"Action": "CreateImageAnalyzeTask", "Version": "2023-05-01"}, {}, {}), "DeleteImageAnalyzeTaskRun": ApiInfo("POST", "/", {"Action": "DeleteImageAnalyzeTaskRun", "Version": "2023-05-01"}, {}, {}), "DeleteImageAnalyzeTask": ApiInfo("POST", "/", {"Action": "DeleteImageAnalyzeTask", "Version": "2023-05-01"}, {}, {}), "UpdateImageAnalyzeTaskStatus": ApiInfo("POST", "/", {"Action": "UpdateImageAnalyzeTaskStatus", "Version": "2023-05-01"}, {}, {}), "UpdateImageAnalyzeTask": ApiInfo("POST", "/", {"Action": "UpdateImageAnalyzeTask", "Version": "2023-05-01"}, {}, {}), "GetImageAnalyzeTasks": ApiInfo("GET", "/", {"Action": "GetImageAnalyzeTasks", "Version": "2023-05-01"}, {}, {}), "GetImageAnalyzeResult": ApiInfo("GET", "/", {"Action": "GetImageAnalyzeResult", "Version": "2023-05-01"}, {}, {}), "DeleteImageElements": ApiInfo("POST", "/", {"Action": "DeleteImageElements", "Version": "2023-05-01"}, {}, {}), "DeleteImageBackgroundColors": ApiInfo("POST", "/", {"Action": "DeleteImageBackgroundColors", "Version": "2023-05-01"}, {}, {}), "DeleteImageStyle": ApiInfo("POST", "/", {"Action": "DeleteImageStyle", "Version": "2023-05-01"}, {}, {}), "CreateImageStyle": ApiInfo("POST", "/", {"Action": "CreateImageStyle", "Version": "2023-05-01"}, {}, {}), "UpdateImageStyleMeta": ApiInfo("POST", "/", {"Action": "UpdateImageStyleMeta", "Version": "2023-05-01"}, {}, {}), "AddImageElements": ApiInfo("POST", "/", {"Action": "AddImageElements", "Version": "2023-05-01"}, {}, {}), "AddImageBackgroundColors": ApiInfo("POST", "/", {"Action": "AddImageBackgroundColors", "Version": "2023-05-01"}, {}, {}), "UpdateImageStyle": ApiInfo("POST", "/", {"Action": "UpdateImageStyle", "Version": "2018-08-01"}, {}, {}), "GetImageFonts": ApiInfo("GET", "/", {"Action": "GetImageFonts", "Version": "2023-05-01"}, {}, {}), "GetImageElements": ApiInfo("GET", "/", {"Action": "GetImageElements", "Version": "2023-05-01"}, {}, {}), "GetImageBackgroundColors": ApiInfo("GET", "/", {"Action": "GetImageBackgroundColors", "Version": "2023-05-01"}, {}, {}), "GetImageStyles": ApiInfo("GET", "/", {"Action": "GetImageStyles", "Version": "2023-05-01"}, {}, {}), "GetImageStyleDetail": ApiInfo("GET", "/", {"Action": "GetImageStyleDetail", "Version": "2018-08-01"}, {}, {}), "GetImageStyleResult": ApiInfo("POST", "/", {"Action": "GetImageStyleResult", "Version": "2018-08-01"}, {}, {}), "DownloadCert": ApiInfo("GET", "/", {"Action": "DownloadCert", "Version": "2023-05-01"}, {}, {}), "GetImageAllDomainCert": ApiInfo("GET", "/", {"Action": "GetImageAllDomainCert", "Version": "2023-05-01"}, {}, {}), "GetCertInfo": ApiInfo("GET", "/", {"Action": "GetCertInfo", "Version": "2023-05-01"}, {}, {}), "GetAllCerts": ApiInfo("GET", "/", {"Action": "GetAllCerts", "Version": "2023-05-01"}, {}, {}), "CreateImageTemplate": ApiInfo("POST", "/", {"Action": "CreateImageTemplate", "Version": "2018-08-01"}, {}, {}), "DeleteTemplatesFromBin": ApiInfo("POST", "/", {"Action": "DeleteTemplatesFromBin", "Version": "2023-05-01"}, {}, {}), "DeleteImageTemplate": ApiInfo("POST", "/", {"Action": "DeleteImageTemplate", "Version": "2023-05-01"}, {}, {}), "CreateImageTemplatesByImport": ApiInfo("POST", "/", {"Action": "CreateImageTemplatesByImport", "Version": "2023-05-01"}, {}, {}), "CreateTemplatesFromBin": ApiInfo("POST", "/", {"Action": "CreateTemplatesFromBin", "Version": "2023-05-01"}, {}, {}), "GetImageTemplate": ApiInfo("GET", "/", {"Action": "GetImageTemplate", "Version": "2018-08-01"}, {}, {}), "GetTemplatesFromBin": ApiInfo("GET", "/", {"Action": "GetTemplatesFromBin", "Version": "2018-08-01"}, {}, {}), "GetAllImageTemplates": ApiInfo("GET", "/", {"Action": "GetAllImageTemplates", "Version": "2018-08-01"}, {}, {}), "CreateImageAuditTask": ApiInfo("POST", "/", {"Action": "CreateImageAuditTask", "Version": "2023-05-01"}, {}, {}), "CreateVideoAuditTask": ApiInfo("POST", "/", {"Action": "CreateVideoAuditTask", "Version": "2023-05-01"}, {}, {}), "CreateAudioAuditTask": ApiInfo("POST", "/", {"Action": "CreateAudioAuditTask", "Version": "2023-05-01"}, {}, {}), "DeleteImageAuditResult": ApiInfo("POST", "/", {"Action": "DeleteImageAuditResult", "Version": "2023-05-01"}, {}, {}), "GetSyncAuditResult": ApiInfo("POST", "/", {"Action": "GetSyncAuditResult", "Version": "2023-05-01"}, {}, {}), "SingleImageAudit": ApiInfo("POST", "/", {"Action": "SingleImageAudit", "Version": "2023-05-01"}, {}, {}), "BatchImageAudit": ApiInfo("POST", "/", {"Action": "BatchImageAudit", "Version": "2023-05-01"}, {}, {}), "UpdateImageAuditTaskStatus": ApiInfo("POST", "/", {"Action": "UpdateImageAuditTaskStatus", "Version": "2023-05-01"}, {}, {}), "UpdateImageAuditTask": ApiInfo("POST", "/", {"Action": "UpdateImageAuditTask", "Version": "2023-05-01"}, {}, {}), "UpdateAuditImageStatus": ApiInfo("POST", "/", {"Action": "UpdateAuditImageStatus", "Version": "2023-05-01"}, {}, {}), "UpdateVideoAuditTask": ApiInfo("POST", "/", {"Action": "UpdateVideoAuditTask", "Version": "2023-05-01"}, {}, {}), "UpdateAudioAuditTask": ApiInfo("POST", "/", {"Action": "UpdateAudioAuditTask", "Version": "2023-05-01"}, {}, {}), "GetImageAuditTasks": ApiInfo("GET", "/", {"Action": "GetImageAuditTasks", "Version": "2023-05-01"}, {}, {}), "GetImageAuditTaskResult": ApiInfo("GET", "/", {"Action": "GetImageAuditTaskResult", "Version": "2023-05-01"}, {}, {}), "GetImageAuditResult": ApiInfo("GET", "/", {"Action": "GetImageAuditResult", "Version": "2023-05-01"}, {}, {}), "GetAuditEntrysCount": ApiInfo("GET", "/", {"Action": "GetAuditEntrysCount", "Version": "2023-05-01"}, {}, {}), "GetVideoAuditResult": ApiInfo("GET", "/", {"Action": "GetVideoAuditResult", "Version": "2023-05-01"}, {}, {}), "GetAudioAuditResult": ApiInfo("GET", "/", {"Action": "GetAudioAuditResult", "Version": "2023-05-01"}, {}, {}), "CreateImageRetryAuditTask": ApiInfo("POST", "/", {"Action": "CreateImageRetryAuditTask", "Version": "2023-05-01"}, {}, {}) } ================================================ FILE: volcengine/imagex/v2/imagex_service.py ================================================ # coding:utf-8 from volcengine.imagex.v2.imagex_trait import ImagexTrait # Modify it if necessary from volcengine.imagex.v2.upload import Uploader from volcengine.const.Const import * from volcengine.imagex.v2.const import * from volcengine.imagex.v2.helper.file_section_reader import FileSectionReader from volcengine.util.Util import * from volcengine.Policy import * import threading import os class ImagexService(ImagexTrait): def __init__(self, region=REGION_CN_NORTH1, ak=None, sk=None): super().__init__( { "region": region, "ak": ak, "sk": sk, } ) # upload def apply_upload(self, params): return self.imagex_get("ApplyImageUpload", params, doseq=1) def commit_upload(self, params, body): return self.imagex_post("CommitImageUpload", params, body) # upload local image file # noinspection DuplicatedCode def upload_image(self, params, file_paths): for p in file_paths: if not os.path.isfile(p): raise Exception("no such file on file path %s" % p) apply_upload_request = { "ServiceId": params["ServiceId"], "SessionKey": params.get("SessionKey", ""), "UploadNum": len(file_paths), "StoreKeys": params.get("StoreKeys", []), "Overwrite": str(params.get("Overwrite", False)), } resp = self.apply_upload(apply_upload_request) if "Error" in resp["ResponseMetadata"]: raise Exception(resp["ResponseMetadata"]) result = resp["Result"] reqid = result["RequestId"] addr = result["UploadAddress"] if len(addr["UploadHosts"]) == 0: raise Exception("no upload host found, reqid %s" % reqid) elif len(addr["StoreInfos"]) != len(file_paths): raise Exception( "store info len %d != upload num %d, reqid %s" % (len(result["StoreInfos"]), len(file_paths), reqid) ) session_key = addr["SessionKey"] host = addr["UploadHosts"][0] uploader = self.do_upload(file_paths, host, addr["StoreInfos"], params) if len(uploader.successOids) == 0: raise Exception("no file uploaded") if params.get("SkipCommit", False): return {"Results": uploader.results} commit_upload_request = { "ServiceId": params["ServiceId"], "SkipMeta": params.get("SkipMeta", False), } commit_upload_body = { "SessionKey": session_key, "SuccessOids": uploader.successOids, "Functions": params.get("Functions", []), "OptionInfos": params.get("OptionInfos", []), } resp = self.commit_upload(commit_upload_request, json.dumps(commit_upload_body)) if "Error" in resp["ResponseMetadata"]: raise Exception(resp["ResponseMetadata"]) return resp["Result"] # upload image data # noinspection DuplicatedCode def upload_image_data(self, params, img_datas): for data in img_datas: if not isinstance(data, bytes): raise Exception("upload of non-bytes not supported") apply_upload_request = { "ServiceId": params["ServiceId"], "SessionKey": params.get("SessionKey", ""), "UploadNum": len(img_datas), "StoreKeys": params.get("StoreKeys", []), "Overwrite": str(params.get("Overwrite", False)), } resp = self.apply_upload(apply_upload_request) if "Error" in resp["ResponseMetadata"]: raise Exception(resp["ResponseMetadata"]) result = resp["Result"] reqid = result["RequestId"] addr = result["UploadAddress"] if len(addr["UploadHosts"]) == 0: raise Exception("no upload host found, reqid %s" % reqid) elif len(addr["StoreInfos"]) != len(img_datas): raise Exception( "store info len %d != upload num %d, reqid %s" % (len(result["StoreInfos"]), len(img_datas), reqid) ) session_key = addr["SessionKey"] host = addr["UploadHosts"][0] uploader = self.do_upload(img_datas, host, addr["StoreInfos"], params) if len(uploader.successOids) == 0: raise Exception("no file uploaded") if params.get("SkipCommit", False): return {"Results": uploader.results} commit_upload_request = { "ServiceId": params["ServiceId"], "SkipMeta": params.get("SkipMeta", False), } commit_upload_body = { "SessionKey": session_key, "SuccessOids": uploader.successOids, "Functions": params.get("Functions", []), "OptionInfos": params.get("OptionInfos", []), } resp = self.commit_upload(commit_upload_request, json.dumps(commit_upload_body)) if "Error" in resp["ResponseMetadata"]: raise Exception(resp["ResponseMetadata"]) return resp["Result"] def vpc_upload_image(self, upload_request): if upload_request.get("FilePath", "") == "" and len(upload_request.get("Data", '')) == 0: raise Exception("filePath and data can not be empty at the same time") if upload_request.get("FilePath", "") != "" and len(upload_request.get("Data", '')) != 0: raise Exception("filePath and data can not be not empty at the same time") file_path = upload_request.get("FilePath", "") if file_path != "": if not os.path.isfile(file_path): raise Exception("no such file on file path") file_size = os.path.getsize(file_path) is_file = True else: file_size = len(upload_request.get("Data", [])) is_file = False apply_vpc_request = { "ContentType": upload_request.get("ContentType", ""), "FileExtension": upload_request.get("FileExtension", ""), "FileSize": file_size, "PartSize": upload_request.get("PartSize", 0), "Prefix": upload_request.get("Prefix", ""), "ServiceId": upload_request.get("ServiceId"), "StorageClass": upload_request.get("StorageClass", ""), "StoreKey": upload_request.get("StoreKey", ""), "Overwrite": upload_request.get("Overwrite", False), } resp = self.apply_vpc_upload_info(apply_vpc_request) if "Error" in resp["ResponseMetadata"] or resp["Result"] is None or resp["Result"].get("UploadAddr") == "": raise Exception(resp["ResponseMetadata"]) upload_addr = resp["Result"] file_info = { "FilePath": file_path, "Data": upload_request.get("Data"), "FileSize": file_size, "IsFile": is_file, } session_key = upload_addr["SessionKey"] commit_upload_request = { "ServiceId": upload_request["ServiceId"], "SkipMeta": upload_request.get("SkipMeta", False), } commit_upload_body = { "SessionKey": session_key, "SuccessOids": [], "Functions": upload_request.get("Functions", []), "OptionInfos": upload_request.get("OptionInfos", []), } try: self.vpc_upload(upload_addr, file_info) except Exception as e: self.commit_upload(commit_upload_request, json.dumps(commit_upload_body)) raise Exception(e) successOids = [upload_addr.get("Oid")] commit_upload_body["SuccessOids"] = successOids resp = self.commit_upload(commit_upload_request, json.dumps(commit_upload_body)) if "Error" in resp["ResponseMetadata"]: raise Exception(resp["ResponseMetadata"]) return resp["Result"] def vpc_upload(self, vpc_upload_address, file_info): if vpc_upload_address.get("UploadMode") == "direct": self.vpc_put(vpc_upload_address, file_info) elif vpc_upload_address.get("UploadMode") == "part": self.vpc_part_upload(vpc_upload_address.get("PartUploadInfo"), file_info) else: raise Exception("unknown upload mode") def vpc_part_upload(self, part_upload_info, file_info): if part_upload_info is None: raise Exception("part upload info is empty") file_size = file_info.get("FileSize") chunk_size = part_upload_info.get("PartSize") total_num = file_size // chunk_size last_part_size = file_size % chunk_size part_put_urls = part_upload_info.get("PartPutURLs", []) if (last_part_size == 0 and total_num != len(part_put_urls) or ( last_part_size != 0 and total_num + 1 != len(part_put_urls))): raise Exception("mismatch part upload urls") offset = 0 etag_list = [] for i in range(len(part_put_urls)): part_put_url = part_put_urls[i] if i == len(part_put_urls) - 1: chunk_size = file_size - offset if file_info.get("IsFile"): with open(file_info.get("FilePath"), 'rb') as f: sr = FileSectionReader(f, chunk_size, init_offset=offset, can_reset=True) etag = self.vpc_part_put(part_put_url, sr) else: etag = self.vpc_part_put(part_put_url, file_info.get("Data")[offset:offset + chunk_size]) offset = offset + chunk_size etag_list.append(etag) post_data = self.vpc_generate_body(etag_list) post_url_headers_list = part_upload_info.get("CompletePartURLHeaders", []) post_headers = {} for post_url_header in post_url_headers_list: post_headers[post_url_header["Key"]] = post_url_header["Value"] self.vpc_post(part_upload_info.get("CompletePartURL"), post_data, post_headers) def vpc_post(self, post_url, data, headers): resp = self.session.post(post_url, data=data, headers=headers) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("vpc post error, logId: {}".format(log_id)) def vpc_generate_body(self, etag_list): if len(etag_list) == 0: raise Exception('etag list empty') s = [] for i in range(len(etag_list)): s.append("{" + '"PartNumber": {}, "ETag": {}'.format(i + 1, etag_list[i]) + "}") comma = ',' return '{"Parts":[' + comma.join(s) + ']}' def vpc_part_put(self, part_put_url, content): resp = self.session.put(part_put_url, data=content) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("put error: code resp.status_code{} logId {}".format(resp.status_code, log_id)) etag = resp.headers.get("ETag", "") return etag def vpc_put(self, vpc_upload_address, file_info): put_url = vpc_upload_address.get("PutURL") put_url_headers_list = vpc_upload_address.get("PutURLHeaders", []) put_headers = {} for put_url_header in put_url_headers_list: put_headers[put_url_header["Key"]] = put_url_header["Value"] if file_info.get("IsFile"): with open(file_info.get("FilePath"), 'rb') as f: resp = self.session.put(put_url, headers=put_headers, data=f) else: resp = self.session.put(put_url, headers=put_headers, data=file_info.get("Data")) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("put error: code resp.status_code{} logId {}".format(resp.status_code, log_id)) def do_upload(self, file_paths_or_bytes, host, store_infos, params=None): threads = [] uploader = Uploader(self, host, store_infos, file_paths_or_bytes, params) for i in range(UPLOAD_THREADS): thread = threading.Thread(target=uploader.async_upload) thread.start() threads.append(thread) for i in range(UPLOAD_THREADS): threads[i].join() return uploader def get_upload_auth_token(self, params): apply_token = self.get_sign_url("ApplyImageUpload", params) commit_token = self.get_sign_url("CommitImageUpload", params) ret = { "Version": "v1", "ApplyUploadToken": apply_token, "CommitUploadToken": commit_token, } data = json.dumps(ret) if sys.version_info[0] == 3: return base64.b64encode(data.encode("utf-8")).decode("utf-8") else: return base64.b64encode(data.decode("utf-8")) # tag 字段如下,可选择所需字段传入 # upload_policy_dict = { # "FileSizeUpLimit": "xxx", # "FileSizeBottomLimit": "xxx", # "ContentTypeBlackList":[ # "xxx" # ], # "ContentTypeWhiteList":[ # "xxx" # ] # } # policy_str = json.dumps(upload_policy_dict) # # tag = { # "UploadOverwrite": "true", # "UploadPolicy": policy_str, # } def get_upload_auth(self, service_ids, expire=60 * 60, key_ptn="", tag=dict): apply_res = [] commit_res = [] if len(service_ids) == 0: apply_res.append(ResourceServiceIdTRN % "*") commit_res.append(ResourceServiceIdTRN % "*") else: for sid in service_ids: apply_res.append(ResourceServiceIdTRN % sid) commit_res.append(ResourceServiceIdTRN % sid) apply_res.append(ResourceStoreKeyTRN % key_ptn) inline_policy = Policy( [ Statement.new_allow_statement(["ImageX:ApplyImageUpload"], apply_res), Statement.new_allow_statement(["ImageX:CommitImageUpload"], commit_res), ] ) for k, v in tag.items(): inline_policy.statements.append( Statement.new_allow_statement([k], [str(v)]) ) return self.sign_sts2(inline_policy, expire) ================================================ FILE: volcengine/imagex/v2/imagex_trait.py ================================================ # coding:utf-8 import json from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.util.Util import * from volcengine.Policy import * from volcengine.imagex.v2.imagex_config import * # Modify it if necessary class ImagexTrait(Service): def __init__(self, param=None): if param is None: param = {} self.param = param region = param.get('region', REGION_CN_NORTH1) self.service_info = ImagexTrait.get_service_info(region) self.api_info = ImagexTrait.get_api_info() if param.get('ak', None) and param.get('sk', None): self.set_ak(param['ak']) self.set_sk(param['sk']) super(ImagexTrait, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('Not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info def imagex_get(self, action, params, doseq=0): res = self.get(action, params, doseq) try: res_json = json.loads(res) except Exception as e: raise Exception("res body is not json, %s, %s" % (e, res)) if "ResponseMetadata" not in res_json: raise Exception("ResponseMetadata not in resp body, action %s, resp %s" % (action, res)) elif "Error" in res_json["ResponseMetadata"]: raise Exception("%s failed, %s" %(action,res)) return res_json def imagex_post(self, action, params, body): res = self.json(action, params, body) try: res_json = json.loads(res) except Exception as e: raise Exception("res body is not json, %s, %s" % (e, res)) if "ResponseMetadata" not in res_json: raise Exception("ResponseMetadata not in resp body, action %s, resp %s" % (action, res)) elif "Error" in res_json["ResponseMetadata"]: raise Exception("%s failed, %s" %(action,res)) return res_json def update_image_domain_volc_origin(self, query={}, body={}): return self.imagex_post('UpdateImageDomainVolcOrigin', query, json.dumps(body)) def del_domain(self, query={}, body={}): return self.imagex_post('DelDomain', query, json.dumps(body)) def add_domain_v_1(self, query={}, body={}): return self.imagex_post('AddDomainV1', query, json.dumps(body)) def update_image_domain_ip_auth(self, query={}, body={}): return self.imagex_post('UpdateImageDomainIPAuth', query, json.dumps(body)) def update_refer(self, query={}, body={}): return self.imagex_post('UpdateRefer', query, json.dumps(body)) def update_image_domain_ua_access(self, query={}, body={}): return self.imagex_post('UpdateImageDomainUaAccess', query, json.dumps(body)) def update_https(self, query={}, body={}): return self.imagex_post('UpdateHttps', query, json.dumps(body)) def update_image_domain_download_speed_limit(self, query={}, body={}): return self.imagex_post('UpdateImageDomainDownloadSpeedLimit', query, json.dumps(body)) def update_response_header(self, query={}, body={}): return self.imagex_post('UpdateResponseHeader', query, json.dumps(body)) def update_image_domain_area_access(self, query={}, body={}): return self.imagex_post('UpdateImageDomainAreaAccess', query, json.dumps(body)) def update_domain_adaptive_fmt(self, query={}, body={}): return self.imagex_post('UpdateDomainAdaptiveFmt', query, json.dumps(body)) def update_image_domain_config(self, query={}, body={}): return self.imagex_post('UpdateImageDomainConfig', query, json.dumps(body)) def update_advance(self, query={}, body={}): return self.imagex_post('UpdateAdvance', query, json.dumps(body)) def update_image_domain_bandwidth_limit(self, query={}, body={}): return self.imagex_post('UpdateImageDomainBandwidthLimit', query, json.dumps(body)) def update_slim_config(self, query={}, body={}): return self.imagex_post('UpdateSlimConfig', query, json.dumps(body)) def set_default_domain(self, body={}): return self.imagex_post('SetDefaultDomain', [], json.dumps(body)) def describe_image_volc_cdn_access_log(self, query={}, body={}): return self.imagex_post('DescribeImageVolcCdnAccessLog', query, json.dumps(body)) def verify_domain_owner(self, query={}, body={}): return self.imagex_post('VerifyDomainOwner', query, json.dumps(body)) def get_response_header_validate_keys(self): return self.imagex_get('GetResponseHeaderValidateKeys', {}) def get_domain_config(self, query={}): return self.imagex_get('GetDomainConfig', query) def get_domain_owner_verify_content(self, query={}): return self.imagex_get('GetDomainOwnerVerifyContent', query) def get_service_domains(self, query={}): return self.imagex_get('GetServiceDomains', query) def delete_image_monitor_rules(self, query={}, body={}): return self.imagex_post('DeleteImageMonitorRules', query, json.dumps(body)) def delete_image_monitor_records(self, query={}, body={}): return self.imagex_post('DeleteImageMonitorRecords', query, json.dumps(body)) def create_image_monitor_rule(self, query={}, body={}): return self.imagex_post('CreateImageMonitorRule', query, json.dumps(body)) def update_image_monitor_rule(self, query={}, body={}): return self.imagex_post('UpdateImageMonitorRule', query, json.dumps(body)) def update_image_monitor_rule_status(self, query={}, body={}): return self.imagex_post('UpdateImageMonitorRuleStatus', query, json.dumps(body)) def get_image_alert_records(self, query={}, body={}): return self.imagex_post('GetImageAlertRecords', query, json.dumps(body)) def get_image_monitor_rules(self, query={}): return self.imagex_get('GetImageMonitorRules', query) def create_image_setting_rule(self, query={}, body={}): return self.imagex_post('CreateImageSettingRule', query, json.dumps(body)) def delete_image_setting_rule(self, query={}, body={}): return self.imagex_post('DeleteImageSettingRule', query, json.dumps(body)) def update_image_setting_rule_priority(self, query={}, body={}): return self.imagex_post('UpdateImageSettingRulePriority', query, json.dumps(body)) def update_image_setting_rule(self, query={}, body={}): return self.imagex_post('UpdateImageSettingRule', query, json.dumps(body)) def get_image_settings(self, query={}): return self.imagex_get('GetImageSettings', query) def get_image_setting_rule_history(self, query={}): return self.imagex_get('GetImageSettingRuleHistory', query) def get_image_setting_rules(self, query={}): return self.imagex_get('GetImageSettingRules', query) def create_image_migrate_task(self, body={}): return self.imagex_post('CreateImageMigrateTask', [], json.dumps(body)) def delete_image_migrate_task(self, query={}, body={}): return self.imagex_post('DeleteImageMigrateTask', query, json.dumps(body)) def export_failed_migrate_task(self, query={}): return self.imagex_get('ExportFailedMigrateTask', query) def update_image_task_strategy(self, body={}): return self.imagex_post('UpdateImageTaskStrategy', [], json.dumps(body)) def terminate_image_migrate_task(self, query={}, body={}): return self.imagex_post('TerminateImageMigrateTask', query, json.dumps(body)) def get_vendor_buckets(self, body={}): return self.imagex_post('GetVendorBuckets', [], json.dumps(body)) def get_image_migrate_tasks(self, query={}): return self.imagex_get('GetImageMigrateTasks', query) def rerun_image_migrate_task(self, query={}, body={}): return self.imagex_post('RerunImageMigrateTask', query, json.dumps(body)) def get_image_add_on_tag(self, query={}): return self.imagex_get('GetImageAddOnTag', query) def describe_imagex_cube_usage(self, query={}): return self.imagex_get('DescribeImageXCubeUsage', query) def describe_imagex_source_request_bandwidth(self, query={}): return self.imagex_get('DescribeImageXSourceRequestBandwidth', query) def describe_imagex_source_request_traffic(self, query={}): return self.imagex_get('DescribeImageXSourceRequestTraffic', query) def describe_imagex_source_request(self, query={}): return self.imagex_get('DescribeImageXSourceRequest', query) def describe_imagex_storage_usage(self, query={}): return self.imagex_get('DescribeImageXStorageUsage', query) def describe_imagex_bucket_retrieval_usage(self, query={}): return self.imagex_get('DescribeImageXBucketRetrievalUsage', query) def describe_imagex_add_on_qps_usage(self, query={}): return self.imagex_get('DescribeImageXAddOnQPSUsage', query) def describe_imagexai_request_cnt_usage(self, query={}): return self.imagex_get('DescribeImageXAIRequestCntUsage', query) def describe_imagex_summary(self, query={}): return self.imagex_get('DescribeImageXSummary', query) def describe_imagex_domain_traffic_data(self, query={}): return self.imagex_get('DescribeImageXDomainTrafficData', query) def describe_imagex_domain_bandwidth_data(self, query={}): return self.imagex_get('DescribeImageXDomainBandwidthData', query) def describe_imagex_domain_bandwidth_ninety_five_data(self, query={}): return self.imagex_get('DescribeImageXDomainBandwidthNinetyFiveData', query) def describe_imagex_bucket_usage(self, query={}): return self.imagex_get('DescribeImageXBucketUsage', query) def describe_imagex_billing_request_cnt_usage(self, query={}): return self.imagex_get('DescribeImageXBillingRequestCntUsage', query) def describe_imagex_request_cnt_usage(self, query={}): return self.imagex_get('DescribeImageXRequestCntUsage', query) def describe_imagex_base_op_usage(self, query={}): return self.imagex_get('DescribeImageXBaseOpUsage', query) def describe_imagex_compress_usage(self, query={}): return self.imagex_get('DescribeImageXCompressUsage', query) def describe_imagex_screenshot_usage(self, query={}): return self.imagex_get('DescribeImageXScreenshotUsage', query) def describe_imagex_video_clip_duration_usage(self, query={}): return self.imagex_get('DescribeImageXVideoClipDurationUsage', query) def describe_imagex_multi_compress_usage(self, query={}): return self.imagex_get('DescribeImageXMultiCompressUsage', query) def describe_imagex_edge_request(self, query={}): return self.imagex_get('DescribeImageXEdgeRequest', query) def describe_imagex_edge_request_bandwidth(self, query={}): return self.imagex_get('DescribeImageXEdgeRequestBandwidth', query) def describe_imagex_edge_request_traffic(self, query={}): return self.imagex_get('DescribeImageXEdgeRequestTraffic', query) def describe_imagex_edge_request_regions(self, query={}): return self.imagex_get('DescribeImageXEdgeRequestRegions', query) def describe_imagex_mirror_request_http_code_by_time(self, body={}): return self.imagex_post('DescribeImageXMirrorRequestHttpCodeByTime', [], json.dumps(body)) def describe_imagex_mirror_request_http_code_overview(self, body={}): return self.imagex_post('DescribeImageXMirrorRequestHttpCodeOverview', [], json.dumps(body)) def describe_imagex_mirror_request_traffic(self, body={}): return self.imagex_post('DescribeImageXMirrorRequestTraffic', [], json.dumps(body)) def describe_imagex_mirror_request_bandwidth(self, body={}): return self.imagex_post('DescribeImageXMirrorRequestBandwidth', [], json.dumps(body)) def describe_imagex_server_qps_usage(self, query={}): return self.imagex_get('DescribeImageXServerQPSUsage', query) def describe_imagex_hit_rate_traffic_data(self, query={}): return self.imagex_get('DescribeImageXHitRateTrafficData', query) def describe_imagex_hit_rate_request_data(self, query={}): return self.imagex_get('DescribeImageXHitRateRequestData', query) def describe_imagexcdn_top_request_data(self, query={}): return self.imagex_get('DescribeImageXCDNTopRequestData', query) def describe_imagex_heif_encode_file_in_size_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeFileInSizeByTime', query, json.dumps(body)) def describe_imagex_heif_encode_file_out_size_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeFileOutSizeByTime', query, json.dumps(body)) def describe_imagex_heif_encode_success_count_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeSuccessCountByTime', query, json.dumps(body)) def describe_imagex_heif_encode_success_rate_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeSuccessRateByTime', query, json.dumps(body)) def describe_imagex_heif_encode_duration_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeDurationByTime', query, json.dumps(body)) def describe_imagex_heif_encode_error_code_by_time(self, query={}, body={}): return self.imagex_post('DescribeImageXHeifEncodeErrorCodeByTime', query, json.dumps(body)) def describe_imagex_exceed_resolution_ratio_all(self, body={}): return self.imagex_post('DescribeImageXExceedResolutionRatioAll', [], json.dumps(body)) def describe_imagex_exceed_file_size(self, body={}): return self.imagex_post('DescribeImageXExceedFileSize', [], json.dumps(body)) def describe_imagex_exceed_count_by_time(self, body={}): return self.imagex_post('DescribeImageXExceedCountByTime', [], json.dumps(body)) def describe_imagex_service_quality(self, query={}): return self.imagex_get('DescribeImageXServiceQuality', query) def get_imagex_query_apps(self, query={}): return self.imagex_get('GetImageXQueryApps', query) def get_imagex_query_regions(self, query={}): return self.imagex_get('GetImageXQueryRegions', query) def get_imagex_query_dims(self, query={}): return self.imagex_get('GetImageXQueryDims', query) def get_imagex_query_vals(self, query={}): return self.imagex_get('GetImageXQueryVals', query) def describe_imagex_upload_count_by_time(self, body={}): return self.imagex_post('DescribeImageXUploadCountByTime', [], json.dumps(body)) def describe_imagex_upload_duration(self, body={}): return self.imagex_post('DescribeImageXUploadDuration', [], json.dumps(body)) def describe_imagex_upload_success_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXUploadSuccessRateByTime', [], json.dumps(body)) def describe_imagex_upload_file_size(self, body={}): return self.imagex_post('DescribeImageXUploadFileSize', [], json.dumps(body)) def describe_imagex_upload_error_code_by_time(self, body={}): return self.imagex_post('DescribeImageXUploadErrorCodeByTime', [], json.dumps(body)) def describe_imagex_upload_error_code_all(self, body={}): return self.imagex_post('DescribeImageXUploadErrorCodeAll', [], json.dumps(body)) def describe_imagex_upload_speed(self, body={}): return self.imagex_post('DescribeImageXUploadSpeed', [], json.dumps(body)) def describe_imagex_upload_segment_speed_by_time(self, body={}): return self.imagex_post('DescribeImageXUploadSegmentSpeedByTime', [], json.dumps(body)) def describe_imagex_cdn_success_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXCdnSuccessRateByTime', [], json.dumps(body)) def describe_imagex_cdn_success_rate_all(self, body={}): return self.imagex_post('DescribeImageXCdnSuccessRateAll', [], json.dumps(body)) def describe_imagex_cdn_error_code_by_time(self, body={}): return self.imagex_post('DescribeImageXCdnErrorCodeByTime', [], json.dumps(body)) def describe_imagex_cdn_error_code_all(self, body={}): return self.imagex_post('DescribeImageXCdnErrorCodeAll', [], json.dumps(body)) def describe_imagex_cdn_duration_detail_by_time(self, body={}): return self.imagex_post('DescribeImageXCdnDurationDetailByTime', [], json.dumps(body)) def describe_imagex_cdn_duration_all(self, body={}): return self.imagex_post('DescribeImageXCdnDurationAll', [], json.dumps(body)) def describe_imagex_cdn_reuse_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXCdnReuseRateByTime', [], json.dumps(body)) def describe_imagex_cdn_reuse_rate_all(self, body={}): return self.imagex_post('DescribeImageXCdnReuseRateAll', [], json.dumps(body)) def describe_imagex_cdn_protocol_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXCdnProtocolRateByTime', [], json.dumps(body)) def describe_imagex_client_failure_rate(self, body={}): return self.imagex_post('DescribeImageXClientFailureRate', [], json.dumps(body)) def describe_imagex_client_decode_success_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXClientDecodeSuccessRateByTime', [], json.dumps(body)) def describe_imagex_client_decode_duration_by_time(self, body={}): return self.imagex_post('DescribeImageXClientDecodeDurationByTime', [], json.dumps(body)) def describe_imagex_client_queue_duration_by_time(self, body={}): return self.imagex_post('DescribeImageXClientQueueDurationByTime', [], json.dumps(body)) def describe_imagex_client_error_code_by_time(self, body={}): return self.imagex_post('DescribeImageXClientErrorCodeByTime', [], json.dumps(body)) def describe_imagex_client_error_code_all(self, body={}): return self.imagex_post('DescribeImageXClientErrorCodeAll', [], json.dumps(body)) def describe_imagex_client_load_duration(self, body={}): return self.imagex_post('DescribeImageXClientLoadDuration', [], json.dumps(body)) def describe_imagex_client_load_duration_all(self, body={}): return self.imagex_post('DescribeImageXClientLoadDurationAll', [], json.dumps(body)) def describe_imagex_client_sdk_ver_by_time(self, body={}): return self.imagex_post('DescribeImageXClientSdkVerByTime', [], json.dumps(body)) def describe_imagex_client_file_size(self, body={}): return self.imagex_post('DescribeImageXClientFileSize', [], json.dumps(body)) def describe_imagex_client_top_file_size(self, body={}): return self.imagex_post('DescribeImageXClientTopFileSize', [], json.dumps(body)) def describe_imagex_client_count_by_time(self, body={}): return self.imagex_post('DescribeImageXClientCountByTime', [], json.dumps(body)) def describe_imagex_client_quality_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXClientQualityRateByTime', [], json.dumps(body)) def describe_imagex_client_top_quality_url(self, body={}): return self.imagex_post('DescribeImageXClientTopQualityURL', [], json.dumps(body)) def describe_imagex_client_demotion_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXClientDemotionRateByTime', [], json.dumps(body)) def describe_imagex_client_top_demotion_url(self, body={}): return self.imagex_post('DescribeImageXClientTopDemotionURL', [], json.dumps(body)) def describe_imagex_client_score_by_time(self, body={}): return self.imagex_post('DescribeImageXClientScoreByTime', [], json.dumps(body)) def describe_imagex_sensible_count_by_time(self, body={}): return self.imagex_post('DescribeImageXSensibleCountByTime', [], json.dumps(body)) def describe_imagex_sensible_cache_hit_rate_by_time(self, body={}): return self.imagex_post('DescribeImageXSensibleCacheHitRateByTime', [], json.dumps(body)) def describe_imagex_sensible_top_size_url(self, body={}): return self.imagex_post('DescribeImageXSensibleTopSizeURL', [], json.dumps(body)) def describe_imagex_sensible_top_resolution_url(self, body={}): return self.imagex_post('DescribeImageXSensibleTopResolutionURL', [], json.dumps(body)) def describe_imagex_sensible_top_ram_url(self, body={}): return self.imagex_post('DescribeImageXSensibleTopRamURL', [], json.dumps(body)) def describe_imagex_sensible_top_unknown_url(self, body={}): return self.imagex_post('DescribeImageXSensibleTopUnknownURL', [], json.dumps(body)) def create_batch_process_task(self, query={}, body={}): return self.imagex_post('CreateBatchProcessTask', query, json.dumps(body)) def get_batch_process_result(self, query={}, body={}): return self.imagex_post('GetBatchProcessResult', query, json.dumps(body)) def get_batch_task_info(self, query={}): return self.imagex_get('GetBatchTaskInfo', query) def ai_process(self, query={}, body={}): return self.imagex_post('AIProcess', query, json.dumps(body)) def create_image_ai_task(self, query={}, body={}): return self.imagex_post('CreateImageAITask', query, json.dumps(body)) def create_image_ai_process_queue(self, query={}, body={}): return self.imagex_post('CreateImageAIProcessQueue', query, json.dumps(body)) def delete_image_ai_process_queue(self, query={}, body={}): return self.imagex_post('DeleteImageAIProcessQueue', query, json.dumps(body)) def create_image_ai_process_callback(self, query={}, body={}): return self.imagex_post('CreateImageAIProcessCallback', query, json.dumps(body)) def update_image_ai_process_queue(self, query={}, body={}): return self.imagex_post('UpdateImageAIProcessQueue', query, json.dumps(body)) def update_image_ai_process_queue_status(self, query={}, body={}): return self.imagex_post('UpdateImageAIProcessQueueStatus', query, json.dumps(body)) def delete_image_ai_process_detail(self, query={}, body={}): return self.imagex_post('DeleteImageAIProcessDetail', query, json.dumps(body)) def get_image_ai_process_queues(self, query={}): return self.imagex_get('GetImageAIProcessQueues', query) def get_image_ai_tasks(self, query={}): return self.imagex_get('GetImageAITasks', query) def get_image_ai_details(self, query={}): return self.imagex_get('GetImageAIDetails', query) def update_image_resource_status(self, query={}, body={}): return self.imagex_post('UpdateImageResourceStatus', query, json.dumps(body)) def update_file_storage_class(self, query={}, body={}): return self.imagex_post('UpdateFileStorageClass', query, json.dumps(body)) def get_image_storage_files(self, query={}): return self.imagex_get('GetImageStorageFiles', query) def delete_image_upload_files(self, query={}, body={}): return self.imagex_post('DeleteImageUploadFiles', query, json.dumps(body)) def create_file_restore(self, query={}, body={}): return self.imagex_post('CreateFileRestore', query, json.dumps(body)) def update_image_upload_files(self, query={}, body={}): return self.imagex_post('UpdateImageUploadFiles', query, json.dumps(body)) def commit_image_upload(self, query={}, body={}): return self.imagex_post('CommitImageUpload', query, json.dumps(body)) def update_image_file_ct(self, query={}, body={}): return self.imagex_post('UpdateImageFileCT', query, json.dumps(body)) def apply_vpc_upload_info(self, query={}): return self.imagex_get('ApplyVpcUploadInfo', query) def apply_image_upload(self, query={}): return self.imagex_get('ApplyImageUpload', query) def get_image_upload_file(self, query={}): return self.imagex_get('GetImageUploadFile', query) def get_image_upload_files(self, query={}): return self.imagex_get('GetImageUploadFiles', query) def get_image_update_files(self, query={}): return self.imagex_get('GetImageUpdateFiles', query) def preview_image_upload_file(self, query={}): return self.imagex_get('PreviewImageUploadFile', query) def get_image_erase_result(self, body={}): return self.imagex_post('GetImageEraseResult', [], json.dumps(body)) def get_image_service(self, query={}): return self.imagex_get('GetImageService', query) def get_all_image_services(self, query={}): return self.imagex_get('GetAllImageServices', query) def create_image_compress_task(self, query={}, body={}): return self.imagex_post('CreateImageCompressTask', query, json.dumps(body)) def fetch_image_url(self, body={}): return self.imagex_post('FetchImageUrl', [], json.dumps(body)) def update_image_storage_ttl(self, body={}): return self.imagex_post('UpdateImageStorageTTL', [], json.dumps(body)) def get_compress_task_info(self, query={}): return self.imagex_get('GetCompressTaskInfo', query) def get_url_fetch_task(self, query={}): return self.imagex_get('GetUrlFetchTask', query) def get_resource_url(self, query={}): return self.imagex_get('GetResourceURL', query) def create_image_from_uri(self, query={}, body={}): return self.imagex_post('CreateImageFromUri', query, json.dumps(body)) def update_image_file_key(self, query={}, body={}): return self.imagex_post('UpdateImageFileKey', query, json.dumps(body)) def create_image_content_task(self, query={}, body={}): return self.imagex_post('CreateImageContentTask', query, json.dumps(body)) def get_image_content_task_detail(self, body={}): return self.imagex_post('GetImageContentTaskDetail', [], json.dumps(body)) def get_image_content_block_list(self, query={}, body={}): return self.imagex_post('GetImageContentBlockList', query, json.dumps(body)) def create_image_transcode_queue(self, body={}): return self.imagex_post('CreateImageTranscodeQueue', [], json.dumps(body)) def delete_image_transcode_queue(self, body={}): return self.imagex_post('DeleteImageTranscodeQueue', [], json.dumps(body)) def update_image_transcode_queue(self, body={}): return self.imagex_post('UpdateImageTranscodeQueue', [], json.dumps(body)) def update_image_transcode_queue_status(self, body={}): return self.imagex_post('UpdateImageTranscodeQueueStatus', [], json.dumps(body)) def get_image_transcode_queues(self, query={}): return self.imagex_get('GetImageTranscodeQueues', query) def create_image_transcode_task(self, body={}): return self.imagex_post('CreateImageTranscodeTask', [], json.dumps(body)) def get_image_transcode_details(self, query={}): return self.imagex_get('GetImageTranscodeDetails', query) def create_image_transcode_callback(self, body={}): return self.imagex_post('CreateImageTranscodeCallback', [], json.dumps(body)) def delete_image_transcode_detail(self, body={}): return self.imagex_post('DeleteImageTranscodeDetail', [], json.dumps(body)) def get_image_ps_detection(self, query={}, body={}): return self.imagex_post('GetImagePSDetection', query, json.dumps(body)) def get_image_super_resolution_result(self, body={}): return self.imagex_post('GetImageSuperResolutionResult', [], json.dumps(body)) def get_denoising_image(self, query={}, body={}): return self.imagex_post('GetDenoisingImage', query, json.dumps(body)) def get_image_duplicate_detection(self, query={}, body={}): return self.imagex_post('GetImageDuplicateDetection', query, json.dumps(body)) def get_image_ocr_v2(self, query={}, body={}): return self.imagex_post('GetImageOCRV2', query, json.dumps(body)) def get_image_bg_fill_result(self, body={}): return self.imagex_post('GetImageBgFillResult', [], json.dumps(body)) def get_segment_image(self, query={}, body={}): return self.imagex_post('GetSegmentImage', query, json.dumps(body)) def get_image_smart_crop_result(self, body={}): return self.imagex_post('GetImageSmartCropResult', [], json.dumps(body)) def get_image_comic_result(self, body={}): return self.imagex_post('GetImageComicResult', [], json.dumps(body)) def get_image_enhance_result(self, body={}): return self.imagex_post('GetImageEnhanceResult', [], json.dumps(body)) def get_image_quality(self, query={}, body={}): return self.imagex_post('GetImageQuality', query, json.dumps(body)) def get_license_plate_detection(self, query={}, body={}): return self.imagex_post('GetLicensePlateDetection', query, json.dumps(body)) def get_private_image_type(self, query={}, body={}): return self.imagex_post('GetPrivateImageType', query, json.dumps(body)) def create_cv_image_generate_task(self, query={}, body={}): return self.imagex_post('CreateCVImageGenerateTask', query, json.dumps(body)) def create_hidden_watermark_image(self, query={}, body={}): return self.imagex_post('CreateHiddenWatermarkImage', query, json.dumps(body)) def create_hm_extract_task(self, query={}, body={}): return self.imagex_post('CreateHmExtractTask', query, json.dumps(body)) def update_image_exif_data(self, query={}, body={}): return self.imagex_post('UpdateImageExifData', query, json.dumps(body)) def get_image_detect_result(self, query={}, body={}): return self.imagex_post('GetImageDetectResult', query, json.dumps(body)) def get_cv_image_generate_result(self, query={}, body={}): return self.imagex_post('GetCVImageGenerateResult', query, json.dumps(body)) def create_image_hm_extract(self, query={}, body={}): return self.imagex_post('CreateImageHmExtract', query, json.dumps(body)) def get_cv_text_generate_image(self, query={}, body={}): return self.imagex_post('GetCVTextGenerateImage', query, json.dumps(body)) def get_cv_image_generate_task(self, query={}, body={}): return self.imagex_post('GetCVImageGenerateTask', query, json.dumps(body)) def create_image_hm_embed(self, body={}): return self.imagex_post('CreateImageHmEmbed', [], json.dumps(body)) def get_cv_anime_generate_image(self, query={}, body={}): return self.imagex_post('GetCVAnimeGenerateImage', query, json.dumps(body)) def get_comprehensive_enhance_image(self, body={}): return self.imagex_post('GetComprehensiveEnhanceImage', [], json.dumps(body)) def get_image_ai_generate_task(self, query={}): return self.imagex_get('GetImageAiGenerateTask', query) def get_product_aigc_result(self, query={}, body={}): return self.imagex_post('GetProductAIGCResult', query, json.dumps(body)) def get_image_erase_models(self, query={}): return self.imagex_get('GetImageEraseModels', query) def get_dedup_task_status(self, query={}): return self.imagex_get('GetDedupTaskStatus', query) def get_image_hm_extract_task_info(self, query={}, body={}): return self.imagex_post('GetImageHmExtractTaskInfo', query, json.dumps(body)) def create_image_service(self, body={}): return self.imagex_post('CreateImageService', [], json.dumps(body)) def delete_image_service(self, query={}, body={}): return self.imagex_post('DeleteImageService', query, json.dumps(body)) def update_image_auth_key(self, query={}, body={}): return self.imagex_post('UpdateImageAuthKey', query, json.dumps(body)) def update_res_event_rule(self, query={}, body={}): return self.imagex_post('UpdateResEventRule', query, json.dumps(body)) def update_service_name(self, query={}, body={}): return self.imagex_post('UpdateServiceName', query, json.dumps(body)) def update_storage_rules(self, query={}, body={}): return self.imagex_post('UpdateStorageRules', query, json.dumps(body)) def update_storage_rules_v_2(self, query={}, body={}): return self.imagex_post('UpdateStorageRulesV2', query, json.dumps(body)) def update_image_object_access(self, query={}, body={}): return self.imagex_post('UpdateImageObjectAccess', query, json.dumps(body)) def update_image_upload_overwrite(self, query={}, body={}): return self.imagex_post('UpdateImageUploadOverwrite', query, json.dumps(body)) def update_image_mirror_conf(self, query={}, body={}): return self.imagex_post('UpdateImageMirrorConf', query, json.dumps(body)) def get_image_service_subscription(self, query={}): return self.imagex_get('GetImageServiceSubscription', query) def get_image_auth_key(self, query={}): return self.imagex_get('GetImageAuthKey', query) def create_image_analyze_task(self, body={}): return self.imagex_post('CreateImageAnalyzeTask', [], json.dumps(body)) def delete_image_analyze_task_run(self, body={}): return self.imagex_post('DeleteImageAnalyzeTaskRun', [], json.dumps(body)) def delete_image_analyze_task(self, body={}): return self.imagex_post('DeleteImageAnalyzeTask', [], json.dumps(body)) def update_image_analyze_task_status(self, body={}): return self.imagex_post('UpdateImageAnalyzeTaskStatus', [], json.dumps(body)) def update_image_analyze_task(self, body={}): return self.imagex_post('UpdateImageAnalyzeTask', [], json.dumps(body)) def get_image_analyze_tasks(self, query={}): return self.imagex_get('GetImageAnalyzeTasks', query) def get_image_analyze_result(self, query={}): return self.imagex_get('GetImageAnalyzeResult', query) def delete_image_elements(self, query={}, body={}): return self.imagex_post('DeleteImageElements', query, json.dumps(body)) def delete_image_background_colors(self, query={}, body={}): return self.imagex_post('DeleteImageBackgroundColors', query, json.dumps(body)) def delete_image_style(self, query={}, body={}): return self.imagex_post('DeleteImageStyle', query, json.dumps(body)) def create_image_style(self, query={}, body={}): return self.imagex_post('CreateImageStyle', query, json.dumps(body)) def update_image_style_meta(self, query={}, body={}): return self.imagex_post('UpdateImageStyleMeta', query, json.dumps(body)) def add_image_elements(self, query={}, body={}): return self.imagex_post('AddImageElements', query, json.dumps(body)) def add_image_background_colors(self, query={}, body={}): return self.imagex_post('AddImageBackgroundColors', query, json.dumps(body)) def update_image_style(self, query={}, body={}): return self.imagex_post('UpdateImageStyle', query, json.dumps(body)) def get_image_fonts(self, query={}): return self.imagex_get('GetImageFonts', query) def get_image_elements(self, query={}): return self.imagex_get('GetImageElements', query) def get_image_background_colors(self, query={}): return self.imagex_get('GetImageBackgroundColors', query) def get_image_styles(self, query={}): return self.imagex_get('GetImageStyles', query) def get_image_style_detail(self, query={}): return self.imagex_get('GetImageStyleDetail', query) def get_image_style_result(self, query={}, body={}): return self.imagex_post('GetImageStyleResult', query, json.dumps(body)) def download_cert(self, query={}): return self.imagex_get('DownloadCert', query) def get_image_all_domain_cert(self, query={}): return self.imagex_get('GetImageAllDomainCert', query) def get_cert_info(self, query={}): return self.imagex_get('GetCertInfo', query) def get_all_certs(self, query={}): return self.imagex_get('GetAllCerts', query) def create_image_template(self, query={}, body={}): return self.imagex_post('CreateImageTemplate', query, json.dumps(body)) def delete_templates_from_bin(self, query={}, body={}): return self.imagex_post('DeleteTemplatesFromBin', query, json.dumps(body)) def delete_image_template(self, query={}, body={}): return self.imagex_post('DeleteImageTemplate', query, json.dumps(body)) def create_image_templates_by_import(self, query={}, body={}): return self.imagex_post('CreateImageTemplatesByImport', query, json.dumps(body)) def create_templates_from_bin(self, query={}, body={}): return self.imagex_post('CreateTemplatesFromBin', query, json.dumps(body)) def get_image_template(self, query={}): return self.imagex_get('GetImageTemplate', query) def get_templates_from_bin(self, query={}): return self.imagex_get('GetTemplatesFromBin', query) def get_all_image_templates(self, query={}): return self.imagex_get('GetAllImageTemplates', query) def create_image_audit_task(self, body={}): return self.imagex_post('CreateImageAuditTask', [], json.dumps(body)) def create_video_audit_task(self, query={}, body={}): return self.imagex_post('CreateVideoAuditTask', query, json.dumps(body)) def create_audio_audit_task(self, query={}, body={}): return self.imagex_post('CreateAudioAuditTask', query, json.dumps(body)) def delete_image_audit_result(self, body={}): return self.imagex_post('DeleteImageAuditResult', [], json.dumps(body)) def get_sync_audit_result(self, query={}, body={}): return self.imagex_post('GetSyncAuditResult', query, json.dumps(body)) def single_image_audit(self, query={}, body={}): return self.imagex_post('SingleImageAudit', query, json.dumps(body)) def batch_image_audit(self, query={}, body={}): return self.imagex_post('BatchImageAudit', query, json.dumps(body)) def update_image_audit_task_status(self, body={}): return self.imagex_post('UpdateImageAuditTaskStatus', [], json.dumps(body)) def update_image_audit_task(self, body={}): return self.imagex_post('UpdateImageAuditTask', [], json.dumps(body)) def update_audit_image_status(self, body={}): return self.imagex_post('UpdateAuditImageStatus', [], json.dumps(body)) def update_video_audit_task(self, query={}, body={}): return self.imagex_post('UpdateVideoAuditTask', query, json.dumps(body)) def update_audio_audit_task(self, query={}, body={}): return self.imagex_post('UpdateAudioAuditTask', query, json.dumps(body)) def get_image_audit_tasks(self, query={}): return self.imagex_get('GetImageAuditTasks', query) def get_image_audit_task_result(self, query={}): return self.imagex_get('GetImageAuditTaskResult', query) def get_image_audit_result(self, query={}): return self.imagex_get('GetImageAuditResult', query) def get_audit_entrys_count(self, query={}): return self.imagex_get('GetAuditEntrysCount', query) def get_video_audit_result(self, query={}): return self.imagex_get('GetVideoAuditResult', query) def get_audio_audit_result(self, query={}): return self.imagex_get('GetAudioAuditResult', query) def create_image_retry_audit_task(self, body={}): return self.imagex_post('CreateImageRetryAuditTask', [], json.dumps(body)) ================================================ FILE: volcengine/imagex/v2/upload.py ================================================ # coding:utf-8 import json import os import threading from volcengine.const.Const import * from volcengine.util.Util import * from volcengine.Policy import * from volcengine.imagex.v2.const import * from retry import retry from urllib.parse import quote try: import queue except ImportError: import Queue as queue class Uploader: def __init__( self, imagex_service, host, store_infos=None, file_paths_or_bytes=None, params=None ): if store_infos is None: store_infos = [] if file_paths_or_bytes is None: file_paths_or_bytes = [] if params is None: params = {} self.imagex_service = imagex_service self.host = host self.store_infos = store_infos self.file_paths_or_bytes = file_paths_or_bytes self.content_types = params.get("ContentTypes", []) self.storage_classes = params.get("StorageClasses", []) self.upload_host = params.get("UploadHost", "") if self.upload_host != "": self.host = self.upload_host self.queue = queue.Queue() self.queue_lock = threading.Lock() self.successOids = [] self.results = [] for i in range(len(store_infos)): self.queue.put(i) def async_upload(self): while not self.queue.empty(): self.queue_lock.acquire() if self.queue.empty(): self.queue_lock.release() break idx = self.queue.get() self.queue_lock.release() store_info = self.store_infos[idx] file_paths_or_bytes = self.file_paths_or_bytes[idx] param = {} if len(self.content_types) > idx: param["ContentType"] = self.content_types[idx] if len(self.storage_classes) > idx: param["StorageClass"] = self.storage_classes[idx] try: if isinstance(file_paths_or_bytes, bytes): self.upload_by_host(store_info, file_paths_or_bytes, param) elif isinstance(file_paths_or_bytes, str): file_path = file_paths_or_bytes file_size = os.path.getsize(file_path) data = open(file_path, "rb") if file_size < MinChunkSize: self.upload_by_host(store_info, data.read(), param) elif file_size > LargeFileSize or self.upload_host != "": self.chunk_upload(store_info, data, file_size, True, param) else: self.chunk_upload(store_info, data, file_size, False, param) data.close() else: raise Exception("Uploader only accept bytes or path data") self.successOids.append(store_info["StoreUri"]) self.results.append( { "Uri": store_info["StoreUri"], "UriStatus": 2000, } ) except Exception as e: self.results.append( { "Uri": store_info["StoreUri"], "UriStatus": 2001, "Error": e, } ) @retry(tries=3, delay=1, backoff=2) def upload_by_host(self, store_info, img_data, param=None): if param is None: param = {} url = "https://{}/{}".format(self.host, quote(store_info["StoreUri"])) check_sum = crc32(img_data) & 0xFFFFFFFF check_sum = "%08x" % check_sum headers = {"Content-CRC32": check_sum, "Authorization": store_info["Auth"]} if param.get("ContentType", "") != "": headers["Specified-Content-Type"] = param["ContentType"] if param.get("StorageClass", "") != "": headers["X-VeImageX-Storage-Class"] = param["StorageClass"] upload_status, resp = self.imagex_service.put_data(url, img_data, headers) if not upload_status: raise Exception( "upload by host: upload url %s status false, resp: %s" % (url, resp) ) def chunk_upload(self, store_info, f, size, is_large_file, param=None): if param is None: param = {} upload_id = self.init_upload_part(store_info, is_large_file, param) n = size // MinChunkSize last_num = n - 1 parts = [] for i in range(0, last_num): data = f.read(MinChunkSize) part_number = i if is_large_file: part_number = i + 1 part = self.upload_part( store_info, upload_id, part_number, data, is_large_file ) parts.append(part) data = f.read() if is_large_file: last_num = last_num + 1 part = self.upload_part(store_info, upload_id, last_num, data, is_large_file) parts.append(part) return self.upload_merge_part(store_info, upload_id, parts, is_large_file, param) @retry(tries=3, delay=1, backoff=2) def init_upload_part(self, store_info, is_large_file, param=None): if param is None: param = {} url = "https://{}/{}?uploads".format(self.host, quote(store_info["StoreUri"])) headers = {"Authorization": store_info["Auth"]} if is_large_file: headers["X-Storage-Mode"] = "gateway" if param.get("ContentType", "") != "": headers["Specified-Content-Type"] = param["ContentType"] if param.get("StorageClass", "") != "": headers["X-VeImageX-Storage-Class"] = param["StorageClass"] upload_status, resp = self.imagex_service.put_data(url, None, headers) resp = json.loads(resp) if not upload_status: raise Exception("init upload error") if resp.get("success") is None or resp["success"] != 0: raise Exception("init upload error") return resp["payload"]["uploadID"] @retry(tries=3, delay=1, backoff=2) def upload_part(self, store_info, upload_id, part_number, data, is_large_file): url = "https://{}/{}?partNumber={}&uploadID={}".format( self.host, quote(store_info["StoreUri"]), part_number, upload_id ) check_sum = crc32(data) & 0xFFFFFFFF check_sum = "%08x" % check_sum headers = {"Content-CRC32": check_sum, "Authorization": store_info["Auth"]} if is_large_file: headers["X-Storage-Mode"] = "gateway" upload_status, resp = self.imagex_service.put_data(url, data, headers) if not upload_status: raise Exception(url + json.dumps(resp)) resp = json.loads(resp) if resp.get("success") is None or resp["success"] != 0: raise Exception("upload part error") return check_sum # noinspection DuplicatedCode @staticmethod def generate_merge_body(check_sum_list): if len(check_sum_list) == 0: raise Exception("crc32 list empty") s = [] for i in range(len(check_sum_list)): s.append("{}:{}".format(i, check_sum_list[i])) comma = "," return comma.join(s) @retry(tries=3, delay=1, backoff=2) def upload_merge_part(self, store_info, upload_id, check_sum_list, is_large_file, param=None): if param is None: param = {} url = "https://{}/{}?uploadID={}".format( self.host, quote(store_info["StoreUri"]), upload_id ) data = self.generate_merge_body(check_sum_list) headers = {"Authorization": store_info["Auth"]} if is_large_file: headers["X-Storage-Mode"] = "gateway" if param.get("ContentType", "") != "": headers["Specified-Content-Type"] = param["ContentType"] if param.get("StorageClass", "") != "": headers["X-VeImageX-Storage-Class"] = param["StorageClass"] upload_status, resp = self.imagex_service.put_data(url, data, headers) resp = json.loads(resp) if not upload_status: raise Exception("init upload error") if resp.get("success") is None or resp["success"] != 0: raise Exception("init upload error") ================================================ FILE: volcengine/imp/ImpService.py ================================================ # Code generated by protoc-gen-volcengine-sdk # source: ImpService # DO NOT EDIT! # coding:utf-8 from __future__ import print_function from volcengine.Policy import * from google.protobuf.json_format import * from volcengine.imp.ImpServiceConfig import ImpServiceConfig from retry import retry from zlib import crc32 import os import sys import time import datetime from volcengine.util.Util import Util from volcengine.imp.models.request.request_imp_pb2 import * from volcengine.imp.models.response.response_imp_pb2 import * MinChunkSize = 1024 * 1024 * 20 LargeFileSize = 1024 * 1024 * 1024 # # Generated from protobuf service ImpService # class ImpService(ImpServiceConfig): # # SubmitJob. # # @param request ImpSubmitJobRequest # @return ImpSubmitJobResponse # @raise Exception def submit_job(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("SubmitJob", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), ImpSubmitJobResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, ImpSubmitJobResponse(), True) # # KillJob. # # @param request ImpKillJobRequest # @return ImpKillJobResponse # @raise Exception def kill_job(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("KillJob", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), ImpKillJobResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, ImpKillJobResponse(), True) # # RetrieveJob. # # @param request ImpRetrieveJobRequest # @return ImpRetrieveJobResponse # @raise Exception def retrieve_job(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("RetrieveJob", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), ImpRetrieveJobResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, ImpRetrieveJobResponse(), True) ================================================ FILE: volcengine/imp/ImpServiceConfig.py ================================================ # coding:utf-8 from __future__ import print_function import threading from zlib import crc32 from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service class ImpServiceConfig(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): with cls._instance_lock: if not hasattr(cls, "_instance"): cls._instance = object.__new__(cls) return cls._instance def __init__(self, region='cn-north-1'): self.service_info = ImpServiceConfig.get_service_info(region) self.api_info = ImpServiceConfig.get_api_info() self.domain_cache = {} self.fallback_domain_weights = {} self.update_interval = 10 self.lock = threading.Lock() super(ImpServiceConfig, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("imp.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'imp', 'cn-north-1'), 10, 10), } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info @staticmethod def get_api_info(): api_info = { "SubmitJob": ApiInfo("GET", "/", {"Action": "SubmitJob", "Version": "2021-06-11"}, {}, {}), "KillJob": ApiInfo("GET", "/", {"Action": "KillJob", "Version": "2021-06-11"}, {}, {}), "RetrieveJob": ApiInfo("GET", "/", {"Action": "RetrieveJob", "Version": "2021-06-11"}, {}, {}), } return api_info @staticmethod def crc32(file_path): prev = 0 for eachLine in open(file_path, "rb"): prev = crc32(eachLine, prev) return prev & 0xFFFFFFFF ================================================ FILE: volcengine/imp/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/base/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/base/base_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: base/base.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='base/base.proto', package='Volcengine.Vod.Models.Base', syntax='proto3', serialized_options=b'\n%com.volcengine.service.vod.model.baseB\004BaseP\001Z=github.com/volcengine/volc-sdk-golang/service/vod/models/base\240\001\001\330\001\001\302\002\000\312\002\034Volc\\Service\\Vod\\Models\\Base\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x0f\x62\x61se/base.proto\x12\x1aVolcengine.Vod.Models.Base\x1a google/protobuf/descriptor.proto\"\xa1\x01\n\x10ResponseMetadata\x12\x11\n\tRequestId\x18\x01 \x01(\t\x12\x0e\n\x06\x41\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07Version\x18\x03 \x01(\t\x12\x0f\n\x07Service\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\x38\n\x05\x45rror\x18\x06 \x01(\x0b\x32).Volcengine.Vod.Models.Base.ResponseError\".\n\rResponseError\x12\x0c\n\x04\x43ode\x18\x01 \x01(\t\x12\x0f\n\x07Message\x18\x02 \x01(\tB\xbc\x01\n%com.volcengine.service.vod.model.baseB\x04\x42\x61seP\x01Z=github.com/volcengine/volc-sdk-golang/service/vod/models/base\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02\x1cVolc\\Service\\Vod\\Models\\Base\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3' , dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) _RESPONSEMETADATA = _descriptor.Descriptor( name='ResponseMetadata', full_name='Volcengine.Vod.Models.Base.ResponseMetadata', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='RequestId', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.RequestId', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Action', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.Action', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Version', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.Version', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Service', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.Service', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Region', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.Region', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Error', full_name='Volcengine.Vod.Models.Base.ResponseMetadata.Error', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=82, serialized_end=243, ) _RESPONSEERROR = _descriptor.Descriptor( name='ResponseError', full_name='Volcengine.Vod.Models.Base.ResponseError', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='Code', full_name='Volcengine.Vod.Models.Base.ResponseError.Code', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='Message', full_name='Volcengine.Vod.Models.Base.ResponseError.Message', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=245, serialized_end=291, ) _RESPONSEMETADATA.fields_by_name['Error'].message_type = _RESPONSEERROR DESCRIPTOR.message_types_by_name['ResponseMetadata'] = _RESPONSEMETADATA DESCRIPTOR.message_types_by_name['ResponseError'] = _RESPONSEERROR _sym_db.RegisterFileDescriptor(DESCRIPTOR) ResponseMetadata = _reflection.GeneratedProtocolMessageType('ResponseMetadata', (_message.Message,), { 'DESCRIPTOR' : _RESPONSEMETADATA, '__module__' : 'base.base_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Base.ResponseMetadata) }) _sym_db.RegisterMessage(ResponseMetadata) ResponseError = _reflection.GeneratedProtocolMessageType('ResponseError', (_message.Message,), { 'DESCRIPTOR' : _RESPONSEERROR, '__module__' : 'base.base_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Base.ResponseError) }) _sym_db.RegisterMessage(ResponseError) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/imp/models/business/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/business/imp_common_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: imp/business/imp_common.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dimp/business/imp_common.proto\x12\x1eVolcengine.Imp.Models.Business\"R\n\tInputPath\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12\x11\n\tTosBucket\x18\x02 \x01(\t\x12\x14\n\x0cVodSpaceName\x18\x03 \x01(\t\x12\x0e\n\x06\x46ileId\x18\x04 \x01(\t\"y\n\x05Input\x12<\n\tInputPath\x18\x01 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12\x32\n\x04\x43lip\x18\x02 \x01(\x0b\x32$.Volcengine.Imp.Models.Business.Clip\"*\n\x04\x43lip\x12\x11\n\tStartTime\x18\x01 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\x05\"\xc8\x01\n\tJobOutput\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x12\n\nProperties\x18\x02 \x01(\t\x12\x0c\n\x04\x43ode\x18\x03 \x01(\t\x12\x15\n\rFileMessageId\x18\x04 \x01(\t\x12\x10\n\x08TaskType\x18\x05 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\x12\x12\n\nActivityId\x18\x07 \x01(\t\x12\x11\n\tStartTime\x18\x08 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\t \x01(\t\x12\x14\n\x0cTemplateName\x18\n \x01(\t\"\xaf\x03\n\x0cJobExecution\x12\r\n\x05JobId\x18\x01 \x01(\t\x12<\n\tInputPath\x18\x02 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12\x39\n\x06Output\x18\x03 \x03(\x0b\x32).Volcengine.Imp.Models.Business.JobOutput\x12\x0e\n\x06Status\x18\x04 \x01(\t\x12\x11\n\tCreatedAt\x18\x05 \x01(\t\x12\x12\n\nFinishedAt\x18\x06 \x01(\t\x12\x12\n\nTemplateId\x18\x07 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x08 \x01(\t\x12\x11\n\tJobSource\x18\t \x01(\t\x12\x30\n\x03Job\x18\n \x01(\x0b\x32#.Volcengine.Imp.Models.Business.Job\x12\x13\n\x0b\x43\x61llbackUri\x18\x0b \x01(\t\x12\x1b\n\x13\x43\x61llbackContentType\x18\x0c \x01(\t\x12:\n\x0bMultiInputs\x18\r \x03(\x0b\x32%.Volcengine.Imp.Models.Business.Input\"P\n\x06Params\x12\x46\n\x0eOverrideParams\x18\x01 \x01(\x0b\x32..Volcengine.Imp.Models.Business.OverrideParams\"\xf8\x01\n\x0eOverrideParams\x12L\n\nSmartErase\x18\x01 \x03(\x0b\x32\x38.Volcengine.Imp.Models.Business.SmartEraseOverrideParams\x12\x44\n\x06Output\x18\x02 \x03(\x0b\x32\x34.Volcengine.Imp.Models.Business.OutputOverrideParams\x12R\n\rSmartEmoticon\x18\x03 \x03(\x0b\x32;.Volcengine.Imp.Models.Business.SmartEmoticonOverrideParams\"\x9e\x01\n\x18SmartEraseOverrideParams\x12\x12\n\nActivityId\x18\x01 \x03(\t\x12<\n\tWatermark\x18\x02 \x01(\x0b\x32).Volcengine.Imp.Models.Business.Watermark\x12\x30\n\x03OCR\x18\x03 \x01(\x0b\x32#.Volcengine.Imp.Models.Business.OCR\"K\n\tWatermark\x12>\n\nDetectRect\x18\x01 \x03(\x0b\x32*.Volcengine.Imp.Models.Business.DetectRect\"E\n\x03OCR\x12>\n\nDetectRect\x18\x01 \x03(\x0b\x32*.Volcengine.Imp.Models.Business.DetectRect\"<\n\nDetectRect\x12\n\n\x02X1\x18\x01 \x01(\x01\x12\n\n\x02Y1\x18\x02 \x01(\x01\x12\n\n\x02X2\x18\x03 \x01(\x01\x12\n\n\x02Y2\x18\x04 \x01(\x01\"j\n\x14OutputOverrideParams\x12\x12\n\nActivityId\x18\x01 \x03(\t\x12>\n\nOutputPath\x18\x02 \x01(\x0b\x32*.Volcengine.Imp.Models.Business.OutputPath\"\xfd\x01\n\x1bSmartEmoticonOverrideParams\x12\x12\n\nActivityId\x18\x01 \x03(\t\x12>\n\x0b\x44rivenVideo\x18\x02 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12>\n\x0b\x44rivenAudio\x18\x03 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12J\n\x10\x44rivenTextParams\x18\x04 \x01(\x0b\x32\x30.Volcengine.Imp.Models.Business.DrivenTextParams\"d\n\x10\x44rivenTextParams\x12\x12\n\nDrivenText\x18\x01 \x01(\t\x12<\n\tTTSParams\x18\x02 \x01(\x0b\x32).Volcengine.Imp.Models.Business.TTSParams\"\x1e\n\tTTSParams\x12\x11\n\tVoiceType\x18\x01 \x01(\t\"U\n\nOutputPath\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12\x11\n\tTosBucket\x18\x02 \x01(\t\x12\x14\n\x0cVodSpaceName\x18\x03 \x01(\t\x12\x10\n\x08\x46ileName\x18\x04 \x01(\t\"\x8b\x01\n\x03Job\x12I\n\x0eTranscodeVideo\x18\x01 \x01(\x0b\x32\x31.Volcengine.Imp.Models.Business.TranscodeVideoJob\x12\x39\n\x06\x42yteHD\x18\x02 \x01(\x0b\x32).Volcengine.Imp.Models.Business.ByteHDJob\"\xcc\x02\n\x11TranscodeVideoJob\x12\x11\n\tContainer\x18\x01 \x01(\t\x12\x34\n\x05Video\x18\x02 \x01(\x0b\x32%.Volcengine.Imp.Models.Business.Video\x12\x34\n\x05\x41udio\x18\x03 \x01(\x0b\x32%.Volcengine.Imp.Models.Business.Audio\x12\x13\n\x0b\x45nableRemux\x18\x04 \x01(\x08\x12\x14\n\x0c\x44isableVideo\x18\x05 \x01(\x08\x12\x14\n\x0c\x44isableAudio\x18\x06 \x01(\x08\x12\x38\n\x07Segment\x18\x07 \x01(\x0b\x32\'.Volcengine.Imp.Models.Business.Segment\x12=\n\x05Logos\x18\x08 \x03(\x0b\x32..Volcengine.Imp.Models.Business.LogoDefinition\"\x83\x02\n\tByteHDJob\x12\x11\n\tContainer\x18\x01 \x01(\t\x12\x34\n\x05Video\x18\x02 \x01(\x0b\x32%.Volcengine.Imp.Models.Business.Video\x12\x34\n\x05\x41udio\x18\x03 \x01(\x0b\x32%.Volcengine.Imp.Models.Business.Audio\x12\x38\n\x07Segment\x18\x04 \x01(\x0b\x32\'.Volcengine.Imp.Models.Business.Segment\x12=\n\x05Logos\x18\x05 \x03(\x0b\x32..Volcengine.Imp.Models.Business.LogoDefinition\"\xd5\x01\n\x05Video\x12\r\n\x05\x43odec\x18\x01 \x01(\t\x12\x11\n\tScaleType\x18\x02 \x01(\x05\x12\x12\n\nScaleWidth\x18\x03 \x01(\x05\x12\x13\n\x0bScaleHeight\x18\x04 \x01(\x05\x12\x12\n\nScaleShort\x18\x05 \x01(\x05\x12\x11\n\tScaleLong\x18\x06 \x01(\x05\x12\x0f\n\x07\x42itrate\x18\x07 \x01(\x05\x12\x0e\n\x06MaxFps\x18\x08 \x01(\x05\x12\x10\n\x03\x43rf\x18\t \x01(\x05H\x00\x88\x01\x01\x12\x0f\n\x07Profile\x18\n \x01(\t\x12\x0e\n\x06PixFmt\x18\x0b \x01(\tB\x06\n\x04_Crf\"\x9c\x01\n\x06Volume\x12\x0e\n\x06Method\x18\x01 \x01(\t\x12\x1f\n\x12IntegratedLoudness\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\x08TruePeak\x18\x03 \x01(\x01H\x01\x88\x01\x01\x12\x17\n\nVolumeTime\x18\x04 \x01(\x01H\x02\x88\x01\x01\x42\x15\n\x13_IntegratedLoudnessB\x0b\n\t_TruePeakB\r\n\x0b_VolumeTime\"\x96\x01\n\x05\x41udio\x12\r\n\x05\x43odec\x18\x01 \x01(\t\x12\x0f\n\x07Profile\x18\x02 \x01(\t\x12\x12\n\nSampleRate\x18\x03 \x01(\x05\x12\x0f\n\x07\x42itrate\x18\x04 \x01(\x05\x12\x10\n\x08\x43hannels\x18\x05 \x01(\x05\x12\x36\n\x06Volume\x18\x06 \x01(\x0b\x32&.Volcengine.Imp.Models.Business.Volume\"9\n\x07Segment\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x0c\n\x04Type\x18\x02 \x01(\t\x12\x10\n\x08\x44uration\x18\x03 \x01(\x05\"\xbc\x02\n\x0eLogoDefinition\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12N\n\x12TextLogoDefinition\x18\x02 \x01(\x0b\x32\x32.Volcengine.Imp.Models.Business.TextLogoDefinition\x12P\n\x13ImageLogoDefinition\x18\x03 \x01(\x0b\x32\x33.Volcengine.Imp.Models.Business.ImageLogoDefinition\x12>\n\x08Position\x18\x04 \x01(\x0b\x32,.Volcengine.Imp.Models.Business.LogoPosition\x12:\n\x08TimeLine\x18\x05 \x01(\x0b\x32(.Volcengine.Imp.Models.Business.TimeLine\"\\\n\x12TextLogoDefinition\x12\x0f\n\x07\x43ontent\x18\x01 \x01(\t\x12\x10\n\x08\x46ontType\x18\x02 \x01(\t\x12\x10\n\x08\x46ontSize\x18\x03 \x01(\x05\x12\x11\n\tFontColor\x18\x04 \x01(\t\"\x8e\x01\n\x13ImageLogoDefinition\x12:\n\x07\x43ontent\x18\x01 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12\x11\n\tLoopTimes\x18\x02 \x01(\x05\x12\x12\n\nRepeatLast\x18\x03 \x01(\x08\x12\x14\n\x0cTransparency\x18\x04 \x01(\x05\"X\n\x0cLogoPosition\x12\x0c\n\x04PosX\x18\x01 \x01(\t\x12\x0c\n\x04PosY\x18\x02 \x01(\t\x12\r\n\x05SizeX\x18\x04 \x01(\t\x12\r\n\x05SizeY\x18\x05 \x01(\t\x12\x0e\n\x06Locate\x18\x06 \x01(\t\".\n\x08TimeLine\x12\x11\n\tStartTime\x18\x01 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\x05\x42\xcc\x01\n)com.volcengine.service.imp.model.businessB\x0bImpWorkflowP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/imp/models/business\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Imp\\Models\\Business\xe2\x02#Volc\\Service\\Imp\\Models\\GPBMetadatab\x06proto3') _INPUTPATH = DESCRIPTOR.message_types_by_name['InputPath'] _INPUT = DESCRIPTOR.message_types_by_name['Input'] _CLIP = DESCRIPTOR.message_types_by_name['Clip'] _JOBOUTPUT = DESCRIPTOR.message_types_by_name['JobOutput'] _JOBEXECUTION = DESCRIPTOR.message_types_by_name['JobExecution'] _PARAMS = DESCRIPTOR.message_types_by_name['Params'] _OVERRIDEPARAMS = DESCRIPTOR.message_types_by_name['OverrideParams'] _SMARTERASEOVERRIDEPARAMS = DESCRIPTOR.message_types_by_name['SmartEraseOverrideParams'] _WATERMARK = DESCRIPTOR.message_types_by_name['Watermark'] _OCR = DESCRIPTOR.message_types_by_name['OCR'] _DETECTRECT = DESCRIPTOR.message_types_by_name['DetectRect'] _OUTPUTOVERRIDEPARAMS = DESCRIPTOR.message_types_by_name['OutputOverrideParams'] _SMARTEMOTICONOVERRIDEPARAMS = DESCRIPTOR.message_types_by_name['SmartEmoticonOverrideParams'] _DRIVENTEXTPARAMS = DESCRIPTOR.message_types_by_name['DrivenTextParams'] _TTSPARAMS = DESCRIPTOR.message_types_by_name['TTSParams'] _OUTPUTPATH = DESCRIPTOR.message_types_by_name['OutputPath'] _JOB = DESCRIPTOR.message_types_by_name['Job'] _TRANSCODEVIDEOJOB = DESCRIPTOR.message_types_by_name['TranscodeVideoJob'] _BYTEHDJOB = DESCRIPTOR.message_types_by_name['ByteHDJob'] _VIDEO = DESCRIPTOR.message_types_by_name['Video'] _VOLUME = DESCRIPTOR.message_types_by_name['Volume'] _AUDIO = DESCRIPTOR.message_types_by_name['Audio'] _SEGMENT = DESCRIPTOR.message_types_by_name['Segment'] _LOGODEFINITION = DESCRIPTOR.message_types_by_name['LogoDefinition'] _TEXTLOGODEFINITION = DESCRIPTOR.message_types_by_name['TextLogoDefinition'] _IMAGELOGODEFINITION = DESCRIPTOR.message_types_by_name['ImageLogoDefinition'] _LOGOPOSITION = DESCRIPTOR.message_types_by_name['LogoPosition'] _TIMELINE = DESCRIPTOR.message_types_by_name['TimeLine'] InputPath = _reflection.GeneratedProtocolMessageType('InputPath', (_message.Message,), { 'DESCRIPTOR' : _INPUTPATH, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.InputPath) }) _sym_db.RegisterMessage(InputPath) Input = _reflection.GeneratedProtocolMessageType('Input', (_message.Message,), { 'DESCRIPTOR' : _INPUT, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Input) }) _sym_db.RegisterMessage(Input) Clip = _reflection.GeneratedProtocolMessageType('Clip', (_message.Message,), { 'DESCRIPTOR' : _CLIP, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Clip) }) _sym_db.RegisterMessage(Clip) JobOutput = _reflection.GeneratedProtocolMessageType('JobOutput', (_message.Message,), { 'DESCRIPTOR' : _JOBOUTPUT, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.JobOutput) }) _sym_db.RegisterMessage(JobOutput) JobExecution = _reflection.GeneratedProtocolMessageType('JobExecution', (_message.Message,), { 'DESCRIPTOR' : _JOBEXECUTION, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.JobExecution) }) _sym_db.RegisterMessage(JobExecution) Params = _reflection.GeneratedProtocolMessageType('Params', (_message.Message,), { 'DESCRIPTOR' : _PARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Params) }) _sym_db.RegisterMessage(Params) OverrideParams = _reflection.GeneratedProtocolMessageType('OverrideParams', (_message.Message,), { 'DESCRIPTOR' : _OVERRIDEPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.OverrideParams) }) _sym_db.RegisterMessage(OverrideParams) SmartEraseOverrideParams = _reflection.GeneratedProtocolMessageType('SmartEraseOverrideParams', (_message.Message,), { 'DESCRIPTOR' : _SMARTERASEOVERRIDEPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.SmartEraseOverrideParams) }) _sym_db.RegisterMessage(SmartEraseOverrideParams) Watermark = _reflection.GeneratedProtocolMessageType('Watermark', (_message.Message,), { 'DESCRIPTOR' : _WATERMARK, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Watermark) }) _sym_db.RegisterMessage(Watermark) OCR = _reflection.GeneratedProtocolMessageType('OCR', (_message.Message,), { 'DESCRIPTOR' : _OCR, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.OCR) }) _sym_db.RegisterMessage(OCR) DetectRect = _reflection.GeneratedProtocolMessageType('DetectRect', (_message.Message,), { 'DESCRIPTOR' : _DETECTRECT, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.DetectRect) }) _sym_db.RegisterMessage(DetectRect) OutputOverrideParams = _reflection.GeneratedProtocolMessageType('OutputOverrideParams', (_message.Message,), { 'DESCRIPTOR' : _OUTPUTOVERRIDEPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.OutputOverrideParams) }) _sym_db.RegisterMessage(OutputOverrideParams) SmartEmoticonOverrideParams = _reflection.GeneratedProtocolMessageType('SmartEmoticonOverrideParams', (_message.Message,), { 'DESCRIPTOR' : _SMARTEMOTICONOVERRIDEPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.SmartEmoticonOverrideParams) }) _sym_db.RegisterMessage(SmartEmoticonOverrideParams) DrivenTextParams = _reflection.GeneratedProtocolMessageType('DrivenTextParams', (_message.Message,), { 'DESCRIPTOR' : _DRIVENTEXTPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.DrivenTextParams) }) _sym_db.RegisterMessage(DrivenTextParams) TTSParams = _reflection.GeneratedProtocolMessageType('TTSParams', (_message.Message,), { 'DESCRIPTOR' : _TTSPARAMS, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.TTSParams) }) _sym_db.RegisterMessage(TTSParams) OutputPath = _reflection.GeneratedProtocolMessageType('OutputPath', (_message.Message,), { 'DESCRIPTOR' : _OUTPUTPATH, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.OutputPath) }) _sym_db.RegisterMessage(OutputPath) Job = _reflection.GeneratedProtocolMessageType('Job', (_message.Message,), { 'DESCRIPTOR' : _JOB, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Job) }) _sym_db.RegisterMessage(Job) TranscodeVideoJob = _reflection.GeneratedProtocolMessageType('TranscodeVideoJob', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEVIDEOJOB, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.TranscodeVideoJob) }) _sym_db.RegisterMessage(TranscodeVideoJob) ByteHDJob = _reflection.GeneratedProtocolMessageType('ByteHDJob', (_message.Message,), { 'DESCRIPTOR' : _BYTEHDJOB, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.ByteHDJob) }) _sym_db.RegisterMessage(ByteHDJob) Video = _reflection.GeneratedProtocolMessageType('Video', (_message.Message,), { 'DESCRIPTOR' : _VIDEO, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Video) }) _sym_db.RegisterMessage(Video) Volume = _reflection.GeneratedProtocolMessageType('Volume', (_message.Message,), { 'DESCRIPTOR' : _VOLUME, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Volume) }) _sym_db.RegisterMessage(Volume) Audio = _reflection.GeneratedProtocolMessageType('Audio', (_message.Message,), { 'DESCRIPTOR' : _AUDIO, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Audio) }) _sym_db.RegisterMessage(Audio) Segment = _reflection.GeneratedProtocolMessageType('Segment', (_message.Message,), { 'DESCRIPTOR' : _SEGMENT, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.Segment) }) _sym_db.RegisterMessage(Segment) LogoDefinition = _reflection.GeneratedProtocolMessageType('LogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _LOGODEFINITION, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.LogoDefinition) }) _sym_db.RegisterMessage(LogoDefinition) TextLogoDefinition = _reflection.GeneratedProtocolMessageType('TextLogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _TEXTLOGODEFINITION, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.TextLogoDefinition) }) _sym_db.RegisterMessage(TextLogoDefinition) ImageLogoDefinition = _reflection.GeneratedProtocolMessageType('ImageLogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _IMAGELOGODEFINITION, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.ImageLogoDefinition) }) _sym_db.RegisterMessage(ImageLogoDefinition) LogoPosition = _reflection.GeneratedProtocolMessageType('LogoPosition', (_message.Message,), { 'DESCRIPTOR' : _LOGOPOSITION, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.LogoPosition) }) _sym_db.RegisterMessage(LogoPosition) TimeLine = _reflection.GeneratedProtocolMessageType('TimeLine', (_message.Message,), { 'DESCRIPTOR' : _TIMELINE, '__module__' : 'imp.business.imp_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Business.TimeLine) }) _sym_db.RegisterMessage(TimeLine) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.imp.model.businessB\013ImpWorkflowP\001ZAgithub.com/volcengine/volc-sdk-golang/service/imp/models/business\240\001\001\330\001\001\312\002 Volc\\Service\\Imp\\Models\\Business\342\002#Volc\\Service\\Imp\\Models\\GPBMetadata' _INPUTPATH._serialized_start=65 _INPUTPATH._serialized_end=147 _INPUT._serialized_start=149 _INPUT._serialized_end=270 _CLIP._serialized_start=272 _CLIP._serialized_end=314 _JOBOUTPUT._serialized_start=317 _JOBOUTPUT._serialized_end=517 _JOBEXECUTION._serialized_start=520 _JOBEXECUTION._serialized_end=951 _PARAMS._serialized_start=953 _PARAMS._serialized_end=1033 _OVERRIDEPARAMS._serialized_start=1036 _OVERRIDEPARAMS._serialized_end=1284 _SMARTERASEOVERRIDEPARAMS._serialized_start=1287 _SMARTERASEOVERRIDEPARAMS._serialized_end=1445 _WATERMARK._serialized_start=1447 _WATERMARK._serialized_end=1522 _OCR._serialized_start=1524 _OCR._serialized_end=1593 _DETECTRECT._serialized_start=1595 _DETECTRECT._serialized_end=1655 _OUTPUTOVERRIDEPARAMS._serialized_start=1657 _OUTPUTOVERRIDEPARAMS._serialized_end=1763 _SMARTEMOTICONOVERRIDEPARAMS._serialized_start=1766 _SMARTEMOTICONOVERRIDEPARAMS._serialized_end=2019 _DRIVENTEXTPARAMS._serialized_start=2021 _DRIVENTEXTPARAMS._serialized_end=2121 _TTSPARAMS._serialized_start=2123 _TTSPARAMS._serialized_end=2153 _OUTPUTPATH._serialized_start=2155 _OUTPUTPATH._serialized_end=2240 _JOB._serialized_start=2243 _JOB._serialized_end=2382 _TRANSCODEVIDEOJOB._serialized_start=2385 _TRANSCODEVIDEOJOB._serialized_end=2717 _BYTEHDJOB._serialized_start=2720 _BYTEHDJOB._serialized_end=2979 _VIDEO._serialized_start=2982 _VIDEO._serialized_end=3195 _VOLUME._serialized_start=3198 _VOLUME._serialized_end=3354 _AUDIO._serialized_start=3357 _AUDIO._serialized_end=3507 _SEGMENT._serialized_start=3509 _SEGMENT._serialized_end=3566 _LOGODEFINITION._serialized_start=3569 _LOGODEFINITION._serialized_end=3885 _TEXTLOGODEFINITION._serialized_start=3887 _TEXTLOGODEFINITION._serialized_end=3979 _IMAGELOGODEFINITION._serialized_start=3982 _IMAGELOGODEFINITION._serialized_end=4124 _LOGOPOSITION._serialized_start=4126 _LOGOPOSITION._serialized_end=4214 _TIMELINE._serialized_start=4216 _TIMELINE._serialized_end=4262 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/imp/models/request/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/request/request_imp_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: imp/request/request_imp.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.imp.models.business import imp_common_pb2 as imp_dot_business_dot_imp__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dimp/request/request_imp.proto\x12\x1dVolcengine.Imp.Models.Request\x1a\x1dimp/business/imp_common.proto\"\xe2\x03\n\x13ImpSubmitJobRequest\x12<\n\tInputPath\x18\x01 \x01(\x0b\x32).Volcengine.Imp.Models.Business.InputPath\x12\x12\n\nTemplateId\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x04 \x01(\t\x12\x36\n\x06Params\x18\x05 \x01(\x0b\x32&.Volcengine.Imp.Models.Business.Params\x12>\n\nOutputPath\x18\x06 \x01(\x0b\x32*.Volcengine.Imp.Models.Business.OutputPath\x12\x30\n\x03Job\x18\x07 \x01(\x0b\x32#.Volcengine.Imp.Models.Business.Job\x12\x18\n\x0b\x43\x61llbackUri\x18\x08 \x01(\tH\x00\x88\x01\x01\x12 \n\x13\x43\x61llbackContentType\x18\t \x01(\tH\x01\x88\x01\x01\x12:\n\x0bMultiInputs\x18\n \x03(\x0b\x32%.Volcengine.Imp.Models.Business.InputB\x0e\n\x0c_CallbackUriB\x16\n\x14_CallbackContentType\"\"\n\x11ImpKillJobRequest\x12\r\n\x05JobId\x18\x01 \x01(\t\"\'\n\x15ImpRetrieveJobRequest\x12\x0e\n\x06JobIds\x18\x01 \x03(\tB\xc8\x01\n(com.volcengine.service.imp.model.requestB\nImpRequestP\x01Z@github.com/volcengine/volc-sdk-golang/service/imp/models/request\xa0\x01\x01\xd8\x01\x01\xca\x02\x1fVolc\\Service\\Imp\\Models\\Request\xe2\x02#Volc\\Service\\Imp\\Models\\GPBMetadatab\x06proto3') _IMPSUBMITJOBREQUEST = DESCRIPTOR.message_types_by_name['ImpSubmitJobRequest'] _IMPKILLJOBREQUEST = DESCRIPTOR.message_types_by_name['ImpKillJobRequest'] _IMPRETRIEVEJOBREQUEST = DESCRIPTOR.message_types_by_name['ImpRetrieveJobRequest'] ImpSubmitJobRequest = _reflection.GeneratedProtocolMessageType('ImpSubmitJobRequest', (_message.Message,), { 'DESCRIPTOR' : _IMPSUBMITJOBREQUEST, '__module__' : 'imp.request.request_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Request.ImpSubmitJobRequest) }) _sym_db.RegisterMessage(ImpSubmitJobRequest) ImpKillJobRequest = _reflection.GeneratedProtocolMessageType('ImpKillJobRequest', (_message.Message,), { 'DESCRIPTOR' : _IMPKILLJOBREQUEST, '__module__' : 'imp.request.request_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Request.ImpKillJobRequest) }) _sym_db.RegisterMessage(ImpKillJobRequest) ImpRetrieveJobRequest = _reflection.GeneratedProtocolMessageType('ImpRetrieveJobRequest', (_message.Message,), { 'DESCRIPTOR' : _IMPRETRIEVEJOBREQUEST, '__module__' : 'imp.request.request_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Request.ImpRetrieveJobRequest) }) _sym_db.RegisterMessage(ImpRetrieveJobRequest) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n(com.volcengine.service.imp.model.requestB\nImpRequestP\001Z@github.com/volcengine/volc-sdk-golang/service/imp/models/request\240\001\001\330\001\001\312\002\037Volc\\Service\\Imp\\Models\\Request\342\002#Volc\\Service\\Imp\\Models\\GPBMetadata' _IMPSUBMITJOBREQUEST._serialized_start=96 _IMPSUBMITJOBREQUEST._serialized_end=578 _IMPKILLJOBREQUEST._serialized_start=580 _IMPKILLJOBREQUEST._serialized_end=614 _IMPRETRIEVEJOBREQUEST._serialized_start=616 _IMPRETRIEVEJOBREQUEST._serialized_end=655 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/imp/models/response/__init__.py ================================================ ================================================ FILE: volcengine/imp/models/response/response_imp_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: imp/response/response_imp.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.base.models.base import base_pb2 as volcengine_dot_base_dot_base__pb2 from volcengine.imp.models.business import imp_common_pb2 as imp_dot_business_dot_imp__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fimp/response/response_imp.proto\x12\x1eVolcengine.Imp.Models.Response\x1a\x1avolcengine/base/base.proto\x1a\x1dimp/business/imp_common.proto\"o\n\x14ImpSubmitJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x0e\n\x06Result\x18\x02 \x01(\t\"]\n\x12ImpKillJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\x92\x02\n\x16ImpRetrieveJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12R\n\x06Result\x18\x02 \x03(\x0b\x32\x42.Volcengine.Imp.Models.Response.ImpRetrieveJobResponse.ResultEntry\x1a[\n\x0bResultEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.Volcengine.Imp.Models.Business.JobExecution:\x02\x38\x01\x42\xcc\x01\n)com.volcengine.service.imp.model.responseB\x0bImpResponseP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/imp/models/response\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Imp\\Models\\Response\xe2\x02#Volc\\Service\\Imp\\Models\\GPBMetadatab\x06proto3') _IMPSUBMITJOBRESPONSE = DESCRIPTOR.message_types_by_name['ImpSubmitJobResponse'] _IMPKILLJOBRESPONSE = DESCRIPTOR.message_types_by_name['ImpKillJobResponse'] _IMPRETRIEVEJOBRESPONSE = DESCRIPTOR.message_types_by_name['ImpRetrieveJobResponse'] _IMPRETRIEVEJOBRESPONSE_RESULTENTRY = _IMPRETRIEVEJOBRESPONSE.nested_types_by_name['ResultEntry'] ImpSubmitJobResponse = _reflection.GeneratedProtocolMessageType('ImpSubmitJobResponse', (_message.Message,), { 'DESCRIPTOR' : _IMPSUBMITJOBRESPONSE, '__module__' : 'imp.response.response_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Response.ImpSubmitJobResponse) }) _sym_db.RegisterMessage(ImpSubmitJobResponse) ImpKillJobResponse = _reflection.GeneratedProtocolMessageType('ImpKillJobResponse', (_message.Message,), { 'DESCRIPTOR' : _IMPKILLJOBRESPONSE, '__module__' : 'imp.response.response_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Response.ImpKillJobResponse) }) _sym_db.RegisterMessage(ImpKillJobResponse) ImpRetrieveJobResponse = _reflection.GeneratedProtocolMessageType('ImpRetrieveJobResponse', (_message.Message,), { 'ResultEntry' : _reflection.GeneratedProtocolMessageType('ResultEntry', (_message.Message,), { 'DESCRIPTOR' : _IMPRETRIEVEJOBRESPONSE_RESULTENTRY, '__module__' : 'imp.response.response_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Response.ImpRetrieveJobResponse.ResultEntry) }) , 'DESCRIPTOR' : _IMPRETRIEVEJOBRESPONSE, '__module__' : 'imp.response.response_imp_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Imp.Models.Response.ImpRetrieveJobResponse) }) _sym_db.RegisterMessage(ImpRetrieveJobResponse) _sym_db.RegisterMessage(ImpRetrieveJobResponse.ResultEntry) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.imp.model.responseB\013ImpResponseP\001ZAgithub.com/volcengine/volc-sdk-golang/service/imp/models/response\240\001\001\330\001\001\312\002 Volc\\Service\\Imp\\Models\\Response\342\002#Volc\\Service\\Imp\\Models\\GPBMetadata' _IMPRETRIEVEJOBRESPONSE_RESULTENTRY._options = None _IMPRETRIEVEJOBRESPONSE_RESULTENTRY._serialized_options = b'8\001' _IMPSUBMITJOBRESPONSE._serialized_start=126 _IMPSUBMITJOBRESPONSE._serialized_end=237 _IMPKILLJOBRESPONSE._serialized_start=239 _IMPKILLJOBRESPONSE._serialized_end=332 _IMPRETRIEVEJOBRESPONSE._serialized_start=335 _IMPRETRIEVEJOBRESPONSE._serialized_end=609 _IMPRETRIEVEJOBRESPONSE_RESULTENTRY._serialized_start=518 _IMPRETRIEVEJOBRESPONSE_RESULTENTRY._serialized_end=609 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/LiveService.py ================================================ # coding:utf-8 import json import sys import threading from google.protobuf.json_format import Parse, MessageToJson, MessageToDict from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.const.Const import REGION_CN_NORTH1 from volcengine.live.models.response.response_live_pb2 import DescribeCDNSnapshotHistoryResponse, \ DescribeRecordTaskFileHistoryResponse, DescribeLiveStreamInfoByPageResponse, KillStreamResponse, \ ForbidStreamResponse, DescribeClosedStreamInfoByPageResponse, DescribeLiveStreamStateResponse, \ DescribeForbiddenStreamInfoByPageResponse, ResumeStreamResponse, UpdateRelaySourceResponse, \ DeleteRelaySourceResponse, DescribeRelaySourceResponse, CreateVQScoreTaskResponse, DescribeVQScoreTaskResponse, \ ListVQScoreTaskResponse, GeneratePlayURLResponse, GeneratePushURLResponse, CreatePullToPushTaskResponse, \ ListPullToPushTaskResponse, UpdatePullToPushTaskResponse, StopPullToPushTaskResponse, RestartPullToPushTaskResponse, \ DeletePullToPushTaskResponse, UpdateDenyConfigResponse, DescribeDenyConfigResponse LIVE_SERVICE_VERSION2020 = "2020-08-01" LIVE_SERVICE_VERSION2023 = "2023-01-01" service_info_map = { REGION_CN_NORTH1: ServiceInfo("live.volcengineapi.com", {'Accept': 'application/json', }, Credentials('', '', "live", REGION_CN_NORTH1), 5, 5, "https"), } api_info = { "ListCommonTransPresetDetail": ApiInfo("POST", "/", {"Action": "ListCommonTransPresetDetail", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateCallback": ApiInfo("POST", "/", {"Action": "UpdateCallback", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeCallback": ApiInfo("POST", "/", {"Action": "DescribeCallback", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteCallback": ApiInfo("POST", "/", {"Action": "DeleteCallback", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateDomain": ApiInfo("POST", "/", {"Action": "CreateDomain", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteDomain": ApiInfo("POST", "/", {"Action": "DeleteDomain", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListDomainDetail": ApiInfo("POST", "/", {"Action": "ListDomainDetail", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeDomain": ApiInfo("POST", "/", {"Action": "DescribeDomain", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "EnableDomain": ApiInfo("POST", "/", {"Action": "EnableDomain", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DisableDomain": ApiInfo("POST", "/", {"Action": "DisableDomain", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ManagerPullPushDomainBind": ApiInfo("POST", "/", {"Action": "ManagerPullPushDomainBind", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateAuthKey": ApiInfo("POST", "/", {"Action": "UpdateAuthKey", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeAuth": ApiInfo("POST", "/", {"Action": "DescribeAuth", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ForbidStream": ApiInfo("POST", "/", {"Action": "ForbidStream", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ResumeStream": ApiInfo("POST", "/", {"Action": "ResumeStream", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListCert": ApiInfo("POST", "/", {"Action": "ListCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateCert": ApiInfo("POST", "/", {"Action": "CreateCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateCert": ApiInfo("POST", "/", {"Action": "UpdateCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "BindCert": ApiInfo("POST", "/", {"Action": "BindCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UnbindCert": ApiInfo("POST", "/", {"Action": "UnbindCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteCert": ApiInfo("POST", "/", {"Action": "DeleteCert", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateReferer": ApiInfo("POST", "/", {"Action": "UpdateReferer", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteReferer": ApiInfo("POST", "/", {"Action": "DeleteReferer", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeReferer": ApiInfo("POST", "/", {"Action": "DescribeReferer", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateRecordPreset": ApiInfo("POST", "/", {"Action": "CreateRecordPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateRecordPreset": ApiInfo("POST", "/", {"Action": "UpdateRecordPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteRecordPreset": ApiInfo("POST", "/", {"Action": "DeleteRecordPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListVhostRecordPreset": ApiInfo("POST", "/", {"Action": "ListVhostRecordPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateTranscodePreset": ApiInfo("POST", "/", {"Action": "CreateTranscodePreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateTranscodePreset": ApiInfo("POST", "/", {"Action": "UpdateTranscodePreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteTranscodePreset": ApiInfo("POST", "/", {"Action": "DeleteTranscodePreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListVhostTransCodePreset": ApiInfo("POST", "/", {"Action": "ListVhostTransCodePreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateSnapshotPreset": ApiInfo("POST", "/", {"Action": "CreateSnapshotPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateSnapshotPreset": ApiInfo("POST", "/", {"Action": "UpdateSnapshotPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteSnapshotPreset": ApiInfo("POST", "/", {"Action": "DeleteSnapshotPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListVhostSnapshotPreset": ApiInfo("POST", "/", {"Action": "ListVhostSnapshotPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeLiveBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveBandwidthData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveTrafficData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveP95PeakBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveP95PeakBandwidthData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeRecordData": ApiInfo("POST", "/", {"Action": "DescribeRecordData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeTranscodeData": ApiInfo("POST", "/", {"Action": "DescribeTranscodeData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeSnapshotData": ApiInfo("POST", "/", {"Action": "DescribeSnapshotData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveDomainLog": ApiInfo("GET", "/", {"Action": "DescribeLiveDomainLog", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribePushStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribePushStreamMetrics", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveStreamSessions": ApiInfo("POST", "/", {"Action": "DescribeLiveStreamSessions", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribePlayResponseStatusStat": ApiInfo("POST", "/", {"Action": "DescribePlayResponseStatusStat", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveMetricTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveMetricTrafficData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveMetricBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveMetricBandwidthData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribePlayStreamList": ApiInfo("GET", "/", {"Action": "DescribePlayStreamList", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribePullToPushBandwidthData": ApiInfo("POST", "/", {"Action": "DescribePullToPushBandwidthData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "CreateSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "CreateSnapshotAuditPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListVhostSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "ListVhostSnapshotAuditPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "UpdateSnapshotAuditPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "DeleteSnapshotAuditPreset", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeLiveAuditData": ApiInfo("POST", "/", {"Action": "DescribeLiveAuditData", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeCDNSnapshotHistory": ApiInfo("POST", "/", {"Action": "DescribeCDNSnapshotHistory", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeRecordTaskFileHistory": ApiInfo("POST", "/", {"Action": "DescribeRecordTaskFileHistory", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeCDNSnapshotHistory": ApiInfo("POST", "/", {"Action": "DescribeCDNSnapshotHistory", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeRecordTaskFileHistory": ApiInfo("POST", "/", {"Action": "DescribeRecordTaskFileHistory", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeLiveStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeLiveStreamInfoByPage", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "KillStream": ApiInfo("POST", "/", {"Action": "KillStream", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeClosedStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeClosedStreamInfoByPage", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeLiveStreamState": ApiInfo("GET", "/", {"Action": "DescribeLiveStreamState", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeForbiddenStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeForbiddenStreamInfoByPage", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateRelaySourceV2": ApiInfo("POST", "/", {"Action": "UpdateRelaySourceV2", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeleteRelaySourceV2": ApiInfo("POST", "/", {"Action": "DeleteRelaySourceV2", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeRelaySourceV2": ApiInfo("POST", "/", {"Action": "DescribeRelaySourceV2", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateVQScoreTask": ApiInfo("POST", "/", {"Action": "CreateVQScoreTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeVQScoreTask": ApiInfo("POST", "/", {"Action": "DescribeVQScoreTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListVQScoreTask": ApiInfo("POST", "/", {"Action": "ListVQScoreTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "GeneratePlayURL": ApiInfo("POST", "/", {"Action": "GeneratePlayURL", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "GeneratePushURL": ApiInfo("POST", "/", {"Action": "GeneratePushURL", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreatePullToPushTask": ApiInfo("POST", "/", {"Action": "CreatePullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "ListPullToPushTask": ApiInfo("POST", "/", {"Action": "ListPullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdatePullToPushTask": ApiInfo("POST", "/", {"Action": "UpdatePullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "StopPullToPushTask": ApiInfo("POST", "/", {"Action": "StopPullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "RestartPullToPushTask": ApiInfo("POST", "/", {"Action": "RestartPullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DeletePullToPushTask": ApiInfo("POST", "/", {"Action": "DeletePullToPushTask", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "UpdateDenyConfig": ApiInfo("POST", "/", {"Action": "UpdateDenyConfig", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "DescribeDenyConfig": ApiInfo("POST", "/", {"Action": "DescribeDenyConfig", "Version": LIVE_SERVICE_VERSION2023}, {}, {}), "CreateLiveStreamRecordIndexFiles": ApiInfo("POST", "/", {"Action": "CreateLiveStreamRecordIndexFiles", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveBatchPushStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchPushStreamMetrics", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), "DescribeLiveBatchSourceStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchSourceStreamMetrics", "Version": LIVE_SERVICE_VERSION2020}, {}, {}), } class LiveService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(LiveService, "_instance"): with LiveService._instance_lock: if not hasattr(LiveService, "_instance"): LiveService._instance = object.__new__(cls) return LiveService._instance def __init__(self, region=REGION_CN_NORTH1): self.service_info = LiveService.get_service_info(region) self.api_info = LiveService.get_api_info() super(LiveService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region_name): service_info = service_info_map.get(region_name, None) if not service_info: raise Exception('do not support region %s' % region_name) return service_info @staticmethod def get_api_info(): return api_info def list_common_trans_preset_detail(self, params): action = "ListCommonTransPresetDetail" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_callback(self, params): action = "UpdateCallback" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_callback(self, params): action = "DescribeCallback" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_callback(self, params): action = "DeleteCallback" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_domain(self, params): action = "CreateDomain" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_domain(self, params): action = "DeleteDomain" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_domain_detail(self, params): action = "ListDomainDetail" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_domain(self, params): action = "DescribeDomain" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def enable_domain(self, params): action = "EnableDomain" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def disable_domain(self, params): action = "DisableDomain" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def manager_pull_push_domain_bind(self, params): action = "ManagerPullPushDomainBind" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_auth_key(self, params): action = "UpdateAuthKey" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_auth(self, params): action = "DescribeAuth" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def forbid_stream(self, params): action = "ForbidStream" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def resume_stream(self, params): action = "ResumeStream" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_cert(self, params): action = "ListCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_cert(self, params): action = "CreateCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_cert(self, params): action = "UpdateCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def bind_cert(self, params): action = "BindCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def un_bind_cert(self, params): action = "UnbindCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_cert(self, params): action = "DeleteCert" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_referer(self, params): action = "UpdateReferer" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_referer(self, params): action = "DeleteReferer" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_referer(self, params): action = "DescribeReferer" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_record_preset(self, params): action = "CreateRecordPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_record_preset(self, params): action = "UpdateRecordPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_record_preset(self, params): action = "DeleteRecordPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_vhost_record_preset(self, params): action = "ListVhostRecordPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_transcode_preset(self, params): action = "CreateTranscodePreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_transcode_preset(self, params): action = "UpdateTranscodePreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_transcode_preset(self, params): action = "DeleteTranscodePreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_vhost_transcode_preset(self, params): action = "ListVhostTransCodePreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_snapshot_preset(self, params): action = "CreateSnapshotPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_snapshot_preset(self, params): action = "UpdateSnapshotPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_snapshot_preset(self, params): action = "DeleteSnapshotPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_vhost_snapshot_preset(self, params): action = "ListVhostSnapshotPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_bandwidth_data(self, params): action = "DescribeLiveBandwidthData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_traffic_data(self, params): action = "DescribeLiveTrafficData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_P95Peak_bandwidth_data(self, params): action = "DescribeLiveP95PeakBandwidthData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_record_data(self, params): action = "DescribeRecordData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_transcode_data(self, params): action = "DescribeTranscodeData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_snapshot_data(self, params): action = "DescribeSnapshotData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_domain_log(self, params): action = "DescribeLiveDomainLog" res = self.get(action, params) # res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_push_stream_metrics(self, params): action = "DescribePushStreamMetrics" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_stream_sessions(self, params): action = "DescribeLiveStreamSessions" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_play_response_status_stat(self, params): action = "DescribePlayResponseStatusStat" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_metric_traffic_data(self, params): action = "DescribeLiveMetricTrafficData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_metric_bandwidth_data(self, params): action = "DescribeLiveMetricBandwidthData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_play_stream_list(self, params): action = "DescribePlayStreamList" res = self.get(action, params) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_pull_to_push_bandwidth_data(self, params): action = "DescribePullToPushBandwidthData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_snapshot_audit_preset(self, params): action = "CreateSnapshotAuditPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def update_snapshot_audit_preset(self, params): action = "UpdateSnapshotAuditPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_snapshot_audit_preset(self, params): action = "DeleteSnapshotAuditPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_vhost_snapshot_audit_preset(self, params): action = "ListVhostSnapshotAuditPreset" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_audit_data(self, params): action = "DescribeLiveAuditData" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_c_d_n_snapshot_history(self, request): try: params = MessageToDict(request, False, True) res = self.json("DescribeCDNSnapshotHistory", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeCDNSnapshotHistoryResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeCDNSnapshotHistoryResponse(), True) def describe_record_task_file_history(self, request): try: params = MessageToDict(request, False, True) res = self.json("DescribeRecordTaskFileHistory", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeRecordTaskFileHistoryResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeRecordTaskFileHistoryResponse(), True) def describe_live_stream_info_by_page(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeLiveStreamInfoByPage", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeLiveStreamInfoByPageResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeLiveStreamInfoByPageResponse(), True) def kill_stream(self, request): try: params = MessageToDict(request, False, True) res = self.json("KillStream", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), KillStreamResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, KillStreamResponse(), True) def describe_closed_stream_info_by_page(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeClosedStreamInfoByPage", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeClosedStreamInfoByPageResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeClosedStreamInfoByPageResponse(), True) def describe_live_stream_state(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeLiveStreamState", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeLiveStreamStateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeLiveStreamStateResponse(), True) def describe_forbidden_stream_info_by_page(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeForbiddenStreamInfoByPage", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeForbiddenStreamInfoByPageResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeForbiddenStreamInfoByPageResponse(), True) def update_relay_source_v2(self, request): try: params = MessageToDict(request, False, True) res = self.json("UpdateRelaySourceV2", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), UpdateRelaySourceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, UpdateRelaySourceResponse(), True) def delete_relay_source_v2(self, request): try: params = MessageToDict(request, False, True) res = self.json("DeleteRelaySourceV2", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DeleteRelaySourceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DeleteRelaySourceResponse(), True) def describe_relay_source_v2(self, request): try: params = MessageToDict(request, False, True) res = self.json("DescribeRelaySourceV2", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeRelaySourceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeRelaySourceResponse(), True) def create_v_q_score_task(self, request): try: res = self.json("CreateVQScoreTask", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), CreateVQScoreTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, CreateVQScoreTaskResponse(), True) def describe_v_q_score_task(self, request): try: params = MessageToDict(request, False, True) res = self.json("DescribeVQScoreTask", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVQScoreTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVQScoreTaskResponse(), True) def list_v_q_score_task(self, request): try: res = self.json("ListVQScoreTask", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), ListVQScoreTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, ListVQScoreTaskResponse(), True) # # GeneratePlayURL. # # @param request GeneratePlayURLRequest # @return GeneratePlayURLResponse # @raise Exception def generate_play_u_r_l(self, request): try: res = self.json("GeneratePlayURL", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), GeneratePlayURLResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, GeneratePlayURLResponse(), True) def generate_push_u_r_l(self, request): try: res = self.json("GeneratePushURL", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), GeneratePushURLResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, GeneratePushURLResponse(), True) def create_pull_to_push_task(self, request): try: res = self.json("CreatePullToPushTask", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), CreatePullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, CreatePullToPushTaskResponse(), True) # # ListPullToPushTask. # # @param request ListPullToPushTaskRequest # @return ListPullToPushTaskResponse # @raise Exception def list_pull_to_push_task(self, request): try: params = MessageToDict(request, False, True) res = self.json("ListPullToPushTask", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), ListPullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, ListPullToPushTaskResponse(), True) # # UpdatePullToPushTask. # # @param request UpdatePullToPushTaskRequest # @return UpdatePullToPushTaskResponse # @raise Exception def update_pull_to_push_task(self, request): try: res = self.json("UpdatePullToPushTask", {}, json.dumps(request.__dict__)) except Exception as Argument: try: resp = Parse(Argument.__str__(), UpdatePullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, UpdatePullToPushTaskResponse(), True) # StopPullToPushTask. # # @param request StopPullToPushTaskRequest # @return StopPullToPushTaskResponse # @raise Exception def stop_pull_to_push_task(self, request): try: params = MessageToDict(request, False, True) res = self.json("StopPullToPushTask", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), StopPullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, StopPullToPushTaskResponse(), True) # RestartPullToPushTask. # # @param request RestartPullToPushTaskRequest # @return RestartPullToPushTaskResponse # @raise Exception def restart_pull_to_push_task(self, request): try: params = MessageToDict(request, False, True) res = self.json("RestartPullToPushTask", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), RestartPullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, RestartPullToPushTaskResponse(), True) def delete_pull_to_push_task(self, request): try: params = MessageToDict(request, False, True) res = self.json("DeletePullToPushTask", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DeletePullToPushTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DeletePullToPushTaskResponse(), True) def update_deny_config(self, request): try: params = MessageToDict(request, False, True) res = self.json("UpdateDenyConfig", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), UpdateDenyConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, UpdateDenyConfigResponse(), True) # DescribeDenyConfig. # # @param request DescribeDenyConfigRequest # @return DescribeDenyConfigResponse # @raise Exception def describe_deny_config(self, request): try: params = MessageToDict(request, False, True) res = self.json("DescribeDenyConfig", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeDenyConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeDenyConfigResponse(), True) def create_live_stream_record_index_files(self, params): action = "CreateLiveStreamRecordIndexFiles" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_batch_push_stream_metrics(self, params): action = "DescribeLiveBatchPushStreamMetrics" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def describe_live_batch_source_stream_metrics(self, params): action = "DescribeLiveBatchSourceStreamMetrics" res = self.json(action, dict(), json.dumps(params)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json ================================================ FILE: volcengine/live/__init__.py ================================================ __version__ = '1.0.0' ================================================ FILE: volcengine/live/models/__init__.py ================================================ ================================================ FILE: volcengine/live/models/business/VQScore_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/VQScore.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1blive/business/VQScore.proto\x12\x1fVolcengine.Live.Models.Business\"\x17\n\tVQScoreID\x12\n\n\x02ID\x18\x01 \x01(\t\"-\n\tScoreInfo\x12\x11\n\tPointTime\x18\x01 \x01(\t\x12\r\n\x05Score\x18\x02 \x01(\x02\"d\n\rAddrScoreInfo\x12\x10\n\x08\x41\x64\x64rType\x18\x01 \x01(\x03\x12\x41\n\rScoreInfoList\x18\x02 \x03(\x0b\x32*.Volcengine.Live.Models.Business.ScoreInfo\"\x88\x02\n\x0bVQScoreInfo\x12\x10\n\x08MainAddr\x18\x01 \x01(\t\x12\x14\n\x0c\x43ontrastAddr\x18\x02 \x01(\t\x12\x10\n\x08\x44uration\x18\x03 \x01(\x03\x12\x15\n\rTotalPointNum\x18\x04 \x01(\x03\x12\x18\n\x10MainAverageScore\x18\x05 \x01(\x02\x12\x1c\n\x14\x43ontrastAverageScore\x18\x06 \x01(\x02\x12\x12\n\nDifference\x18\x07 \x01(\x02\x12\x15\n\rDifferencePer\x18\x08 \x01(\x02\x12\x45\n\rAddrScoreList\x18\t \x03(\x0b\x32..Volcengine.Live.Models.Business.AddrScoreInfo\"R\n\x0fVQScoreTaskInfo\x12\n\n\x02ID\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\x12\x0e\n\x06Status\x18\x03 \x01(\x03\x12\x11\n\tAccountID\x18\x04 \x01(\t\"\x8c\x01\n\x13VQScoreTaskListInfo\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\r\n\x05Total\x18\x04 \x01(\x03\x12\x42\n\x08TaskList\x18\x05 \x03(\x0b\x32\x30.Volcengine.Live.Models.Business.VQScoreTaskInfoB\xcf\x01\n*com.volcengine.service.live.model.businessB\x07VQScoreP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _VQSCOREID = DESCRIPTOR.message_types_by_name['VQScoreID'] _SCOREINFO = DESCRIPTOR.message_types_by_name['ScoreInfo'] _ADDRSCOREINFO = DESCRIPTOR.message_types_by_name['AddrScoreInfo'] _VQSCOREINFO = DESCRIPTOR.message_types_by_name['VQScoreInfo'] _VQSCORETASKINFO = DESCRIPTOR.message_types_by_name['VQScoreTaskInfo'] _VQSCORETASKLISTINFO = DESCRIPTOR.message_types_by_name['VQScoreTaskListInfo'] VQScoreID = _reflection.GeneratedProtocolMessageType('VQScoreID', (_message.Message,), { 'DESCRIPTOR' : _VQSCOREID, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreID) }) _sym_db.RegisterMessage(VQScoreID) ScoreInfo = _reflection.GeneratedProtocolMessageType('ScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _SCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ScoreInfo) }) _sym_db.RegisterMessage(ScoreInfo) AddrScoreInfo = _reflection.GeneratedProtocolMessageType('AddrScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _ADDRSCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.AddrScoreInfo) }) _sym_db.RegisterMessage(AddrScoreInfo) VQScoreInfo = _reflection.GeneratedProtocolMessageType('VQScoreInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCOREINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreInfo) }) _sym_db.RegisterMessage(VQScoreInfo) VQScoreTaskInfo = _reflection.GeneratedProtocolMessageType('VQScoreTaskInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCORETASKINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreTaskInfo) }) _sym_db.RegisterMessage(VQScoreTaskInfo) VQScoreTaskListInfo = _reflection.GeneratedProtocolMessageType('VQScoreTaskListInfo', (_message.Message,), { 'DESCRIPTOR' : _VQSCORETASKLISTINFO, '__module__' : 'live.business.VQScore_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VQScoreTaskListInfo) }) _sym_db.RegisterMessage(VQScoreTaskListInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\007VQScoreP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _VQSCOREID._serialized_start=64 _VQSCOREID._serialized_end=87 _SCOREINFO._serialized_start=89 _SCOREINFO._serialized_end=134 _ADDRSCOREINFO._serialized_start=136 _ADDRSCOREINFO._serialized_end=236 _VQSCOREINFO._serialized_start=239 _VQSCOREINFO._serialized_end=503 _VQSCORETASKINFO._serialized_start=505 _VQSCORETASKINFO._serialized_end=587 _VQSCORETASKLISTINFO._serialized_start=590 _VQSCORETASKLISTINFO._serialized_end=730 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/__init__.py ================================================ ================================================ FILE: volcengine/live/models/business/addr_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/addr.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18live/business/addr.proto\x12\x1fVolcengine.Live.Models.Business\"R\n\x15GeneratePlayURLResult\x12\x39\n\x07URLList\x18\x01 \x03(\x0b\x32(.Volcengine.Live.Models.Business.PlayURL\"C\n\x07PlayURL\x12\x0b\n\x03URL\x18\x01 \x01(\t\x12\x0b\n\x03\x43\x44N\x18\x02 \x01(\t\x12\x10\n\x08Protocol\x18\x03 \x01(\t\x12\x0c\n\x04Type\x18\x04 \x01(\t\"\xbf\x01\n\x15GeneratePushURLResult\x12\x13\n\x0bPushURLList\x18\x01 \x03(\t\x12G\n\x11PushURLListDetail\x18\x02 \x03(\x0b\x32,.Volcengine.Live.Models.Business.PushURLItem\x12\x18\n\x10TsOverSrtURLList\x18\x03 \x03(\t\x12\x1a\n\x12RtmpOverSrtURLList\x18\x04 \x03(\t\x12\x12\n\nRtmURLList\x18\x05 \x03(\t\"A\n\x0bPushURLItem\x12\x0b\n\x03URL\x18\x01 \x01(\t\x12\x11\n\tDomainApp\x18\x02 \x01(\t\x12\x12\n\nStreamSign\x18\x03 \x01(\tB\xcc\x01\n*com.volcengine.service.live.model.businessB\x04\x41\x64\x64rP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _GENERATEPLAYURLRESULT = DESCRIPTOR.message_types_by_name['GeneratePlayURLResult'] _PLAYURL = DESCRIPTOR.message_types_by_name['PlayURL'] _GENERATEPUSHURLRESULT = DESCRIPTOR.message_types_by_name['GeneratePushURLResult'] _PUSHURLITEM = DESCRIPTOR.message_types_by_name['PushURLItem'] GeneratePlayURLResult = _reflection.GeneratedProtocolMessageType('GeneratePlayURLResult', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPLAYURLRESULT, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.GeneratePlayURLResult) }) _sym_db.RegisterMessage(GeneratePlayURLResult) PlayURL = _reflection.GeneratedProtocolMessageType('PlayURL', (_message.Message,), { 'DESCRIPTOR' : _PLAYURL, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.PlayURL) }) _sym_db.RegisterMessage(PlayURL) GeneratePushURLResult = _reflection.GeneratedProtocolMessageType('GeneratePushURLResult', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPUSHURLRESULT, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.GeneratePushURLResult) }) _sym_db.RegisterMessage(GeneratePushURLResult) PushURLItem = _reflection.GeneratedProtocolMessageType('PushURLItem', (_message.Message,), { 'DESCRIPTOR' : _PUSHURLITEM, '__module__' : 'live.business.addr_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.PushURLItem) }) _sym_db.RegisterMessage(PushURLItem) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\004AddrP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _GENERATEPLAYURLRESULT._serialized_start=61 _GENERATEPLAYURLRESULT._serialized_end=143 _PLAYURL._serialized_start=145 _PLAYURL._serialized_end=212 _GENERATEPUSHURLRESULT._serialized_start=215 _GENERATEPUSHURLRESULT._serialized_end=406 _PUSHURLITEM._serialized_start=408 _PUSHURLITEM._serialized_end=473 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/deny_config_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/deny_config.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1flive/business/deny_config.proto\x12\x1fVolcengine.Live.Models.Business\"\xa8\x01\n\x10\x44\x65nyConfigDetail\x12\x0f\n\x07ProType\x18\x01 \x03(\t\x12\x0f\n\x07\x46mtType\x18\x02 \x03(\t\x12\x11\n\tContinent\x18\x03 \x01(\t\x12\x0f\n\x07\x43ountry\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\x0c\n\x04\x43ity\x18\x06 \x01(\t\x12\x0b\n\x03ISP\x18\x07 \x01(\t\x12\x10\n\x08\x44\x65nyList\x18\x08 \x03(\t\x12\x11\n\tAllowList\x18\t \x03(\t\"b\n\x18\x44\x65scribeDenyConfigResult\x12\x46\n\x08\x44\x65nyList\x18\x01 \x03(\x0b\x32\x34.Volcengine.Live.Models.Business.VhostWithDenyConfig\"\x8e\x01\n\x13VhostWithDenyConfig\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12K\n\x10\x44\x65nyConfigDetail\x18\x04 \x03(\x0b\x32\x31.Volcengine.Live.Models.Business.DenyConfigDetailB\xd2\x01\n*com.volcengine.service.live.model.businessB\nDenyConfigP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _DENYCONFIGDETAIL = DESCRIPTOR.message_types_by_name['DenyConfigDetail'] _DESCRIBEDENYCONFIGRESULT = DESCRIPTOR.message_types_by_name['DescribeDenyConfigResult'] _VHOSTWITHDENYCONFIG = DESCRIPTOR.message_types_by_name['VhostWithDenyConfig'] DenyConfigDetail = _reflection.GeneratedProtocolMessageType('DenyConfigDetail', (_message.Message,), { 'DESCRIPTOR' : _DENYCONFIGDETAIL, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DenyConfigDetail) }) _sym_db.RegisterMessage(DenyConfigDetail) DescribeDenyConfigResult = _reflection.GeneratedProtocolMessageType('DescribeDenyConfigResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDENYCONFIGRESULT, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DescribeDenyConfigResult) }) _sym_db.RegisterMessage(DescribeDenyConfigResult) VhostWithDenyConfig = _reflection.GeneratedProtocolMessageType('VhostWithDenyConfig', (_message.Message,), { 'DESCRIPTOR' : _VHOSTWITHDENYCONFIG, '__module__' : 'live.business.deny_config_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.VhostWithDenyConfig) }) _sym_db.RegisterMessage(VhostWithDenyConfig) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\nDenyConfigP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _DENYCONFIGDETAIL._serialized_start=69 _DENYCONFIGDETAIL._serialized_end=237 _DESCRIBEDENYCONFIGRESULT._serialized_start=239 _DESCRIBEDENYCONFIGRESULT._serialized_end=337 _VHOSTWITHDENYCONFIG._serialized_start=340 _VHOSTWITHDENYCONFIG._serialized_end=482 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/domain_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/domain.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1alive/business/domain.proto\x12\x1fVolcengine.Live.Models.Business\"\x82\x02\n\nDomainList\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\x03\x12\x0c\n\x04Type\x18\x04 \x01(\t\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\r\n\x05\x43Name\x18\x06 \x01(\t\x12\x12\n\nCnameCheck\x18\x07 \x01(\x03\x12\x13\n\x0b\x44omainCheck\x18\x08 \x01(\x03\x12\x10\n\x08ICPCheck\x18\t \x01(\x03\x12\x12\n\nCreateTime\x18\n \x01(\t\x12\x12\n\nCertDomain\x18\x0b \x01(\t\x12\x0f\n\x07\x43hainID\x18\x0c \x01(\t\x12\x10\n\x08\x43\x65rtName\x18\r \x01(\t\x12\x12\n\nPushDomain\x18\x0e \x01(\t\"`\n\x0e\x44omainListInfo\x12?\n\nDomainList\x18\x01 \x03(\x0b\x32+.Volcengine.Live.Models.Business.DomainList\x12\r\n\x05Total\x18\x02 \x01(\x03\x42\xce\x01\n*com.volcengine.service.live.model.businessB\x06\x44omainP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _DOMAINLIST = DESCRIPTOR.message_types_by_name['DomainList'] _DOMAINLISTINFO = DESCRIPTOR.message_types_by_name['DomainListInfo'] DomainList = _reflection.GeneratedProtocolMessageType('DomainList', (_message.Message,), { 'DESCRIPTOR' : _DOMAINLIST, '__module__' : 'live.business.domain_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DomainList) }) _sym_db.RegisterMessage(DomainList) DomainListInfo = _reflection.GeneratedProtocolMessageType('DomainListInfo', (_message.Message,), { 'DESCRIPTOR' : _DOMAINLISTINFO, '__module__' : 'live.business.domain_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.DomainListInfo) }) _sym_db.RegisterMessage(DomainListInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\006DomainP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _DOMAINLIST._serialized_start=64 _DOMAINLIST._serialized_end=322 _DOMAINLISTINFO._serialized_start=324 _DOMAINLISTINFO._serialized_end=420 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/index_m3u8_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/index_m3u8.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1elive/business/index_m3u8.proto\x12\x1fVolcengine.Live.Models.Business\"\xfd\x01\n&CreateLiveStreamRecordIndexFilesResult\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x11\n\tStartTime\x18\x04 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x05 \x01(\t\x12\x14\n\x0cOutputBucket\x18\x06 \x01(\t\x12\x14\n\x0cOutputObject\x18\x07 \x01(\t\x12\x11\n\tRecordURL\x18\x08 \x01(\t\x12\x10\n\x08\x44uration\x18\t \x01(\x01\x12\x0e\n\x06Height\x18\n \x01(\x03\x12\r\n\x05Width\x18\x0b \x01(\x03\x12\x12\n\nCreateTime\x18\x0c \x01(\tB\xcc\x01\n*com.volcengine.service.live.model.businessB\x04\x41\x64\x64rP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CREATELIVESTREAMRECORDINDEXFILESRESULT = DESCRIPTOR.message_types_by_name['CreateLiveStreamRecordIndexFilesResult'] CreateLiveStreamRecordIndexFilesResult = _reflection.GeneratedProtocolMessageType('CreateLiveStreamRecordIndexFilesResult', (_message.Message,), { 'DESCRIPTOR' : _CREATELIVESTREAMRECORDINDEXFILESRESULT, '__module__' : 'live.business.index_m3u8_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CreateLiveStreamRecordIndexFilesResult) }) _sym_db.RegisterMessage(CreateLiveStreamRecordIndexFilesResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\004AddrP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CREATELIVESTREAMRECORDINDEXFILESRESULT._serialized_start=68 _CREATELIVESTREAMRECORDINDEXFILESRESULT._serialized_end=321 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/pull_to_push_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/pull_to_push.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.live.models.business import snapshot_manage_pb2 as live_dot_business_dot_snapshot__manage__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n live/business/pull_to_push.proto\x12\x1fVolcengine.Live.Models.Business\x1a#live/business/snapshot_manage.proto\",\n\x1a\x43reatePullToPushTaskResult\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"\x98\x01\n\x18ListPullToPushTaskResult\x12;\n\x04List\x18\x01 \x03(\x0b\x32-.Volcengine.Live.Models.Business.TaskInfoItem\x12?\n\nPagination\x18\x02 \x01(\x0b\x32+.Volcengine.Live.Models.Business.Pagination\"\xdf\x01\n\x0cTaskInfoItem\x12\r\n\x05Title\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x43\x61llbackURL\x18\x05 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\x05\x12\x11\n\tCycleMode\x18\x07 \x01(\x05\x12\x0f\n\x07\x44stAddr\x18\x08 \x01(\t\x12\x0f\n\x07SrcAddr\x18\t \x01(\t\x12\x10\n\x08SrcAddrS\x18\n \x03(\t\x12\x0e\n\x06Status\x18\x0b \x01(\t\x12\x12\n\nTaskStatus\x18\x0c \x01(\x05\x42\xd6\x01\n*com.volcengine.service.live.model.businessB\x0ePullToPushTaskP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CREATEPULLTOPUSHTASKRESULT = DESCRIPTOR.message_types_by_name['CreatePullToPushTaskResult'] _LISTPULLTOPUSHTASKRESULT = DESCRIPTOR.message_types_by_name['ListPullToPushTaskResult'] _TASKINFOITEM = DESCRIPTOR.message_types_by_name['TaskInfoItem'] CreatePullToPushTaskResult = _reflection.GeneratedProtocolMessageType('CreatePullToPushTaskResult', (_message.Message,), { 'DESCRIPTOR' : _CREATEPULLTOPUSHTASKRESULT, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CreatePullToPushTaskResult) }) _sym_db.RegisterMessage(CreatePullToPushTaskResult) ListPullToPushTaskResult = _reflection.GeneratedProtocolMessageType('ListPullToPushTaskResult', (_message.Message,), { 'DESCRIPTOR' : _LISTPULLTOPUSHTASKRESULT, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ListPullToPushTaskResult) }) _sym_db.RegisterMessage(ListPullToPushTaskResult) TaskInfoItem = _reflection.GeneratedProtocolMessageType('TaskInfoItem', (_message.Message,), { 'DESCRIPTOR' : _TASKINFOITEM, '__module__' : 'live.business.pull_to_push_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.TaskInfoItem) }) _sym_db.RegisterMessage(TaskInfoItem) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\016PullToPushTaskP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CREATEPULLTOPUSHTASKRESULT._serialized_start=106 _CREATEPULLTOPUSHTASKRESULT._serialized_end=150 _LISTPULLTOPUSHTASKRESULT._serialized_start=153 _LISTPULLTOPUSHTASKRESULT._serialized_end=305 _TASKINFOITEM._serialized_start=308 _TASKINFOITEM._serialized_end=531 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/record_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/record_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.live.models.business import snapshot_manage_pb2 as live_dot_business_dot_snapshot__manage__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!live/business/record_manage.proto\x12\x1fVolcengine.Live.Models.Business\x1a#live/business/snapshot_manage.proto\"\xbf\x01\n\x0eRecordTaskFile\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\r\n\x05Vhost\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x0e\n\x06\x42ucket\x18\x05 \x01(\t\x12\x0c\n\x04Path\x18\x06 \x01(\t\x12\x10\n\x08\x44uration\x18\x07 \x01(\t\x12\x11\n\tStartTime\x18\x08 \x01(\t\x12\x0e\n\x06\x46ormat\x18\t \x01(\t\x12\x0f\n\x07\x45ndTime\x18\n \x01(\t\x12\x10\n\x08\x46ileName\x18\x0b \x01(\t\"\x93\x01\n\x11RecordHistoryInfo\x12=\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32/.Volcengine.Live.Models.Business.RecordTaskFile\x12?\n\nPagination\x18\x02 \x01(\x0b\x32+.Volcengine.Live.Models.Business.PaginationB\xd4\x01\n*com.volcengine.service.live.model.businessB\x0cRecordManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _RECORDTASKFILE = DESCRIPTOR.message_types_by_name['RecordTaskFile'] _RECORDHISTORYINFO = DESCRIPTOR.message_types_by_name['RecordHistoryInfo'] RecordTaskFile = _reflection.GeneratedProtocolMessageType('RecordTaskFile', (_message.Message,), { 'DESCRIPTOR' : _RECORDTASKFILE, '__module__' : 'live.business.record_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RecordTaskFile) }) _sym_db.RegisterMessage(RecordTaskFile) RecordHistoryInfo = _reflection.GeneratedProtocolMessageType('RecordHistoryInfo', (_message.Message,), { 'DESCRIPTOR' : _RECORDHISTORYINFO, '__module__' : 'live.business.record_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RecordHistoryInfo) }) _sym_db.RegisterMessage(RecordHistoryInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\014RecordManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _RECORDTASKFILE._serialized_start=108 _RECORDTASKFILE._serialized_end=299 _RECORDHISTORYINFO._serialized_start=302 _RECORDHISTORYINFO._serialized_end=449 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/relay_source_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/relay_source.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n live/business/relay_source.proto\x12\x1fVolcengine.Live.Models.Business\"\xf9\x01\n\x16RelaySourceGroupItemV2\x12\x1d\n\x15RelaySourceDomainList\x18\x01 \x03(\t\x12i\n\x11RelaySourceParams\x18\x02 \x03(\x0b\x32N.Volcengine.Live.Models.Business.RelaySourceGroupItemV2.RelaySourceParamsEntry\x12\x1b\n\x13RelaySourceProtocol\x18\x03 \x01(\t\x1a\x38\n\x16RelaySourceParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x11RelaySourceConfig\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12J\n\tGroupList\x18\x03 \x03(\x0b\x32\x37.Volcengine.Live.Models.Business.RelaySourceGroupItemV2\"j\n\x15RelaySourceConfigList\x12Q\n\x15RelaySourceConfigList\x18\x01 \x03(\x0b\x32\x32.Volcengine.Live.Models.Business.RelaySourceConfigB\xd3\x01\n*com.volcengine.service.live.model.businessB\x0bRelaySourceP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _RELAYSOURCEGROUPITEMV2 = DESCRIPTOR.message_types_by_name['RelaySourceGroupItemV2'] _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY = _RELAYSOURCEGROUPITEMV2.nested_types_by_name['RelaySourceParamsEntry'] _RELAYSOURCECONFIG = DESCRIPTOR.message_types_by_name['RelaySourceConfig'] _RELAYSOURCECONFIGLIST = DESCRIPTOR.message_types_by_name['RelaySourceConfigList'] RelaySourceGroupItemV2 = _reflection.GeneratedProtocolMessageType('RelaySourceGroupItemV2', (_message.Message,), { 'RelaySourceParamsEntry' : _reflection.GeneratedProtocolMessageType('RelaySourceParamsEntry', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceGroupItemV2.RelaySourceParamsEntry) }) , 'DESCRIPTOR' : _RELAYSOURCEGROUPITEMV2, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceGroupItemV2) }) _sym_db.RegisterMessage(RelaySourceGroupItemV2) _sym_db.RegisterMessage(RelaySourceGroupItemV2.RelaySourceParamsEntry) RelaySourceConfig = _reflection.GeneratedProtocolMessageType('RelaySourceConfig', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCECONFIG, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceConfig) }) _sym_db.RegisterMessage(RelaySourceConfig) RelaySourceConfigList = _reflection.GeneratedProtocolMessageType('RelaySourceConfigList', (_message.Message,), { 'DESCRIPTOR' : _RELAYSOURCECONFIGLIST, '__module__' : 'live.business.relay_source_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.RelaySourceConfigList) }) _sym_db.RegisterMessage(RelaySourceConfigList) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\013RelaySourceP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._options = None _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_options = b'8\001' _RELAYSOURCEGROUPITEMV2._serialized_start=70 _RELAYSOURCEGROUPITEMV2._serialized_end=319 _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_start=263 _RELAYSOURCEGROUPITEMV2_RELAYSOURCEPARAMSENTRY._serialized_end=319 _RELAYSOURCECONFIG._serialized_start=321 _RELAYSOURCECONFIG._serialized_end=444 _RELAYSOURCECONFIGLIST._serialized_start=446 _RELAYSOURCECONFIGLIST._serialized_end=552 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/snapshot_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/snapshot_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#live/business/snapshot_manage.proto\x12\x1fVolcengine.Live.Models.Business\"\xb2\x01\n\x12\x43\x44NSnapshotHistory\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x0c\n\x04Path\x18\x04 \x01(\t\x12\x10\n\x08\x46ileName\x18\x05 \x01(\t\x12\x11\n\tTimeStamp\x18\x06 \x01(\t\x12\r\n\x05Width\x18\x07 \x01(\x03\x12\x0e\n\x06Height\x18\x08 \x01(\x03\x12\x11\n\tServiceID\x18\t \x01(\t\x12\x0b\n\x03URI\x18\n \x01(\t\"V\n\nPagination\x12\x0f\n\x07PageCur\x18\x01 \x01(\x03\x12\x10\n\x08PageSize\x18\x02 \x01(\x03\x12\x11\n\tPageTotal\x18\x03 \x01(\x03\x12\x12\n\nTotalCount\x18\x04 \x01(\x03\"\x9c\x01\n\x16\x43\x44NSnapshotHistoryInfo\x12\x41\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32\x33.Volcengine.Live.Models.Business.CDNSnapshotHistory\x12?\n\nPagination\x18\x02 \x01(\x0b\x32+.Volcengine.Live.Models.Business.PaginationB\xd6\x01\n*com.volcengine.service.live.model.businessB\x0eSnapshotManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CDNSNAPSHOTHISTORY = DESCRIPTOR.message_types_by_name['CDNSnapshotHistory'] _PAGINATION = DESCRIPTOR.message_types_by_name['Pagination'] _CDNSNAPSHOTHISTORYINFO = DESCRIPTOR.message_types_by_name['CDNSnapshotHistoryInfo'] CDNSnapshotHistory = _reflection.GeneratedProtocolMessageType('CDNSnapshotHistory', (_message.Message,), { 'DESCRIPTOR' : _CDNSNAPSHOTHISTORY, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CDNSnapshotHistory) }) _sym_db.RegisterMessage(CDNSnapshotHistory) Pagination = _reflection.GeneratedProtocolMessageType('Pagination', (_message.Message,), { 'DESCRIPTOR' : _PAGINATION, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.Pagination) }) _sym_db.RegisterMessage(Pagination) CDNSnapshotHistoryInfo = _reflection.GeneratedProtocolMessageType('CDNSnapshotHistoryInfo', (_message.Message,), { 'DESCRIPTOR' : _CDNSNAPSHOTHISTORYINFO, '__module__' : 'live.business.snapshot_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.CDNSnapshotHistoryInfo) }) _sym_db.RegisterMessage(CDNSnapshotHistoryInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\016SnapshotManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CDNSNAPSHOTHISTORY._serialized_start=73 _CDNSNAPSHOTHISTORY._serialized_end=251 _PAGINATION._serialized_start=253 _PAGINATION._serialized_end=339 _CDNSNAPSHOTHISTORYINFO._serialized_start=342 _CDNSNAPSHOTHISTORYINFO._serialized_end=498 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/business/stream_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/business/stream_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!live/business/stream_manage.proto\x12\x1fVolcengine.Live.Models.Business\"\xd1\x01\n\x0eStreamInfoList\x12\n\n\x02ID\x18\x01 \x01(\x03\x12\r\n\x05Vhost\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x0b\n\x03\x41pp\x18\x04 \x01(\t\x12\x0e\n\x06Stream\x18\x05 \x01(\t\x12\x18\n\x10SessionStartTime\x18\x06 \x01(\t\x12\x12\n\nOnlineUser\x18\x07 \x01(\x03\x12\x11\n\tBandWidth\x18\x08 \x01(\x03\x12\x0f\n\x07\x42itrate\x18\t \x01(\x03\x12\x11\n\tFramerate\x18\n \x01(\x03\x12\x12\n\nPreviewURL\x18\x0b \x01(\t\"\x82\x01\n\x0c\x43losedStream\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x11\n\tStartTime\x18\x05 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x06 \x01(\t\x12\x12\n\nSourceType\x18\x07 \x01(\t\"\x88\x01\n\x17\x46orbiddenStreamInfoList\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x12\n\nCreateTime\x18\x05 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x06 \x01(\t\x12\x0c\n\x04type\x18\x07 \x01(\t\"m\n\x0eLiveStreamInfo\x12G\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32/.Volcengine.Live.Models.Business.StreamInfoList\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\"m\n\x10\x43losedStreamInfo\x12\x45\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32-.Volcengine.Live.Models.Business.ClosedStream\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\"5\n\x0fStreamStateInfo\x12\x14\n\x0cstream_state\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"{\n\x13\x46orbiddenStreamInfo\x12P\n\x0eStreamInfoList\x18\x01 \x03(\x0b\x32\x38.Volcengine.Live.Models.Business.ForbiddenStreamInfoList\x12\x12\n\nRoughCount\x18\x02 \x01(\x03\x42\xd4\x01\n*com.volcengine.service.live.model.businessB\x0cStreamManageP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02!Volc\\Service\\Live\\Models\\Business\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _STREAMINFOLIST = DESCRIPTOR.message_types_by_name['StreamInfoList'] _CLOSEDSTREAM = DESCRIPTOR.message_types_by_name['ClosedStream'] _FORBIDDENSTREAMINFOLIST = DESCRIPTOR.message_types_by_name['ForbiddenStreamInfoList'] _LIVESTREAMINFO = DESCRIPTOR.message_types_by_name['LiveStreamInfo'] _CLOSEDSTREAMINFO = DESCRIPTOR.message_types_by_name['ClosedStreamInfo'] _STREAMSTATEINFO = DESCRIPTOR.message_types_by_name['StreamStateInfo'] _FORBIDDENSTREAMINFO = DESCRIPTOR.message_types_by_name['ForbiddenStreamInfo'] StreamInfoList = _reflection.GeneratedProtocolMessageType('StreamInfoList', (_message.Message,), { 'DESCRIPTOR' : _STREAMINFOLIST, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.StreamInfoList) }) _sym_db.RegisterMessage(StreamInfoList) ClosedStream = _reflection.GeneratedProtocolMessageType('ClosedStream', (_message.Message,), { 'DESCRIPTOR' : _CLOSEDSTREAM, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ClosedStream) }) _sym_db.RegisterMessage(ClosedStream) ForbiddenStreamInfoList = _reflection.GeneratedProtocolMessageType('ForbiddenStreamInfoList', (_message.Message,), { 'DESCRIPTOR' : _FORBIDDENSTREAMINFOLIST, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ForbiddenStreamInfoList) }) _sym_db.RegisterMessage(ForbiddenStreamInfoList) LiveStreamInfo = _reflection.GeneratedProtocolMessageType('LiveStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _LIVESTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.LiveStreamInfo) }) _sym_db.RegisterMessage(LiveStreamInfo) ClosedStreamInfo = _reflection.GeneratedProtocolMessageType('ClosedStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _CLOSEDSTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ClosedStreamInfo) }) _sym_db.RegisterMessage(ClosedStreamInfo) StreamStateInfo = _reflection.GeneratedProtocolMessageType('StreamStateInfo', (_message.Message,), { 'DESCRIPTOR' : _STREAMSTATEINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.StreamStateInfo) }) _sym_db.RegisterMessage(StreamStateInfo) ForbiddenStreamInfo = _reflection.GeneratedProtocolMessageType('ForbiddenStreamInfo', (_message.Message,), { 'DESCRIPTOR' : _FORBIDDENSTREAMINFO, '__module__' : 'live.business.stream_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Business.ForbiddenStreamInfo) }) _sym_db.RegisterMessage(ForbiddenStreamInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.businessB\014StreamManageP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/business\240\001\001\330\001\001\302\002\000\312\002!Volc\\Service\\Live\\Models\\Business\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _STREAMINFOLIST._serialized_start=71 _STREAMINFOLIST._serialized_end=280 _CLOSEDSTREAM._serialized_start=283 _CLOSEDSTREAM._serialized_end=413 _FORBIDDENSTREAMINFOLIST._serialized_start=416 _FORBIDDENSTREAMINFOLIST._serialized_end=552 _LIVESTREAMINFO._serialized_start=554 _LIVESTREAMINFO._serialized_end=663 _CLOSEDSTREAMINFO._serialized_start=665 _CLOSEDSTREAMINFO._serialized_end=774 _STREAMSTATEINFO._serialized_start=776 _STREAMSTATEINFO._serialized_end=829 _FORBIDDENSTREAMINFO._serialized_start=831 _FORBIDDENSTREAMINFO._serialized_end=954 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/request/__init__.py ================================================ ================================================ FILE: volcengine/live/models/request/live_requests.py ================================================ from tokenize import String class CreateVQScoreTaskRequest: MainAddr = "" ContrastAddr = "" FrameInterval = 0 Duration = 0 Algorithm = "" def __init__(self): self = self class GeneratePushURLRequest: Vhost = "" Domain = "" App = "" Stream = "" ValidDuration = 0 ExpiredTime = "" def __init__(self): self = self class GeneratePlayURLRequest: Vhost = "" Domain = "" App = "" Stream = "" Suffix = "" Type = "" ValidDuration = 0 ExpiredTime = "" def __init__(self): self = self class CreatePullToPushTaskRequest: Title = "" StartTime = 0 EndTime = 0 CallbackURL = "" Type = 0 CycleMode = 0 DstAddr = "" SrcAddr = "" SrcAddrS = [] def __init__(self): self = self class UpdatePullToPushTaskRequest: Title = "" StartTime = 0 EndTime = 0 CallbackURL = "" Type = 0 CycleMode = 0 DstAddr = "" SrcAddr = "" SrcAddrS = [] TaskId = "" def __init__(self): self = self class ListVQScoreTaskRequest: StartTime = "" EndTime = "" PageNum = 0 PageSize = 0 Status = 0 def __init__(self): self = self ================================================ FILE: volcengine/live/models/request/request_live_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/request/request_live.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.live.models.business import deny_config_pb2 as live_dot_business_dot_deny__config__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1flive/request/request_live.proto\x12\x1eVolcengine.Live.Models.Request\x1a\x1flive/business/deny_config.proto\"C\n\x13\x43reateDomainRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\x0c\n\x04Type\x18\x02 \x01(\t\x12\x0e\n\x06Region\x18\x03 \x01(\t\"\xb3\x01\n\x17ListDomainDetailRequest\x12\x0f\n\x07PageNum\x18\x01 \x01(\x03\x12\x10\n\x08PageSize\x18\x02 \x01(\x03\x12\x11\n\tVhostList\x18\x03 \x03(\t\x12\x18\n\x10\x44omainStatusList\x18\x04 \x03(\t\x12\x16\n\x0e\x44omainTypeList\x18\x05 \x03(\t\x12\x18\n\x10\x44omainRegionList\x18\x06 \x03(\t\x12\x16\n\x0e\x44omainNameList\x18\x07 \x03(\t\"&\n\x14\x44isableDomainRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\"%\n\x13\x45nableDomainRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\"%\n\x13\x44\x65leteDomainRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\"+\n\x15\x44\x65scribeDomainRequest\x12\x12\n\nDomainList\x18\x01 \x03(\t\"J\n ManagerPullPushDomainBindRequest\x12\x12\n\nPullDomain\x18\x01 \x01(\t\x12\x12\n\nPushDomain\x18\x02 \x01(\t\"\xa5\x01\n$DescribeRecordTaskFileHistoryRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x10\n\x08\x44\x61teFrom\x18\x04 \x01(\t\x12\x0e\n\x06\x44\x61teTo\x18\x05 \x01(\t\x12\x0f\n\x07PageNum\x18\x06 \x01(\x05\x12\x10\n\x08PageSize\x18\x07 \x01(\x05\x12\x0c\n\x04Type\x18\x08 \x01(\t\"\xa2\x01\n!DescribeCDNSnapshotHistoryRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\x12\x10\n\x08\x44\x61teFrom\x18\x04 \x01(\t\x12\x0e\n\x06\x44\x61teTo\x18\x05 \x01(\t\x12\x0f\n\x07PageNum\x18\x06 \x01(\x05\x12\x10\n\x08PageSize\x18\x07 \x01(\x05\x12\x0c\n\x04Type\x18\x08 \x01(\t\"\xaa\x01\n#DescribeLiveStreamInfoByPageRequest\x12\x0f\n\x07PageNum\x18\x01 \x01(\x05\x12\x10\n\x08PageSize\x18\x02 \x01(\x05\x12\r\n\x05Vhost\x18\x03 \x01(\t\x12\x0e\n\x06\x44omain\x18\x04 \x01(\t\x12\x0b\n\x03\x41pp\x18\x05 \x01(\t\x12\x0e\n\x06Stream\x18\x06 \x01(\t\x12\x12\n\nStreamType\x18\x07 \x01(\t\x12\x10\n\x08InfoType\x18\x08 \x01(\t\"\xd0\x01\n%DescribeClosedStreamInfoByPageRequest\x12\x0f\n\x07PageNum\x18\x01 \x01(\x05\x12\x10\n\x08PageSize\x18\x02 \x01(\x05\x12\r\n\x05Vhost\x18\x03 \x01(\t\x12\x0e\n\x06\x44omain\x18\x04 \x01(\t\x12\x0b\n\x03\x41pp\x18\x05 \x01(\t\x12\x0e\n\x06Stream\x18\x06 \x01(\t\x12\x0c\n\x04Sort\x18\x07 \x01(\t\x12\x13\n\x0b\x45ndTimeFrom\x18\x08 \x01(\t\x12\x11\n\tEndTimeTo\x18\t \x01(\t\x12\x12\n\nSourceType\x18\n \x01(\t\"\x87\x01\n(DescribeForbiddenStreamInfoByPageRequest\x12\x0f\n\x07PageNum\x18\x01 \x01(\x05\x12\x10\n\x08PageSize\x18\x02 \x01(\x05\x12\r\n\x05Vhost\x18\x03 \x01(\t\x12\x0b\n\x03\x41pp\x18\x04 \x01(\t\x12\x0e\n\x06Stream\x18\x05 \x01(\t\x12\x0c\n\x04Sort\x18\x06 \x01(\t\"\\\n\x1e\x44\x65scribeLiveStreamStateRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\"Q\n\x13ResumeStreamRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\"?\n\x11KillStreamRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x0e\n\x06Stream\x18\x03 \x01(\t\"b\n\x13\x46orbidStreamRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x05 \x01(\t\"\x98\x02\n\x18UpdateRelaySourceRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\x12\x1d\n\x15RelaySourceDomainList\x18\x03 \x03(\t\x12j\n\x11RelaySourceParams\x18\x04 \x03(\x0b\x32O.Volcengine.Live.Models.Request.UpdateRelaySourceRequest.RelaySourceParamsEntry\x12\x1b\n\x13RelaySourceProtocol\x18\x05 \x01(\t\x1a\x38\n\x16RelaySourceParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x18\x44\x65leteRelaySourceRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0b\n\x03\x41pp\x18\x02 \x01(\t\"+\n\x1a\x44\x65scribeRelaySourceRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\"~\n\x18\x43reateVQScoreTaskRequest\x12\x10\n\x08MainAddr\x18\x01 \x01(\t\x12\x14\n\x0c\x43ontrastAddr\x18\x02 \x01(\t\x12\x15\n\rFrameInterval\x18\x03 \x01(\x05\x12\x10\n\x08\x44uration\x18\x04 \x01(\x05\x12\x11\n\tAlgorithm\x18\x05 \x01(\t\"(\n\x1a\x44\x65scribeVQScoreTaskRequest\x12\n\n\x02ID\x18\x01 \x01(\t\"o\n\x16ListVQScoreTaskRequest\x12\x11\n\tStartTime\x18\x01 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\t\x12\x0f\n\x07PageNum\x18\x03 \x01(\x05\x12\x10\n\x08PageSize\x18\x04 \x01(\x05\x12\x0e\n\x06Status\x18\x05 \x01(\x05\"\x9e\x01\n\x16GeneratePlayURLRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x0e\n\x06Suffix\x18\x05 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\t\x12\x15\n\rValidDuration\x18\x07 \x01(\x03\x12\x13\n\x0b\x45xpiredTime\x18\x08 \x01(\t\"\x80\x01\n\x16GeneratePushURLRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12\x0e\n\x06Stream\x18\x04 \x01(\t\x12\x15\n\rValidDuration\x18\x05 \x01(\x03\x12\x13\n\x0b\x45xpiredTime\x18\x06 \x01(\t\"\xba\x01\n\x1b\x43reatePullToPushTaskRequest\x12\r\n\x05Title\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\x03\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\x03\x12\x13\n\x0b\x43\x61llbackURL\x18\x04 \x01(\t\x12\x0c\n\x04Type\x18\x05 \x01(\x05\x12\x11\n\tCycleMode\x18\x06 \x01(\x05\x12\x0f\n\x07\x44stAddr\x18\x07 \x01(\t\x12\x0f\n\x07SrcAddr\x18\x08 \x01(\t\x12\x10\n\x08SrcAddrS\x18\t \x03(\t\"F\n\x19ListPullToPushTaskRequest\x12\x0c\n\x04Page\x18\x01 \x01(\x05\x12\x0c\n\x04Size\x18\x02 \x01(\x05\x12\r\n\x05Title\x18\x03 \x01(\t\"\xca\x01\n\x1bUpdatePullToPushTaskRequest\x12\r\n\x05Title\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\x03\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\x03\x12\x13\n\x0b\x43\x61llbackURL\x18\x05 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\x05\x12\x11\n\tCycleMode\x18\x07 \x01(\x05\x12\x0f\n\x07\x44stAddr\x18\x08 \x01(\t\x12\x0f\n\x07SrcAddr\x18\t \x01(\t\x12\x10\n\x08SrcAddrS\x18\n \x03(\t\".\n\x1cRestartPullToPushTaskRequest\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"+\n\x19StopPullToPushTaskRequest\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"-\n\x1b\x44\x65letePullToPushTaskRequest\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"\x90\x01\n\x17UpdateDenyConfigRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\x12I\n\x0e\x44\x65nyConfigList\x18\x04 \x03(\x0b\x32\x31.Volcengine.Live.Models.Business.DenyConfigDetail\"G\n\x19\x44\x65scribeDenyConfigRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\t\"E\n\x17\x44\x65leteDenyConfigRequest\x12\r\n\x05Vhost\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0b\n\x03\x41pp\x18\x03 \x01(\tB\xcd\x01\n)com.volcengine.service.live.model.requestB\x0bLiveRequestP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/live/models/request\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Live\\Models\\Request\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CREATEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['CreateDomainRequest'] _LISTDOMAINDETAILREQUEST = DESCRIPTOR.message_types_by_name['ListDomainDetailRequest'] _DISABLEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['DisableDomainRequest'] _ENABLEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['EnableDomainRequest'] _DELETEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['DeleteDomainRequest'] _DESCRIBEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['DescribeDomainRequest'] _MANAGERPULLPUSHDOMAINBINDREQUEST = DESCRIPTOR.message_types_by_name['ManagerPullPushDomainBindRequest'] _DESCRIBERECORDTASKFILEHISTORYREQUEST = DESCRIPTOR.message_types_by_name['DescribeRecordTaskFileHistoryRequest'] _DESCRIBECDNSNAPSHOTHISTORYREQUEST = DESCRIPTOR.message_types_by_name['DescribeCDNSnapshotHistoryRequest'] _DESCRIBELIVESTREAMINFOBYPAGEREQUEST = DESCRIPTOR.message_types_by_name['DescribeLiveStreamInfoByPageRequest'] _DESCRIBECLOSEDSTREAMINFOBYPAGEREQUEST = DESCRIPTOR.message_types_by_name['DescribeClosedStreamInfoByPageRequest'] _DESCRIBEFORBIDDENSTREAMINFOBYPAGEREQUEST = DESCRIPTOR.message_types_by_name['DescribeForbiddenStreamInfoByPageRequest'] _DESCRIBELIVESTREAMSTATEREQUEST = DESCRIPTOR.message_types_by_name['DescribeLiveStreamStateRequest'] _RESUMESTREAMREQUEST = DESCRIPTOR.message_types_by_name['ResumeStreamRequest'] _KILLSTREAMREQUEST = DESCRIPTOR.message_types_by_name['KillStreamRequest'] _FORBIDSTREAMREQUEST = DESCRIPTOR.message_types_by_name['ForbidStreamRequest'] _UPDATERELAYSOURCEREQUEST = DESCRIPTOR.message_types_by_name['UpdateRelaySourceRequest'] _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY = _UPDATERELAYSOURCEREQUEST.nested_types_by_name['RelaySourceParamsEntry'] _DELETERELAYSOURCEREQUEST = DESCRIPTOR.message_types_by_name['DeleteRelaySourceRequest'] _DESCRIBERELAYSOURCEREQUEST = DESCRIPTOR.message_types_by_name['DescribeRelaySourceRequest'] # _CREATEVQSCORETASKREQUEST = DESCRIPTOR.message_types_by_name['CreateVQScoreTaskRequest'] _DESCRIBEVQSCORETASKREQUEST = DESCRIPTOR.message_types_by_name['DescribeVQScoreTaskRequest'] _LISTVQSCORETASKREQUEST = DESCRIPTOR.message_types_by_name['ListVQScoreTaskRequest'] # _GENERATEPLAYURLREQUEST = DESCRIPTOR.message_types_by_name['GeneratePlayURLRequest'] # _GENERATEPUSHURLREQUEST = DESCRIPTOR.message_types_by_name['GeneratePushURLRequest'] # _CREATEPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['CreatePullToPushTaskRequest'] _LISTPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['ListPullToPushTaskRequest'] # _UPDATEPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['UpdatePullToPushTaskRequest'] _RESTARTPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['RestartPullToPushTaskRequest'] _STOPPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['StopPullToPushTaskRequest'] _DELETEPULLTOPUSHTASKREQUEST = DESCRIPTOR.message_types_by_name['DeletePullToPushTaskRequest'] _UPDATEDENYCONFIGREQUEST = DESCRIPTOR.message_types_by_name['UpdateDenyConfigRequest'] _DESCRIBEDENYCONFIGREQUEST = DESCRIPTOR.message_types_by_name['DescribeDenyConfigRequest'] _DELETEDENYCONFIGREQUEST = DESCRIPTOR.message_types_by_name['DeleteDenyConfigRequest'] CreateDomainRequest = _reflection.GeneratedProtocolMessageType('CreateDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _CREATEDOMAINREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.CreateDomainRequest) }) _sym_db.RegisterMessage(CreateDomainRequest) ListDomainDetailRequest = _reflection.GeneratedProtocolMessageType('ListDomainDetailRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTDOMAINDETAILREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ListDomainDetailRequest) }) _sym_db.RegisterMessage(ListDomainDetailRequest) DisableDomainRequest = _reflection.GeneratedProtocolMessageType('DisableDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _DISABLEDOMAINREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DisableDomainRequest) }) _sym_db.RegisterMessage(DisableDomainRequest) EnableDomainRequest = _reflection.GeneratedProtocolMessageType('EnableDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _ENABLEDOMAINREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.EnableDomainRequest) }) _sym_db.RegisterMessage(EnableDomainRequest) DeleteDomainRequest = _reflection.GeneratedProtocolMessageType('DeleteDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _DELETEDOMAINREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DeleteDomainRequest) }) _sym_db.RegisterMessage(DeleteDomainRequest) DescribeDomainRequest = _reflection.GeneratedProtocolMessageType('DescribeDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDOMAINREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeDomainRequest) }) _sym_db.RegisterMessage(DescribeDomainRequest) ManagerPullPushDomainBindRequest = _reflection.GeneratedProtocolMessageType('ManagerPullPushDomainBindRequest', (_message.Message,), { 'DESCRIPTOR' : _MANAGERPULLPUSHDOMAINBINDREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ManagerPullPushDomainBindRequest) }) _sym_db.RegisterMessage(ManagerPullPushDomainBindRequest) DescribeRecordTaskFileHistoryRequest = _reflection.GeneratedProtocolMessageType('DescribeRecordTaskFileHistoryRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBERECORDTASKFILEHISTORYREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeRecordTaskFileHistoryRequest) }) _sym_db.RegisterMessage(DescribeRecordTaskFileHistoryRequest) DescribeCDNSnapshotHistoryRequest = _reflection.GeneratedProtocolMessageType('DescribeCDNSnapshotHistoryRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBECDNSNAPSHOTHISTORYREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeCDNSnapshotHistoryRequest) }) _sym_db.RegisterMessage(DescribeCDNSnapshotHistoryRequest) DescribeLiveStreamInfoByPageRequest = _reflection.GeneratedProtocolMessageType('DescribeLiveStreamInfoByPageRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBELIVESTREAMINFOBYPAGEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeLiveStreamInfoByPageRequest) }) _sym_db.RegisterMessage(DescribeLiveStreamInfoByPageRequest) DescribeClosedStreamInfoByPageRequest = _reflection.GeneratedProtocolMessageType('DescribeClosedStreamInfoByPageRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBECLOSEDSTREAMINFOBYPAGEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeClosedStreamInfoByPageRequest) }) _sym_db.RegisterMessage(DescribeClosedStreamInfoByPageRequest) DescribeForbiddenStreamInfoByPageRequest = _reflection.GeneratedProtocolMessageType('DescribeForbiddenStreamInfoByPageRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEFORBIDDENSTREAMINFOBYPAGEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeForbiddenStreamInfoByPageRequest) }) _sym_db.RegisterMessage(DescribeForbiddenStreamInfoByPageRequest) DescribeLiveStreamStateRequest = _reflection.GeneratedProtocolMessageType('DescribeLiveStreamStateRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBELIVESTREAMSTATEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeLiveStreamStateRequest) }) _sym_db.RegisterMessage(DescribeLiveStreamStateRequest) ResumeStreamRequest = _reflection.GeneratedProtocolMessageType('ResumeStreamRequest', (_message.Message,), { 'DESCRIPTOR' : _RESUMESTREAMREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ResumeStreamRequest) }) _sym_db.RegisterMessage(ResumeStreamRequest) KillStreamRequest = _reflection.GeneratedProtocolMessageType('KillStreamRequest', (_message.Message,), { 'DESCRIPTOR' : _KILLSTREAMREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.KillStreamRequest) }) _sym_db.RegisterMessage(KillStreamRequest) ForbidStreamRequest = _reflection.GeneratedProtocolMessageType('ForbidStreamRequest', (_message.Message,), { 'DESCRIPTOR' : _FORBIDSTREAMREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ForbidStreamRequest) }) _sym_db.RegisterMessage(ForbidStreamRequest) UpdateRelaySourceRequest = _reflection.GeneratedProtocolMessageType('UpdateRelaySourceRequest', (_message.Message,), { 'RelaySourceParamsEntry' : _reflection.GeneratedProtocolMessageType('RelaySourceParamsEntry', (_message.Message,), { 'DESCRIPTOR' : _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.UpdateRelaySourceRequest.RelaySourceParamsEntry) }) , 'DESCRIPTOR' : _UPDATERELAYSOURCEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.UpdateRelaySourceRequest) }) _sym_db.RegisterMessage(UpdateRelaySourceRequest) _sym_db.RegisterMessage(UpdateRelaySourceRequest.RelaySourceParamsEntry) DeleteRelaySourceRequest = _reflection.GeneratedProtocolMessageType('DeleteRelaySourceRequest', (_message.Message,), { 'DESCRIPTOR' : _DELETERELAYSOURCEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DeleteRelaySourceRequest) }) _sym_db.RegisterMessage(DeleteRelaySourceRequest) DescribeRelaySourceRequest = _reflection.GeneratedProtocolMessageType('DescribeRelaySourceRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBERELAYSOURCEREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeRelaySourceRequest) }) _sym_db.RegisterMessage(DescribeRelaySourceRequest) # CreateVQScoreTaskRequest = _reflection.GeneratedProtocolMessageType('CreateVQScoreTaskRequest', (_message.Message,), { # 'DESCRIPTOR' : _CREATEVQSCORETASKREQUEST, # '__module__' : 'live.request.request_live_pb2' # # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.CreateVQScoreTaskRequest) # }) # _sym_db.RegisterMessage(CreateVQScoreTaskRequest) DescribeVQScoreTaskRequest = _reflection.GeneratedProtocolMessageType('DescribeVQScoreTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVQSCORETASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeVQScoreTaskRequest) }) _sym_db.RegisterMessage(DescribeVQScoreTaskRequest) ListVQScoreTaskRequest = _reflection.GeneratedProtocolMessageType('ListVQScoreTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTVQSCORETASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ListVQScoreTaskRequest) }) _sym_db.RegisterMessage(ListVQScoreTaskRequest) # GeneratePlayURLRequest = _reflection.GeneratedProtocolMessageType('GeneratePlayURLRequest', (_message.Message,), { # 'DESCRIPTOR' : _GENERATEPLAYURLREQUEST, # '__module__' : 'live.request.request_live_pb2' # # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.GeneratePlayURLRequest) # }) # _sym_db.RegisterMessage(GeneratePlayURLRequest) # GeneratePushURLRequest = _reflection.GeneratedProtocolMessageType('GeneratePushURLRequest', (_message.Message,), { # 'DESCRIPTOR' : _GENERATEPUSHURLREQUEST, # '__module__' : 'live.request.request_live_pb2' # # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.GeneratePushURLRequest) # }) # _sym_db.RegisterMessage(GeneratePushURLRequest) # CreatePullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('CreatePullToPushTaskRequest', (_message.Message,), { # 'DESCRIPTOR' : _CREATEPULLTOPUSHTASKREQUEST, # '__module__' : 'live.request.request_live_pb2' # # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.CreatePullToPushTaskRequest) # }) # _sym_db.RegisterMessage(CreatePullToPushTaskRequest) ListPullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('ListPullToPushTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTPULLTOPUSHTASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.ListPullToPushTaskRequest) }) _sym_db.RegisterMessage(ListPullToPushTaskRequest) # UpdatePullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('UpdatePullToPushTaskRequest', (_message.Message,), { # 'DESCRIPTOR' : _UPDATEPULLTOPUSHTASKREQUEST, # '__module__' : 'live.request.request_live_pb2' # # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.UpdatePullToPushTaskRequest) # }) # _sym_db.RegisterMessage(UpdatePullToPushTaskRequest) RestartPullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('RestartPullToPushTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _RESTARTPULLTOPUSHTASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.RestartPullToPushTaskRequest) }) _sym_db.RegisterMessage(RestartPullToPushTaskRequest) StopPullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('StopPullToPushTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _STOPPULLTOPUSHTASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.StopPullToPushTaskRequest) }) _sym_db.RegisterMessage(StopPullToPushTaskRequest) DeletePullToPushTaskRequest = _reflection.GeneratedProtocolMessageType('DeletePullToPushTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _DELETEPULLTOPUSHTASKREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DeletePullToPushTaskRequest) }) _sym_db.RegisterMessage(DeletePullToPushTaskRequest) UpdateDenyConfigRequest = _reflection.GeneratedProtocolMessageType('UpdateDenyConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _UPDATEDENYCONFIGREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.UpdateDenyConfigRequest) }) _sym_db.RegisterMessage(UpdateDenyConfigRequest) DescribeDenyConfigRequest = _reflection.GeneratedProtocolMessageType('DescribeDenyConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDENYCONFIGREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DescribeDenyConfigRequest) }) _sym_db.RegisterMessage(DescribeDenyConfigRequest) DeleteDenyConfigRequest = _reflection.GeneratedProtocolMessageType('DeleteDenyConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _DELETEDENYCONFIGREQUEST, '__module__' : 'live.request.request_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Request.DeleteDenyConfigRequest) }) _sym_db.RegisterMessage(DeleteDenyConfigRequest) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.live.model.requestB\013LiveRequestP\001ZAgithub.com/volcengine/volc-sdk-golang/service/live/models/request\240\001\001\330\001\001\312\002 Volc\\Service\\Live\\Models\\Request\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY._options = None _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY._serialized_options = b'8\001' _CREATEDOMAINREQUEST._serialized_start=100 _CREATEDOMAINREQUEST._serialized_end=167 _LISTDOMAINDETAILREQUEST._serialized_start=170 _LISTDOMAINDETAILREQUEST._serialized_end=349 _DISABLEDOMAINREQUEST._serialized_start=351 _DISABLEDOMAINREQUEST._serialized_end=389 _ENABLEDOMAINREQUEST._serialized_start=391 _ENABLEDOMAINREQUEST._serialized_end=428 _DELETEDOMAINREQUEST._serialized_start=430 _DELETEDOMAINREQUEST._serialized_end=467 _DESCRIBEDOMAINREQUEST._serialized_start=469 _DESCRIBEDOMAINREQUEST._serialized_end=512 _MANAGERPULLPUSHDOMAINBINDREQUEST._serialized_start=514 _MANAGERPULLPUSHDOMAINBINDREQUEST._serialized_end=588 _DESCRIBERECORDTASKFILEHISTORYREQUEST._serialized_start=591 _DESCRIBERECORDTASKFILEHISTORYREQUEST._serialized_end=756 _DESCRIBECDNSNAPSHOTHISTORYREQUEST._serialized_start=759 _DESCRIBECDNSNAPSHOTHISTORYREQUEST._serialized_end=921 _DESCRIBELIVESTREAMINFOBYPAGEREQUEST._serialized_start=924 _DESCRIBELIVESTREAMINFOBYPAGEREQUEST._serialized_end=1094 _DESCRIBECLOSEDSTREAMINFOBYPAGEREQUEST._serialized_start=1097 _DESCRIBECLOSEDSTREAMINFOBYPAGEREQUEST._serialized_end=1305 _DESCRIBEFORBIDDENSTREAMINFOBYPAGEREQUEST._serialized_start=1308 _DESCRIBEFORBIDDENSTREAMINFOBYPAGEREQUEST._serialized_end=1443 _DESCRIBELIVESTREAMSTATEREQUEST._serialized_start=1445 _DESCRIBELIVESTREAMSTATEREQUEST._serialized_end=1537 _RESUMESTREAMREQUEST._serialized_start=1539 _RESUMESTREAMREQUEST._serialized_end=1620 _KILLSTREAMREQUEST._serialized_start=1622 _KILLSTREAMREQUEST._serialized_end=1685 _FORBIDSTREAMREQUEST._serialized_start=1687 _FORBIDSTREAMREQUEST._serialized_end=1785 _UPDATERELAYSOURCEREQUEST._serialized_start=1788 _UPDATERELAYSOURCEREQUEST._serialized_end=2068 _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY._serialized_start=2012 _UPDATERELAYSOURCEREQUEST_RELAYSOURCEPARAMSENTRY._serialized_end=2068 _DELETERELAYSOURCEREQUEST._serialized_start=2070 _DELETERELAYSOURCEREQUEST._serialized_end=2124 _DESCRIBERELAYSOURCEREQUEST._serialized_start=2126 _DESCRIBERELAYSOURCEREQUEST._serialized_end=2169 # _CREATEVQSCORETASKREQUEST._serialized_start=2171 # _CREATEVQSCORETASKREQUEST._serialized_end=2297 _DESCRIBEVQSCORETASKREQUEST._serialized_start=2299 _DESCRIBEVQSCORETASKREQUEST._serialized_end=2339 _LISTVQSCORETASKREQUEST._serialized_start=2341 _LISTVQSCORETASKREQUEST._serialized_end=2452 # _GENERATEPLAYURLREQUEST._serialized_start=2455 # _GENERATEPLAYURLREQUEST._serialized_end=2613 # _GENERATEPUSHURLREQUEST._serialized_start=2616 # _GENERATEPUSHURLREQUEST._serialized_end=2744 # _CREATEPULLTOPUSHTASKREQUEST._serialized_start=2747 # _CREATEPULLTOPUSHTASKREQUEST._serialized_end=2933 _LISTPULLTOPUSHTASKREQUEST._serialized_start=2935 _LISTPULLTOPUSHTASKREQUEST._serialized_end=3005 # _UPDATEPULLTOPUSHTASKREQUEST._serialized_start=3008 # _UPDATEPULLTOPUSHTASKREQUEST._serialized_end=3210 _RESTARTPULLTOPUSHTASKREQUEST._serialized_start=3212 _RESTARTPULLTOPUSHTASKREQUEST._serialized_end=3258 _STOPPULLTOPUSHTASKREQUEST._serialized_start=3260 _STOPPULLTOPUSHTASKREQUEST._serialized_end=3303 _DELETEPULLTOPUSHTASKREQUEST._serialized_start=3305 _DELETEPULLTOPUSHTASKREQUEST._serialized_end=3350 _UPDATEDENYCONFIGREQUEST._serialized_start=3353 _UPDATEDENYCONFIGREQUEST._serialized_end=3497 _DESCRIBEDENYCONFIGREQUEST._serialized_start=3499 _DESCRIBEDENYCONFIGREQUEST._serialized_end=3570 _DELETEDENYCONFIGREQUEST._serialized_start=3572 _DELETEDENYCONFIGREQUEST._serialized_end=3641 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/models/response/__init__.py ================================================ ================================================ FILE: volcengine/live/models/response/response_live_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: live/response/response_live.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.base.models.base import base_pb2 as base_dot_base__pb2 from volcengine.live.models.business import domain_pb2 as live_dot_business_dot_domain__pb2 from volcengine.live.models.business import VQScore_pb2 as live_dot_business_dot_VQScore__pb2 from volcengine.live.models.business import addr_pb2 as live_dot_business_dot_addr__pb2 from volcengine.live.models.business import pull_to_push_pb2 as live_dot_business_dot_pull__to__push__pb2 from volcengine.live.models.business import deny_config_pb2 as live_dot_business_dot_deny__config__pb2 from volcengine.live.models.business import relay_source_pb2 as live_dot_business_dot_relay__source__pb2 from volcengine.live.models.business import stream_manage_pb2 as live_dot_business_dot_stream__manage__pb2 from volcengine.live.models.business import snapshot_manage_pb2 as live_dot_business_dot_snapshot__manage__pb2 from volcengine.live.models.business import record_manage_pb2 as live_dot_business_dot_record__manage__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!live/response/response_live.proto\x12\x1fVolcengine.Live.Models.Response\x1a\x0f\x62\x61se/base.proto\x1a\x1alive/business/domain.proto\x1a\x1blive/business/VQScore.proto\x1a\x18live/business/addr.proto\x1a live/business/pull_to_push.proto\x1a\x1flive/business/deny_config.proto\x1a live/business/relay_source.proto\x1a!live/business/stream_manage.proto\x1a#live/business/snapshot_manage.proto\x1a!live/business/record_manage.proto\"_\n\x14\x43reateDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xa4\x01\n\x18ListDomainDetailResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Live.Models.Business.DomainListInfo\"`\n\x15\x44isableDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"_\n\x14\x45nableDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"_\n\x14\x44\x65leteDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xa2\x01\n\x16\x44\x65scribeDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Live.Models.Business.DomainListInfo\"l\n!ManagerPullPushDomainBindResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb0\x01\n$DescribeLiveStreamInfoByPageResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Live.Models.Business.LiveStreamInfo\"\xb4\x01\n&DescribeClosedStreamInfoByPageResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x41\n\x06Result\x18\x02 \x01(\x0b\x32\x31.Volcengine.Live.Models.Business.ClosedStreamInfo\"\xac\x01\n\x1f\x44\x65scribeLiveStreamStateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12@\n\x06Result\x18\x02 \x01(\x0b\x32\x30.Volcengine.Live.Models.Business.StreamStateInfo\"]\n\x12KillStreamResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"_\n\x14\x46orbidStreamResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xba\x01\n)DescribeForbiddenStreamInfoByPageResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Live.Models.Business.ForbiddenStreamInfo\"_\n\x14ResumeStreamResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb6\x01\n\"DescribeCDNSnapshotHistoryResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12G\n\x06Result\x18\x02 \x01(\x0b\x32\x37.Volcengine.Live.Models.Business.CDNSnapshotHistoryInfo\"\xb4\x01\n%DescribeRecordTaskFileHistoryResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x42\n\x06Result\x18\x02 \x01(\x0b\x32\x32.Volcengine.Live.Models.Business.RecordHistoryInfo\"d\n\x19UpdateRelaySourceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"d\n\x19\x44\x65leteRelaySourceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xae\x01\n\x1b\x44\x65scribeRelaySourceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Live.Models.Business.RelaySourceConfigList\"\xa0\x01\n\x19\x43reateVQScoreTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12:\n\x06Result\x18\x02 \x01(\x0b\x32*.Volcengine.Live.Models.Business.VQScoreID\"\xa4\x01\n\x1b\x44\x65scribeVQScoreTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x01(\x0b\x32,.Volcengine.Live.Models.Business.VQScoreInfo\"\xa8\x01\n\x17ListVQScoreTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Live.Models.Business.VQScoreTaskListInfo\"\xaa\x01\n\x17GeneratePlayURLResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Live.Models.Business.GeneratePlayURLResult\"\xaa\x01\n\x17GeneratePushURLResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Live.Models.Business.GeneratePushURLResult\"\xb4\x01\n\x1c\x43reatePullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Live.Models.Business.CreatePullToPushTaskResult\"\xb0\x01\n\x1aListPullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Live.Models.Business.ListPullToPushTaskResult\"g\n\x1cUpdatePullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"h\n\x1dRestartPullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"e\n\x1aStopPullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"g\n\x1c\x44\x65letePullToPushTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"c\n\x18UpdateDenyConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb0\x01\n\x1a\x44\x65scribeDenyConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Live.Models.Business.DescribeDenyConfigResult\"c\n\x18\x44\x65leteDenyConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadataB\xd1\x01\n*com.volcengine.service.live.model.responseB\x0cLiveResponseP\x01ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/response\xa0\x01\x01\xd8\x01\x01\xca\x02!Volc\\Service\\Live\\Models\\Response\xe2\x02$Volc\\Service\\Live\\Models\\GPBMetadatab\x06proto3') _CREATEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['CreateDomainResponse'] _LISTDOMAINDETAILRESPONSE = DESCRIPTOR.message_types_by_name['ListDomainDetailResponse'] _DISABLEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['DisableDomainResponse'] _ENABLEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['EnableDomainResponse'] _DELETEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['DeleteDomainResponse'] _DESCRIBEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['DescribeDomainResponse'] _MANAGERPULLPUSHDOMAINBINDRESPONSE = DESCRIPTOR.message_types_by_name['ManagerPullPushDomainBindResponse'] _DESCRIBELIVESTREAMINFOBYPAGERESPONSE = DESCRIPTOR.message_types_by_name['DescribeLiveStreamInfoByPageResponse'] _DESCRIBECLOSEDSTREAMINFOBYPAGERESPONSE = DESCRIPTOR.message_types_by_name['DescribeClosedStreamInfoByPageResponse'] _DESCRIBELIVESTREAMSTATERESPONSE = DESCRIPTOR.message_types_by_name['DescribeLiveStreamStateResponse'] _KILLSTREAMRESPONSE = DESCRIPTOR.message_types_by_name['KillStreamResponse'] _FORBIDSTREAMRESPONSE = DESCRIPTOR.message_types_by_name['ForbidStreamResponse'] _DESCRIBEFORBIDDENSTREAMINFOBYPAGERESPONSE = DESCRIPTOR.message_types_by_name['DescribeForbiddenStreamInfoByPageResponse'] _RESUMESTREAMRESPONSE = DESCRIPTOR.message_types_by_name['ResumeStreamResponse'] _DESCRIBECDNSNAPSHOTHISTORYRESPONSE = DESCRIPTOR.message_types_by_name['DescribeCDNSnapshotHistoryResponse'] _DESCRIBERECORDTASKFILEHISTORYRESPONSE = DESCRIPTOR.message_types_by_name['DescribeRecordTaskFileHistoryResponse'] _UPDATERELAYSOURCERESPONSE = DESCRIPTOR.message_types_by_name['UpdateRelaySourceResponse'] _DELETERELAYSOURCERESPONSE = DESCRIPTOR.message_types_by_name['DeleteRelaySourceResponse'] _DESCRIBERELAYSOURCERESPONSE = DESCRIPTOR.message_types_by_name['DescribeRelaySourceResponse'] _CREATEVQSCORETASKRESPONSE = DESCRIPTOR.message_types_by_name['CreateVQScoreTaskResponse'] _DESCRIBEVQSCORETASKRESPONSE = DESCRIPTOR.message_types_by_name['DescribeVQScoreTaskResponse'] _LISTVQSCORETASKRESPONSE = DESCRIPTOR.message_types_by_name['ListVQScoreTaskResponse'] _GENERATEPLAYURLRESPONSE = DESCRIPTOR.message_types_by_name['GeneratePlayURLResponse'] _GENERATEPUSHURLRESPONSE = DESCRIPTOR.message_types_by_name['GeneratePushURLResponse'] _CREATEPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['CreatePullToPushTaskResponse'] _LISTPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['ListPullToPushTaskResponse'] _UPDATEPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['UpdatePullToPushTaskResponse'] _RESTARTPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['RestartPullToPushTaskResponse'] _STOPPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['StopPullToPushTaskResponse'] _DELETEPULLTOPUSHTASKRESPONSE = DESCRIPTOR.message_types_by_name['DeletePullToPushTaskResponse'] _UPDATEDENYCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['UpdateDenyConfigResponse'] _DESCRIBEDENYCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['DescribeDenyConfigResponse'] _DELETEDENYCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['DeleteDenyConfigResponse'] CreateDomainResponse = _reflection.GeneratedProtocolMessageType('CreateDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _CREATEDOMAINRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.CreateDomainResponse) }) _sym_db.RegisterMessage(CreateDomainResponse) ListDomainDetailResponse = _reflection.GeneratedProtocolMessageType('ListDomainDetailResponse', (_message.Message,), { 'DESCRIPTOR' : _LISTDOMAINDETAILRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ListDomainDetailResponse) }) _sym_db.RegisterMessage(ListDomainDetailResponse) DisableDomainResponse = _reflection.GeneratedProtocolMessageType('DisableDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _DISABLEDOMAINRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DisableDomainResponse) }) _sym_db.RegisterMessage(DisableDomainResponse) EnableDomainResponse = _reflection.GeneratedProtocolMessageType('EnableDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _ENABLEDOMAINRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.EnableDomainResponse) }) _sym_db.RegisterMessage(EnableDomainResponse) DeleteDomainResponse = _reflection.GeneratedProtocolMessageType('DeleteDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _DELETEDOMAINRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DeleteDomainResponse) }) _sym_db.RegisterMessage(DeleteDomainResponse) DescribeDomainResponse = _reflection.GeneratedProtocolMessageType('DescribeDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDOMAINRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeDomainResponse) }) _sym_db.RegisterMessage(DescribeDomainResponse) ManagerPullPushDomainBindResponse = _reflection.GeneratedProtocolMessageType('ManagerPullPushDomainBindResponse', (_message.Message,), { 'DESCRIPTOR' : _MANAGERPULLPUSHDOMAINBINDRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ManagerPullPushDomainBindResponse) }) _sym_db.RegisterMessage(ManagerPullPushDomainBindResponse) DescribeLiveStreamInfoByPageResponse = _reflection.GeneratedProtocolMessageType('DescribeLiveStreamInfoByPageResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBELIVESTREAMINFOBYPAGERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeLiveStreamInfoByPageResponse) }) _sym_db.RegisterMessage(DescribeLiveStreamInfoByPageResponse) DescribeClosedStreamInfoByPageResponse = _reflection.GeneratedProtocolMessageType('DescribeClosedStreamInfoByPageResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBECLOSEDSTREAMINFOBYPAGERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeClosedStreamInfoByPageResponse) }) _sym_db.RegisterMessage(DescribeClosedStreamInfoByPageResponse) DescribeLiveStreamStateResponse = _reflection.GeneratedProtocolMessageType('DescribeLiveStreamStateResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBELIVESTREAMSTATERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeLiveStreamStateResponse) }) _sym_db.RegisterMessage(DescribeLiveStreamStateResponse) KillStreamResponse = _reflection.GeneratedProtocolMessageType('KillStreamResponse', (_message.Message,), { 'DESCRIPTOR' : _KILLSTREAMRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.KillStreamResponse) }) _sym_db.RegisterMessage(KillStreamResponse) ForbidStreamResponse = _reflection.GeneratedProtocolMessageType('ForbidStreamResponse', (_message.Message,), { 'DESCRIPTOR' : _FORBIDSTREAMRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ForbidStreamResponse) }) _sym_db.RegisterMessage(ForbidStreamResponse) DescribeForbiddenStreamInfoByPageResponse = _reflection.GeneratedProtocolMessageType('DescribeForbiddenStreamInfoByPageResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEFORBIDDENSTREAMINFOBYPAGERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeForbiddenStreamInfoByPageResponse) }) _sym_db.RegisterMessage(DescribeForbiddenStreamInfoByPageResponse) ResumeStreamResponse = _reflection.GeneratedProtocolMessageType('ResumeStreamResponse', (_message.Message,), { 'DESCRIPTOR' : _RESUMESTREAMRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ResumeStreamResponse) }) _sym_db.RegisterMessage(ResumeStreamResponse) DescribeCDNSnapshotHistoryResponse = _reflection.GeneratedProtocolMessageType('DescribeCDNSnapshotHistoryResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBECDNSNAPSHOTHISTORYRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeCDNSnapshotHistoryResponse) }) _sym_db.RegisterMessage(DescribeCDNSnapshotHistoryResponse) DescribeRecordTaskFileHistoryResponse = _reflection.GeneratedProtocolMessageType('DescribeRecordTaskFileHistoryResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBERECORDTASKFILEHISTORYRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeRecordTaskFileHistoryResponse) }) _sym_db.RegisterMessage(DescribeRecordTaskFileHistoryResponse) UpdateRelaySourceResponse = _reflection.GeneratedProtocolMessageType('UpdateRelaySourceResponse', (_message.Message,), { 'DESCRIPTOR' : _UPDATERELAYSOURCERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.UpdateRelaySourceResponse) }) _sym_db.RegisterMessage(UpdateRelaySourceResponse) DeleteRelaySourceResponse = _reflection.GeneratedProtocolMessageType('DeleteRelaySourceResponse', (_message.Message,), { 'DESCRIPTOR' : _DELETERELAYSOURCERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DeleteRelaySourceResponse) }) _sym_db.RegisterMessage(DeleteRelaySourceResponse) DescribeRelaySourceResponse = _reflection.GeneratedProtocolMessageType('DescribeRelaySourceResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBERELAYSOURCERESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeRelaySourceResponse) }) _sym_db.RegisterMessage(DescribeRelaySourceResponse) CreateVQScoreTaskResponse = _reflection.GeneratedProtocolMessageType('CreateVQScoreTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _CREATEVQSCORETASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.CreateVQScoreTaskResponse) }) _sym_db.RegisterMessage(CreateVQScoreTaskResponse) DescribeVQScoreTaskResponse = _reflection.GeneratedProtocolMessageType('DescribeVQScoreTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVQSCORETASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeVQScoreTaskResponse) }) _sym_db.RegisterMessage(DescribeVQScoreTaskResponse) ListVQScoreTaskResponse = _reflection.GeneratedProtocolMessageType('ListVQScoreTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _LISTVQSCORETASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ListVQScoreTaskResponse) }) _sym_db.RegisterMessage(ListVQScoreTaskResponse) GeneratePlayURLResponse = _reflection.GeneratedProtocolMessageType('GeneratePlayURLResponse', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPLAYURLRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.GeneratePlayURLResponse) }) _sym_db.RegisterMessage(GeneratePlayURLResponse) GeneratePushURLResponse = _reflection.GeneratedProtocolMessageType('GeneratePushURLResponse', (_message.Message,), { 'DESCRIPTOR' : _GENERATEPUSHURLRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.GeneratePushURLResponse) }) _sym_db.RegisterMessage(GeneratePushURLResponse) CreatePullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('CreatePullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _CREATEPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.CreatePullToPushTaskResponse) }) _sym_db.RegisterMessage(CreatePullToPushTaskResponse) ListPullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('ListPullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _LISTPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.ListPullToPushTaskResponse) }) _sym_db.RegisterMessage(ListPullToPushTaskResponse) UpdatePullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('UpdatePullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _UPDATEPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.UpdatePullToPushTaskResponse) }) _sym_db.RegisterMessage(UpdatePullToPushTaskResponse) RestartPullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('RestartPullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _RESTARTPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.RestartPullToPushTaskResponse) }) _sym_db.RegisterMessage(RestartPullToPushTaskResponse) StopPullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('StopPullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _STOPPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.StopPullToPushTaskResponse) }) _sym_db.RegisterMessage(StopPullToPushTaskResponse) DeletePullToPushTaskResponse = _reflection.GeneratedProtocolMessageType('DeletePullToPushTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _DELETEPULLTOPUSHTASKRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DeletePullToPushTaskResponse) }) _sym_db.RegisterMessage(DeletePullToPushTaskResponse) UpdateDenyConfigResponse = _reflection.GeneratedProtocolMessageType('UpdateDenyConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _UPDATEDENYCONFIGRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.UpdateDenyConfigResponse) }) _sym_db.RegisterMessage(UpdateDenyConfigResponse) DescribeDenyConfigResponse = _reflection.GeneratedProtocolMessageType('DescribeDenyConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEDENYCONFIGRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DescribeDenyConfigResponse) }) _sym_db.RegisterMessage(DescribeDenyConfigResponse) DeleteDenyConfigResponse = _reflection.GeneratedProtocolMessageType('DeleteDenyConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _DELETEDENYCONFIGRESPONSE, '__module__' : 'live.response.response_live_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Live.Models.Response.DeleteDenyConfigResponse) }) _sym_db.RegisterMessage(DeleteDenyConfigResponse) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n*com.volcengine.service.live.model.responseB\014LiveResponseP\001ZBgithub.com/volcengine/volc-sdk-golang/service/live/models/response\240\001\001\330\001\001\312\002!Volc\\Service\\Live\\Models\\Response\342\002$Volc\\Service\\Live\\Models\\GPBMetadata' _CREATEDOMAINRESPONSE._serialized_start=378 _CREATEDOMAINRESPONSE._serialized_end=473 _LISTDOMAINDETAILRESPONSE._serialized_start=476 _LISTDOMAINDETAILRESPONSE._serialized_end=640 _DISABLEDOMAINRESPONSE._serialized_start=642 _DISABLEDOMAINRESPONSE._serialized_end=738 _ENABLEDOMAINRESPONSE._serialized_start=740 _ENABLEDOMAINRESPONSE._serialized_end=835 _DELETEDOMAINRESPONSE._serialized_start=837 _DELETEDOMAINRESPONSE._serialized_end=932 _DESCRIBEDOMAINRESPONSE._serialized_start=935 _DESCRIBEDOMAINRESPONSE._serialized_end=1097 _MANAGERPULLPUSHDOMAINBINDRESPONSE._serialized_start=1099 _MANAGERPULLPUSHDOMAINBINDRESPONSE._serialized_end=1207 _DESCRIBELIVESTREAMINFOBYPAGERESPONSE._serialized_start=1210 _DESCRIBELIVESTREAMINFOBYPAGERESPONSE._serialized_end=1386 _DESCRIBECLOSEDSTREAMINFOBYPAGERESPONSE._serialized_start=1389 _DESCRIBECLOSEDSTREAMINFOBYPAGERESPONSE._serialized_end=1569 _DESCRIBELIVESTREAMSTATERESPONSE._serialized_start=1572 _DESCRIBELIVESTREAMSTATERESPONSE._serialized_end=1744 _KILLSTREAMRESPONSE._serialized_start=1746 _KILLSTREAMRESPONSE._serialized_end=1839 _FORBIDSTREAMRESPONSE._serialized_start=1841 _FORBIDSTREAMRESPONSE._serialized_end=1936 _DESCRIBEFORBIDDENSTREAMINFOBYPAGERESPONSE._serialized_start=1939 _DESCRIBEFORBIDDENSTREAMINFOBYPAGERESPONSE._serialized_end=2125 _RESUMESTREAMRESPONSE._serialized_start=2127 _RESUMESTREAMRESPONSE._serialized_end=2222 _DESCRIBECDNSNAPSHOTHISTORYRESPONSE._serialized_start=2225 _DESCRIBECDNSNAPSHOTHISTORYRESPONSE._serialized_end=2407 _DESCRIBERECORDTASKFILEHISTORYRESPONSE._serialized_start=2410 _DESCRIBERECORDTASKFILEHISTORYRESPONSE._serialized_end=2590 _UPDATERELAYSOURCERESPONSE._serialized_start=2592 _UPDATERELAYSOURCERESPONSE._serialized_end=2692 _DELETERELAYSOURCERESPONSE._serialized_start=2694 _DELETERELAYSOURCERESPONSE._serialized_end=2794 _DESCRIBERELAYSOURCERESPONSE._serialized_start=2797 _DESCRIBERELAYSOURCERESPONSE._serialized_end=2971 _CREATEVQSCORETASKRESPONSE._serialized_start=2974 _CREATEVQSCORETASKRESPONSE._serialized_end=3134 _DESCRIBEVQSCORETASKRESPONSE._serialized_start=3137 _DESCRIBEVQSCORETASKRESPONSE._serialized_end=3301 _LISTVQSCORETASKRESPONSE._serialized_start=3304 _LISTVQSCORETASKRESPONSE._serialized_end=3472 _GENERATEPLAYURLRESPONSE._serialized_start=3475 _GENERATEPLAYURLRESPONSE._serialized_end=3645 _GENERATEPUSHURLRESPONSE._serialized_start=3648 _GENERATEPUSHURLRESPONSE._serialized_end=3818 _CREATEPULLTOPUSHTASKRESPONSE._serialized_start=3821 _CREATEPULLTOPUSHTASKRESPONSE._serialized_end=4001 _LISTPULLTOPUSHTASKRESPONSE._serialized_start=4004 _LISTPULLTOPUSHTASKRESPONSE._serialized_end=4180 _UPDATEPULLTOPUSHTASKRESPONSE._serialized_start=4182 _UPDATEPULLTOPUSHTASKRESPONSE._serialized_end=4285 _RESTARTPULLTOPUSHTASKRESPONSE._serialized_start=4287 _RESTARTPULLTOPUSHTASKRESPONSE._serialized_end=4391 _STOPPULLTOPUSHTASKRESPONSE._serialized_start=4393 _STOPPULLTOPUSHTASKRESPONSE._serialized_end=4494 _DELETEPULLTOPUSHTASKRESPONSE._serialized_start=4496 _DELETEPULLTOPUSHTASKRESPONSE._serialized_end=4599 _UPDATEDENYCONFIGRESPONSE._serialized_start=4601 _UPDATEDENYCONFIGRESPONSE._serialized_end=4700 _DESCRIBEDENYCONFIGRESPONSE._serialized_start=4703 _DESCRIBEDENYCONFIGRESPONSE._serialized_end=4879 _DELETEDENYCONFIGRESPONSE._serialized_start=4881 _DELETEDENYCONFIGRESPONSE._serialized_end=4980 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/live/v20230101/__init__.py ================================================ __version__ = '1.0.0' ================================================ FILE: volcengine/live/v20230101/live_config.py ================================================ # coding:utf-8 from volcengine.ServiceInfo import ServiceInfo from volcengine.Credentials import Credentials from volcengine.ApiInfo import ApiInfo service_info_map = { 'cn-north-1': ServiceInfo( 'live.volcengineapi.com', {'Accept': 'application/json'}, Credentials('', '', 'live', 'cn-north-1'), 10, 10, "https") } api_info = { "DeleteTranscodePreset": ApiInfo("POST", "/", {"Action": "DeleteTranscodePreset", "Version": "2023-01-01"}, {}, {}), "UpdateTranscodePreset": ApiInfo("POST", "/", {"Action": "UpdateTranscodePreset", "Version": "2023-01-01"}, {}, {}), "ListCommonTransPresetDetail": ApiInfo("POST", "/", {"Action": "ListCommonTransPresetDetail", "Version": "2023-01-01"}, {}, {}), "TranscodingJobStatus": ApiInfo("GET", "/", {"Action": "TranscodingJobStatus", "Version": "2023-01-01"}, {}, {}), "ListVhostTransCodePreset": ApiInfo("POST", "/", {"Action": "ListVhostTransCodePreset", "Version": "2023-01-01"}, {}, {}), "CreateTranscodePreset": ApiInfo("POST", "/", {"Action": "CreateTranscodePreset", "Version": "2023-01-01"}, {}, {}), "RestartTranscodingJob": ApiInfo("GET", "/", {"Action": "RestartTranscodingJob", "Version": "2023-01-01"}, {}, {}), "DeleteWatermarkPresetV2": ApiInfo("POST", "/", {"Action": "DeleteWatermarkPresetV2", "Version": "2023-01-01"}, {}, {}), "UpdateWatermarkPresetV2": ApiInfo("POST", "/", {"Action": "UpdateWatermarkPresetV2", "Version": "2023-01-01"}, {}, {}), "ListWatermarkPresetDetail": ApiInfo("POST", "/", {"Action": "ListWatermarkPresetDetail", "Version": "2023-01-01"}, {}, {}), "CreateWatermarkPresetV2": ApiInfo("POST", "/", {"Action": "CreateWatermarkPresetV2", "Version": "2023-01-01"}, {}, {}), "CreateWatermarkPreset": ApiInfo("POST", "/", {"Action": "CreateWatermarkPreset", "Version": "2023-01-01"}, {}, {}), "UpdateWatermarkPreset": ApiInfo("POST", "/", {"Action": "UpdateWatermarkPreset", "Version": "2023-01-01"}, {}, {}), "DeleteWatermarkPreset": ApiInfo("POST", "/", {"Action": "DeleteWatermarkPreset", "Version": "2023-01-01"}, {}, {}), "ListWatermarkPreset": ApiInfo("POST", "/", {"Action": "ListWatermarkPreset", "Version": "2023-01-01"}, {}, {}), "ListVhostWatermarkPreset": ApiInfo("POST", "/", {"Action": "ListVhostWatermarkPreset", "Version": "2023-01-01"}, {}, {}), "StopPullRecordTask": ApiInfo("POST", "/", {"Action": "StopPullRecordTask", "Version": "2023-01-01"}, {}, {}), "CreateLiveStreamRecordIndexFiles": ApiInfo("POST", "/", {"Action": "CreateLiveStreamRecordIndexFiles", "Version": "2023-01-01"}, {}, {}), "CreatePullRecordTask": ApiInfo("POST", "/", {"Action": "CreatePullRecordTask", "Version": "2023-01-01"}, {}, {}), "DeleteRecordPreset": ApiInfo("POST", "/", {"Action": "DeleteRecordPreset", "Version": "2023-01-01"}, {}, {}), "UpdateRecordPresetV2": ApiInfo("POST", "/", {"Action": "UpdateRecordPresetV2", "Version": "2023-01-01"}, {}, {}), "GetPullRecordTask": ApiInfo("POST", "/", {"Action": "GetPullRecordTask", "Version": "2023-01-01"}, {}, {}), "DescribeRecordTaskFileHistory": ApiInfo("POST", "/", {"Action": "DescribeRecordTaskFileHistory", "Version": "2023-01-01"}, {}, {}), "ListVhostRecordPresetV2": ApiInfo("POST", "/", {"Action": "ListVhostRecordPresetV2", "Version": "2023-01-01"}, {}, {}), "ListPullRecordTask": ApiInfo("POST", "/", {"Action": "ListPullRecordTask", "Version": "2023-01-01"}, {}, {}), "CreateRecordPresetV2": ApiInfo("POST", "/", {"Action": "CreateRecordPresetV2", "Version": "2023-01-01"}, {}, {}), "DeleteSnapshotPreset": ApiInfo("POST", "/", {"Action": "DeleteSnapshotPreset", "Version": "2023-01-01"}, {}, {}), "UpdateSnapshotPresetV2": ApiInfo("POST", "/", {"Action": "UpdateSnapshotPresetV2", "Version": "2023-01-01"}, {}, {}), "DescribeCDNSnapshotHistory": ApiInfo("POST", "/", {"Action": "DescribeCDNSnapshotHistory", "Version": "2023-01-01"}, {}, {}), "ListVhostSnapshotPresetV2": ApiInfo("POST", "/", {"Action": "ListVhostSnapshotPresetV2", "Version": "2023-01-01"}, {}, {}), "CreateSnapshotPresetV2": ApiInfo("POST", "/", {"Action": "CreateSnapshotPresetV2", "Version": "2023-01-01"}, {}, {}), "DeleteTimeShiftPresetV3": ApiInfo("POST", "/", {"Action": "DeleteTimeShiftPresetV3", "Version": "2023-01-01"}, {}, {}), "UpdateTimeShiftPresetV3": ApiInfo("POST", "/", {"Action": "UpdateTimeShiftPresetV3", "Version": "2023-01-01"}, {}, {}), "ListTimeShiftPresetV2": ApiInfo("POST", "/", {"Action": "ListTimeShiftPresetV2", "Version": "2023-01-01"}, {}, {}), "CreateTimeShiftPresetV3": ApiInfo("POST", "/", {"Action": "CreateTimeShiftPresetV3", "Version": "2023-01-01"}, {}, {}), "DeleteCallback": ApiInfo("POST", "/", {"Action": "DeleteCallback", "Version": "2023-01-01"}, {}, {}), "DescribeCallback": ApiInfo("POST", "/", {"Action": "DescribeCallback", "Version": "2023-01-01"}, {}, {}), "UpdateCallback": ApiInfo("POST", "/", {"Action": "UpdateCallback", "Version": "2023-01-01"}, {}, {}), "DeleteCert": ApiInfo("POST", "/", {"Action": "DeleteCert", "Version": "2023-01-01"}, {}, {}), "DescribeCertDetailSecretV2": ApiInfo("POST", "/", {"Action": "DescribeCertDetailSecretV2", "Version": "2023-01-01"}, {}, {}), "ListCertV2": ApiInfo("POST", "/", {"Action": "ListCertV2", "Version": "2023-01-01"}, {}, {}), "CreateCert": ApiInfo("POST", "/", {"Action": "CreateCert", "Version": "2023-01-01"}, {}, {}), "BindCert": ApiInfo("POST", "/", {"Action": "BindCert", "Version": "2023-01-01"}, {}, {}), "UnbindCert": ApiInfo("POST", "/", {"Action": "UnbindCert", "Version": "2023-01-01"}, {}, {}), "DeleteDomain": ApiInfo("POST", "/", {"Action": "DeleteDomain", "Version": "2023-01-01"}, {}, {}), "EnableDomain": ApiInfo("POST", "/", {"Action": "EnableDomain", "Version": "2023-01-01"}, {}, {}), "CreateDomainV2": ApiInfo("POST", "/", {"Action": "CreateDomainV2", "Version": "2023-01-01"}, {}, {}), "UpdateDomainVhost": ApiInfo("POST", "/", {"Action": "UpdateDomainVhost", "Version": "2023-01-01"}, {}, {}), "DescribeDomain": ApiInfo("POST", "/", {"Action": "DescribeDomain", "Version": "2023-01-01"}, {}, {}), "ListDomainDetail": ApiInfo("POST", "/", {"Action": "ListDomainDetail", "Version": "2023-01-01"}, {}, {}), "CreateDomain": ApiInfo("POST", "/", {"Action": "CreateDomain", "Version": "2023-01-01"}, {}, {}), "DisableDomain": ApiInfo("POST", "/", {"Action": "DisableDomain", "Version": "2023-01-01"}, {}, {}), "CreateLiveVideoQualityAnalysisTask": ApiInfo("POST", "/", {"Action": "CreateLiveVideoQualityAnalysisTask", "Version": "2023-01-01"}, {}, {}), "DeleteLiveVideoQualityAnalysisTask": ApiInfo("POST", "/", {"Action": "DeleteLiveVideoQualityAnalysisTask", "Version": "2023-01-01"}, {}, {}), "GetLiveVideoQualityAnalysisTaskDetail": ApiInfo("POST", "/", {"Action": "GetLiveVideoQualityAnalysisTaskDetail", "Version": "2023-01-01"}, {}, {}), "ListLiveVideoQualityAnalysisTasks": ApiInfo("POST", "/", {"Action": "ListLiveVideoQualityAnalysisTasks", "Version": "2023-01-01"}, {}, {}), "StopPullToPushTask": ApiInfo("POST", "/", {"Action": "StopPullToPushTask", "Version": "2023-01-01"}, {}, {}), "CreatePullToPushTask": ApiInfo("POST", "/", {"Action": "CreatePullToPushTask", "Version": "2023-01-01"}, {}, {}), "CreatePullToPushGroup": ApiInfo("POST", "/", {"Action": "CreatePullToPushGroup", "Version": "2023-01-01"}, {}, {}), "DeletePullToPushTask": ApiInfo("POST", "/", {"Action": "DeletePullToPushTask", "Version": "2023-01-01"}, {}, {}), "DeletePullToPushGroup": ApiInfo("POST", "/", {"Action": "DeletePullToPushGroup", "Version": "2023-01-01"}, {}, {}), "ContinuePullToPushTask": ApiInfo("POST", "/", {"Action": "ContinuePullToPushTask", "Version": "2023-01-01"}, {}, {}), "UpdatePullToPushTask": ApiInfo("POST", "/", {"Action": "UpdatePullToPushTask", "Version": "2023-01-01"}, {}, {}), "UpdatePullToPushGroup": ApiInfo("POST", "/", {"Action": "UpdatePullToPushGroup", "Version": "2023-01-01"}, {}, {}), "ListPullToPushGroup": ApiInfo("POST", "/", {"Action": "ListPullToPushGroup", "Version": "2023-01-01"}, {}, {}), "ListPullToPushTask": ApiInfo("GET", "/", {"Action": "ListPullToPushTask", "Version": "2023-01-01"}, {}, {}), "ListPullToPushTaskV2": ApiInfo("POST", "/", {"Action": "ListPullToPushTaskV2", "Version": "2023-01-01"}, {}, {}), "RelaunchPullToPushTask": ApiInfo("POST", "/", {"Action": "RelaunchPullToPushTask", "Version": "2023-01-01"}, {}, {}), "DeleteRelaySourceV4": ApiInfo("POST", "/", {"Action": "DeleteRelaySourceV4", "Version": "2023-01-01"}, {}, {}), "DeleteRelaySourceV3": ApiInfo("POST", "/", {"Action": "DeleteRelaySourceV3", "Version": "2023-01-01"}, {}, {}), "UpdateRelaySourceV4": ApiInfo("POST", "/", {"Action": "UpdateRelaySourceV4", "Version": "2023-01-01"}, {}, {}), "ListRelaySourceV4": ApiInfo("POST", "/", {"Action": "ListRelaySourceV4", "Version": "2023-01-01"}, {}, {}), "DescribeRelaySourceV3": ApiInfo("POST", "/", {"Action": "DescribeRelaySourceV3", "Version": "2023-01-01"}, {}, {}), "CreateRelaySourceV4": ApiInfo("POST", "/", {"Action": "CreateRelaySourceV4", "Version": "2023-01-01"}, {}, {}), "UpdateRelaySourceV3": ApiInfo("POST", "/", {"Action": "UpdateRelaySourceV3", "Version": "2023-01-01"}, {}, {}), "DescribeLiveStreamGroupByPage": ApiInfo("POST", "/", {"Action": "DescribeLiveStreamGroupByPage", "Version": "2023-01-01"}, {}, {}), "DescribeForbiddenStreamGroupByPage": ApiInfo("POST", "/", {"Action": "DescribeForbiddenStreamGroupByPage", "Version": "2023-01-01"}, {}, {}), "KillStream": ApiInfo("POST", "/", {"Action": "KillStream", "Version": "2023-01-01"}, {}, {}), "DescribeClosedStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeClosedStreamInfoByPage", "Version": "2023-01-01"}, {}, {}), "DescribeLiveStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeLiveStreamInfoByPage", "Version": "2023-01-01"}, {}, {}), "DescribeLiveStreamState": ApiInfo("GET", "/", {"Action": "DescribeLiveStreamState", "Version": "2023-01-01"}, {}, {}), "DescribeForbiddenStreamInfoByPage": ApiInfo("GET", "/", {"Action": "DescribeForbiddenStreamInfoByPage", "Version": "2023-01-01"}, {}, {}), "ForbidStream": ApiInfo("POST", "/", {"Action": "ForbidStream", "Version": "2023-01-01"}, {}, {}), "ResumeStream": ApiInfo("POST", "/", {"Action": "ResumeStream", "Version": "2023-01-01"}, {}, {}), "GeneratePlayURL": ApiInfo("POST", "/", {"Action": "GeneratePlayURL", "Version": "2023-01-01"}, {}, {}), "GeneratePushURL": ApiInfo("POST", "/", {"Action": "GeneratePushURL", "Version": "2023-01-01"}, {}, {}), "DeleteStreamQuotaConfig": ApiInfo("POST", "/", {"Action": "DeleteStreamQuotaConfig", "Version": "2023-01-01"}, {}, {}), "DescribeStreamQuotaConfig": ApiInfo("POST", "/", {"Action": "DescribeStreamQuotaConfig", "Version": "2023-01-01"}, {}, {}), "UpdateStreamQuotaConfig": ApiInfo("POST", "/", {"Action": "UpdateStreamQuotaConfig", "Version": "2023-01-01"}, {}, {}), "DeleteSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "DeleteSnapshotAuditPreset", "Version": "2023-01-01"}, {}, {}), "UpdateSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "UpdateSnapshotAuditPreset", "Version": "2023-01-01"}, {}, {}), "ListVhostSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "ListVhostSnapshotAuditPreset", "Version": "2023-01-01"}, {}, {}), "CreateSnapshotAuditPreset": ApiInfo("POST", "/", {"Action": "CreateSnapshotAuditPreset", "Version": "2023-01-01"}, {}, {}), "DescribeIpInfo": ApiInfo("POST", "/", {"Action": "DescribeIpInfo", "Version": "2023-01-01"}, {}, {}), "DescribeLiveTopPlayData": ApiInfo("POST", "/", {"Action": "DescribeLiveTopPlayData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveRegionData": ApiInfo("POST", "/", {"Action": "DescribeLiveRegionData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveSourceStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveSourceStreamMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLivePushStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLivePushStreamMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLiveCallbackData": ApiInfo("POST", "/", {"Action": "DescribeLiveCallbackData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchStreamSessionData": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchStreamSessionData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveStreamSessionData": ApiInfo("POST", "/", {"Action": "DescribeLiveStreamSessionData", "Version": "2023-01-01"}, {}, {}), "DescribeLivePlayStatusCodeData": ApiInfo("POST", "/", {"Action": "DescribeLivePlayStatusCodeData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchSourceStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchSourceStreamMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchSourceStreamAvgMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchSourceStreamAvgMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchPushStreamMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchPushStreamMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchPushStreamAvgMetrics": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchPushStreamAvgMetrics", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchStreamTranscodeData": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchStreamTranscodeData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveStreamCountData": ApiInfo("POST", "/", {"Action": "DescribeLiveStreamCountData", "Version": "2023-01-01"}, {}, {}), "DescribeLivePushStreamCountData": ApiInfo("POST", "/", {"Action": "DescribeLivePushStreamCountData", "Version": "2023-01-01"}, {}, {}), "DescribeLivePushStreamInfoData": ApiInfo("POST", "/", {"Action": "DescribeLivePushStreamInfoData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveTranscodeInfoData": ApiInfo("POST", "/", {"Action": "DescribeLiveTranscodeInfoData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveSourceBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveSourceBandwidthData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveSourceTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveSourceTrafficData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveMetricBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveMetricBandwidthData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveMetricTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveMetricTrafficData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBatchStreamTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveBatchStreamTrafficData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveEdgeStatData": ApiInfo("POST", "/", {"Action": "DescribeLiveEdgeStatData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveISPData": ApiInfo("POST", "/", {"Action": "DescribeLiveISPData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveP95PeakBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveP95PeakBandwidthData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveAuditData": ApiInfo("POST", "/", {"Action": "DescribeLiveAuditData", "Version": "2023-01-01"}, {}, {}), "DescribeLivePullToPushBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLivePullToPushBandwidthData", "Version": "2023-01-01"}, {}, {}), "DescribeLivePullToPushData": ApiInfo("POST", "/", {"Action": "DescribeLivePullToPushData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveBandwidthData": ApiInfo("POST", "/", {"Action": "DescribeLiveBandwidthData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveRecordData": ApiInfo("POST", "/", {"Action": "DescribeLiveRecordData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveSnapshotData": ApiInfo("POST", "/", {"Action": "DescribeLiveSnapshotData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveTrafficData": ApiInfo("POST", "/", {"Action": "DescribeLiveTrafficData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveTranscodeData": ApiInfo("POST", "/", {"Action": "DescribeLiveTranscodeData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveTimeShiftData": ApiInfo("POST", "/", {"Action": "DescribeLiveTimeShiftData", "Version": "2023-01-01"}, {}, {}), "DescribeLiveLogData": ApiInfo("POST", "/", {"Action": "DescribeLiveLogData", "Version": "2023-01-01"}, {}, {}), "DeleteReferer": ApiInfo("POST", "/", {"Action": "DeleteReferer", "Version": "2023-01-01"}, {}, {}), "DescribeReferer": ApiInfo("POST", "/", {"Action": "DescribeReferer", "Version": "2023-01-01"}, {}, {}), "DescribeAuth": ApiInfo("POST", "/", {"Action": "DescribeAuth", "Version": "2023-01-01"}, {}, {}), "UpdateReferer": ApiInfo("POST", "/", {"Action": "UpdateReferer", "Version": "2023-01-01"}, {}, {}), "UpdateAuthKey": ApiInfo("POST", "/", {"Action": "UpdateAuthKey", "Version": "2023-01-01"}, {}, {}), "DeleteHTTPHeaderConfig": ApiInfo("POST", "/", {"Action": "DeleteHTTPHeaderConfig", "Version": "2023-01-01"}, {}, {}), "EnableHTTPHeaderConfig": ApiInfo("POST", "/", {"Action": "EnableHTTPHeaderConfig", "Version": "2023-01-01"}, {}, {}), "DescribeHTTPHeaderConfig": ApiInfo("POST", "/", {"Action": "DescribeHTTPHeaderConfig", "Version": "2023-01-01"}, {}, {}), "UpdateHTTPHeaderConfig": ApiInfo("POST", "/", {"Action": "UpdateHTTPHeaderConfig", "Version": "2023-01-01"}, {}, {}), "UpdateEncryptDRM": ApiInfo("POST", "/", {"Action": "UpdateEncryptDRM", "Version": "2023-01-01"}, {}, {}), "UpdateEncryptHLS": ApiInfo("POST", "/", {"Action": "UpdateEncryptHLS", "Version": "2023-01-01"}, {}, {}), "GetHLSEncryptDataKey": ApiInfo("GET", "/", {"Action": "GetHLSEncryptDataKey", "Version": "2023-01-01"}, {}, {}), "DescribeEncryptHLS": ApiInfo("POST", "/", {"Action": "DescribeEncryptHLS", "Version": "2023-01-01"}, {}, {}), "DescribeLicenseDRM": ApiInfo("POST", "/", {"Action": "DescribeLicenseDRM", "Version": "2023-01-01"}, {}, {}), "DescribeCertDRM": ApiInfo("GET", "/", {"Action": "DescribeCertDRM", "Version": "2023-01-01"}, {}, {}), "DescribeEncryptDRM": ApiInfo("POST", "/", {"Action": "DescribeEncryptDRM", "Version": "2023-01-01"}, {}, {}), "BindEncryptDRM": ApiInfo("POST", "/", {"Action": "BindEncryptDRM", "Version": "2023-01-01"}, {}, {}), "UnBindEncryptDRM": ApiInfo("POST", "/", {"Action": "UnBindEncryptDRM", "Version": "2023-01-01"}, {}, {}), "ListBindEncryptDRM": ApiInfo("POST", "/", {"Action": "ListBindEncryptDRM", "Version": "2023-01-01"}, {}, {}), "DeleteIPAccessRule": ApiInfo("POST", "/", {"Action": "DeleteIPAccessRule", "Version": "2023-01-01"}, {}, {}), "UpdateIPAccessRule": ApiInfo("POST", "/", {"Action": "UpdateIPAccessRule", "Version": "2023-01-01"}, {}, {}), "DescribeIPAccessRule": ApiInfo("POST", "/", {"Action": "DescribeIPAccessRule", "Version": "2023-01-01"}, {}, {}), "CreateCloudMixTask": ApiInfo("POST", "/", {"Action": "CreateCloudMixTask", "Version": "2023-01-01"}, {}, {}), "UpdateCloudMixTask": ApiInfo("POST", "/", {"Action": "UpdateCloudMixTask", "Version": "2023-01-01"}, {}, {}), "GetCloudMixTaskDetail": ApiInfo("POST", "/", {"Action": "GetCloudMixTaskDetail", "Version": "2023-01-01"}, {}, {}), "ListCloudMixTask": ApiInfo("POST", "/", {"Action": "ListCloudMixTask", "Version": "2023-01-01"}, {}, {}), "DeleteCloudMixTask": ApiInfo("POST", "/", {"Action": "DeleteCloudMixTask", "Version": "2023-01-01"}, {}, {}), "DeleteSubtitleTranscodePreset": ApiInfo("POST", "/", {"Action": "DeleteSubtitleTranscodePreset", "Version": "2023-01-01"}, {}, {}), "UpdateSubtitleTranscodePreset": ApiInfo("POST", "/", {"Action": "UpdateSubtitleTranscodePreset", "Version": "2023-01-01"}, {}, {}), "ListVhostSubtitleTranscodePreset": ApiInfo("POST", "/", {"Action": "ListVhostSubtitleTranscodePreset", "Version": "2023-01-01"}, {}, {}), "CreateSubtitleTranscodePreset": ApiInfo("POST", "/", {"Action": "CreateSubtitleTranscodePreset", "Version": "2023-01-01"}, {}, {}), "CreateLivePadPreset": ApiInfo("POST", "/", {"Action": "CreateLivePadPreset", "Version": "2023-01-01"}, {}, {}), "DeleteLivePadPreset": ApiInfo("POST", "/", {"Action": "DeleteLivePadPreset", "Version": "2023-01-01"}, {}, {}), "StopLivePadStream": ApiInfo("POST", "/", {"Action": "StopLivePadStream", "Version": "2023-01-01"}, {}, {}), "UpdateLivePadPreset": ApiInfo("POST", "/", {"Action": "UpdateLivePadPreset", "Version": "2023-01-01"}, {}, {}), "DescribeLivePadStreamList": ApiInfo("POST", "/", {"Action": "DescribeLivePadStreamList", "Version": "2023-01-01"}, {}, {}), "DescribeLivePadPresetDetail": ApiInfo("POST", "/", {"Action": "DescribeLivePadPresetDetail", "Version": "2023-01-01"}, {}, {}), "CreateCarouselTask": ApiInfo("POST", "/", {"Action": "CreateCarouselTask", "Version": "2023-01-01"}, {}, {}), "DeleteCarouselTask": ApiInfo("POST", "/", {"Action": "DeleteCarouselTask", "Version": "2023-01-01"}, {}, {}), "UpdateCarouselTask": ApiInfo("POST", "/", {"Action": "UpdateCarouselTask", "Version": "2023-01-01"}, {}, {}), "GetCarouselDetail": ApiInfo("POST", "/", {"Action": "GetCarouselDetail", "Version": "2023-01-01"}, {}, {}), "ListCarouselTask": ApiInfo("POST", "/", {"Action": "ListCarouselTask", "Version": "2023-01-01"}, {}, {}), "CreateHighLightTask": ApiInfo("POST", "/", {"Action": "CreateHighLightTask", "Version": "2023-01-01"}, {}, {}), "DeleteTaskByAccountID": ApiInfo("POST", "/", {"Action": "DeleteTaskByAccountID", "Version": "2023-01-01"}, {}, {}), "DescribeHighLightTaskByAccountID": ApiInfo("POST", "/", {"Action": "DescribeHighLightTaskByAccountID", "Version": "2023-01-01"}, {}, {}), "ListHighLightTask": ApiInfo("POST", "/", {"Action": "ListHighLightTask", "Version": "2023-01-01"}, {}, {}), "CreateSpeechTask": ApiInfo("POST", "/", {"Action": "CreateSpeechTask", "Version": "2023-01-01"}, {}, {}), "DeleteSpeechTask": ApiInfo("POST", "/", {"Action": "DeleteSpeechTask", "Version": "2023-01-01"}, {}, {}), "SearchSpeechTask": ApiInfo("POST", "/", {"Action": "SearchSpeechTask", "Version": "2023-01-01"}, {}, {}), "UpdateSpeechTask": ApiInfo("POST", "/", {"Action": "UpdateSpeechTask", "Version": "2023-01-01"}, {}, {}), "GetSpeechTask": ApiInfo("POST", "/", {"Action": "GetSpeechTask", "Version": "2023-01-01"}, {}, {}), "GetSpeechConfig": ApiInfo("GET", "/", {"Action": "GetSpeechConfig", "Version": "2023-01-01"}, {}, {}), "RestartSpeechTask": ApiInfo("POST", "/", {"Action": "RestartSpeechTask", "Version": "2023-01-01"}, {}, {}) } ================================================ FILE: volcengine/live/v20230101/live_service.py ================================================ # coding:utf-8 from volcengine.live.v20230101.live_trait import LiveTrait # Modify it if necessary class LiveService(LiveTrait): def __init__(self, host='live.volcengineapi.com', ak=None, sk=None): super().__init__({ 'ak': ak, 'sk': sk, }) self.set_host(host) ================================================ FILE: volcengine/live/v20230101/live_trait.py ================================================ # coding:utf-8 import json from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.util.Util import * from volcengine.Policy import * from volcengine.live.v20230101.live_config import * # Modify it if necessary class LiveTrait(Service): def __init__(self, param=None): if param is None: param = {} self.param = param region = param.get('region', REGION_CN_NORTH1) self.service_info = LiveTrait.get_service_info(region) self.api_info = LiveTrait.get_api_info() if param.get('ak', None) and param.get('sk', None): self.set_ak(param['ak']) self.set_sk(param['sk']) super(LiveTrait, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('Not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info def api_get(self, action, params, doseq=0): res = self.get(action, params, doseq) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(json.dumps(res)) return res_json def api_post(self, action, params, body): res = self.json(action, params, body) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(json.dumps(res)) return res_json def delete_transcode_preset(self, body): res = self.api_post('DeleteTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_transcode_preset(self, body): res = self.api_post('UpdateTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_common_trans_preset_detail(self, body): res = self.api_post('ListCommonTransPresetDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def transcoding_job_status(self, query): res = self.api_get('TranscodingJobStatus', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_trans_code_preset(self, body): res = self.api_post('ListVhostTransCodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_transcode_preset(self, body): res = self.api_post('CreateTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def restart_transcoding_job(self, query): res = self.api_get('RestartTranscodingJob', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_watermark_preset_v2(self, body): res = self.api_post('DeleteWatermarkPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_watermark_preset_v2(self, body): res = self.api_post('UpdateWatermarkPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_watermark_preset_detail(self, body): res = self.api_post('ListWatermarkPresetDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_watermark_preset_v2(self, body): res = self.api_post('CreateWatermarkPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_watermark_preset(self, body): res = self.api_post('CreateWatermarkPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_watermark_preset(self, body): res = self.api_post('UpdateWatermarkPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_watermark_preset(self, body): res = self.api_post('DeleteWatermarkPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_watermark_preset(self, body): res = self.api_post('ListWatermarkPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_watermark_preset(self, body): res = self.api_post('ListVhostWatermarkPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def stop_pull_record_task(self, body): res = self.api_post('StopPullRecordTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_live_stream_record_index_files(self, body): res = self.api_post('CreateLiveStreamRecordIndexFiles', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_pull_record_task(self, body): res = self.api_post('CreatePullRecordTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_record_preset(self, body): res = self.api_post('DeleteRecordPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_record_preset_v2(self, body): res = self.api_post('UpdateRecordPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_pull_record_task(self, body): res = self.api_post('GetPullRecordTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_record_task_file_history(self, body): res = self.api_post('DescribeRecordTaskFileHistory', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_record_preset_v2(self, body): res = self.api_post('ListVhostRecordPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_pull_record_task(self, body): res = self.api_post('ListPullRecordTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_record_preset_v2(self, body): res = self.api_post('CreateRecordPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_snapshot_preset(self, body): res = self.api_post('DeleteSnapshotPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_snapshot_preset_v2(self, body): res = self.api_post('UpdateSnapshotPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_cdn_snapshot_history(self, body): res = self.api_post('DescribeCDNSnapshotHistory', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_snapshot_preset_v2(self, body): res = self.api_post('ListVhostSnapshotPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_snapshot_preset_v2(self, body): res = self.api_post('CreateSnapshotPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_time_shift_preset_v3(self, body): res = self.api_post('DeleteTimeShiftPresetV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_time_shift_preset_v3(self, body): res = self.api_post('UpdateTimeShiftPresetV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_time_shift_preset_v2(self, body): res = self.api_post('ListTimeShiftPresetV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_time_shift_preset_v3(self, body): res = self.api_post('CreateTimeShiftPresetV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_callback(self, body): res = self.api_post('DeleteCallback', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_callback(self, body): res = self.api_post('DescribeCallback', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_callback(self, body): res = self.api_post('UpdateCallback', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_cert(self, body): res = self.api_post('DeleteCert', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_cert_detail_secret_v2(self, body): res = self.api_post('DescribeCertDetailSecretV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_cert_v2(self, body): res = self.api_post('ListCertV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_cert(self, body): res = self.api_post('CreateCert', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def bind_cert(self, body): res = self.api_post('BindCert', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def unbind_cert(self, body): res = self.api_post('UnbindCert', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_domain(self, body): res = self.api_post('DeleteDomain', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def enable_domain(self, body): res = self.api_post('EnableDomain', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_domain_v2(self, body): res = self.api_post('CreateDomainV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_domain_vhost(self, body): res = self.api_post('UpdateDomainVhost', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_domain(self, body): res = self.api_post('DescribeDomain', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_domain_detail(self, body): res = self.api_post('ListDomainDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_domain(self, body): res = self.api_post('CreateDomain', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def disable_domain(self, body): res = self.api_post('DisableDomain', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_live_video_quality_analysis_task(self, body): res = self.api_post('CreateLiveVideoQualityAnalysisTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_live_video_quality_analysis_task(self, body): res = self.api_post('DeleteLiveVideoQualityAnalysisTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_live_video_quality_analysis_task_detail(self, body): res = self.api_post('GetLiveVideoQualityAnalysisTaskDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_live_video_quality_analysis_tasks(self, body): res = self.api_post('ListLiveVideoQualityAnalysisTasks', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def stop_pull_to_push_task(self, body): res = self.api_post('StopPullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_pull_to_push_task(self, body): res = self.api_post('CreatePullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_pull_to_push_group(self, body): res = self.api_post('CreatePullToPushGroup', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_pull_to_push_task(self, body): res = self.api_post('DeletePullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_pull_to_push_group(self, body): res = self.api_post('DeletePullToPushGroup', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def continue_pull_to_push_task(self, body): res = self.api_post('ContinuePullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_pull_to_push_task(self, body): res = self.api_post('UpdatePullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_pull_to_push_group(self, body): res = self.api_post('UpdatePullToPushGroup', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_pull_to_push_group(self, body): res = self.api_post('ListPullToPushGroup', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_pull_to_push_task(self, query): res = self.api_get('ListPullToPushTask', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_pull_to_push_task_v2(self, body): res = self.api_post('ListPullToPushTaskV2', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def relaunch_pull_to_push_task(self, body): res = self.api_post('RelaunchPullToPushTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_relay_source_v4(self, body): res = self.api_post('DeleteRelaySourceV4', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_relay_source_v3(self, body): res = self.api_post('DeleteRelaySourceV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_relay_source_v4(self, body): res = self.api_post('UpdateRelaySourceV4', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_relay_source_v4(self, body): res = self.api_post('ListRelaySourceV4', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_relay_source_v3(self, body): res = self.api_post('DescribeRelaySourceV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_relay_source_v4(self, body): res = self.api_post('CreateRelaySourceV4', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_relay_source_v3(self, body): res = self.api_post('UpdateRelaySourceV3', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_stream_group_by_page(self, body): res = self.api_post('DescribeLiveStreamGroupByPage', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_forbidden_stream_group_by_page(self, body): res = self.api_post('DescribeForbiddenStreamGroupByPage', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def kill_stream(self, body): res = self.api_post('KillStream', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_closed_stream_info_by_page(self, query): res = self.api_get('DescribeClosedStreamInfoByPage', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_stream_info_by_page(self, query): res = self.api_get('DescribeLiveStreamInfoByPage', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_stream_state(self, query): res = self.api_get('DescribeLiveStreamState', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_forbidden_stream_info_by_page(self, query): res = self.api_get('DescribeForbiddenStreamInfoByPage', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def forbid_stream(self, body): res = self.api_post('ForbidStream', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def resume_stream(self, body): res = self.api_post('ResumeStream', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def generate_play_url(self, body): res = self.api_post('GeneratePlayURL', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def generate_push_url(self, body): res = self.api_post('GeneratePushURL', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_stream_quota_config(self, body): res = self.api_post('DeleteStreamQuotaConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_stream_quota_config(self, body): res = self.api_post('DescribeStreamQuotaConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_stream_quota_config(self, body): res = self.api_post('UpdateStreamQuotaConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_snapshot_audit_preset(self, body): res = self.api_post('DeleteSnapshotAuditPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_snapshot_audit_preset(self, body): res = self.api_post('UpdateSnapshotAuditPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_snapshot_audit_preset(self, body): res = self.api_post('ListVhostSnapshotAuditPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_snapshot_audit_preset(self, body): res = self.api_post('CreateSnapshotAuditPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_ip_info(self, body): res = self.api_post('DescribeIpInfo', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_top_play_data(self, body): res = self.api_post('DescribeLiveTopPlayData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_region_data(self, body): res = self.api_post('DescribeLiveRegionData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_source_stream_metrics(self, body): res = self.api_post('DescribeLiveSourceStreamMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_push_stream_metrics(self, body): res = self.api_post('DescribeLivePushStreamMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_callback_data(self, body): res = self.api_post('DescribeLiveCallbackData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_stream_session_data(self, body): res = self.api_post('DescribeLiveBatchStreamSessionData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_stream_session_data(self, body): res = self.api_post('DescribeLiveStreamSessionData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_play_status_code_data(self, body): res = self.api_post('DescribeLivePlayStatusCodeData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_source_stream_metrics(self, body): res = self.api_post('DescribeLiveBatchSourceStreamMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_source_stream_avg_metrics(self, body): res = self.api_post('DescribeLiveBatchSourceStreamAvgMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_push_stream_metrics(self, body): res = self.api_post('DescribeLiveBatchPushStreamMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_push_stream_avg_metrics(self, body): res = self.api_post('DescribeLiveBatchPushStreamAvgMetrics', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_stream_transcode_data(self, body): res = self.api_post('DescribeLiveBatchStreamTranscodeData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_stream_count_data(self, body): res = self.api_post('DescribeLiveStreamCountData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_push_stream_count_data(self, body): res = self.api_post('DescribeLivePushStreamCountData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_push_stream_info_data(self, body): res = self.api_post('DescribeLivePushStreamInfoData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_transcode_info_data(self, body): res = self.api_post('DescribeLiveTranscodeInfoData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_source_bandwidth_data(self, body): res = self.api_post('DescribeLiveSourceBandwidthData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_source_traffic_data(self, body): res = self.api_post('DescribeLiveSourceTrafficData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_metric_bandwidth_data(self, body): res = self.api_post('DescribeLiveMetricBandwidthData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_metric_traffic_data(self, body): res = self.api_post('DescribeLiveMetricTrafficData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_batch_stream_traffic_data(self, body): res = self.api_post('DescribeLiveBatchStreamTrafficData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_edge_stat_data(self, body): res = self.api_post('DescribeLiveEdgeStatData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_isp_data(self, body): res = self.api_post('DescribeLiveISPData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_p95_peak_bandwidth_data(self, body): res = self.api_post('DescribeLiveP95PeakBandwidthData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_audit_data(self, body): res = self.api_post('DescribeLiveAuditData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_pull_to_push_bandwidth_data(self, body): res = self.api_post('DescribeLivePullToPushBandwidthData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_pull_to_push_data(self, body): res = self.api_post('DescribeLivePullToPushData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_bandwidth_data(self, body): res = self.api_post('DescribeLiveBandwidthData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_record_data(self, body): res = self.api_post('DescribeLiveRecordData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_snapshot_data(self, body): res = self.api_post('DescribeLiveSnapshotData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_traffic_data(self, body): res = self.api_post('DescribeLiveTrafficData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_transcode_data(self, body): res = self.api_post('DescribeLiveTranscodeData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_time_shift_data(self, body): res = self.api_post('DescribeLiveTimeShiftData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_log_data(self, body): res = self.api_post('DescribeLiveLogData', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_referer(self, body): res = self.api_post('DeleteReferer', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_referer(self, body): res = self.api_post('DescribeReferer', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_auth(self, body): res = self.api_post('DescribeAuth', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_referer(self, body): res = self.api_post('UpdateReferer', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_auth_key(self, body): res = self.api_post('UpdateAuthKey', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_http_header_config(self, body): res = self.api_post('DeleteHTTPHeaderConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def enable_http_header_config(self, body): res = self.api_post('EnableHTTPHeaderConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_http_header_config(self, body): res = self.api_post('DescribeHTTPHeaderConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_http_header_config(self, body): res = self.api_post('UpdateHTTPHeaderConfig', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_encrypt_drm(self, body): res = self.api_post('UpdateEncryptDRM', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_encrypt_hls(self, body): res = self.api_post('UpdateEncryptHLS', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_hls_encrypt_data_key(self, query): res = self.api_get('GetHLSEncryptDataKey', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_encrypt_hls(self, body): res = self.api_post('DescribeEncryptHLS', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_license_drm(self, query, body): res = self.api_post('DescribeLicenseDRM', query, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_cert_drm(self, query): res = self.api_get('DescribeCertDRM', query) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_encrypt_drm(self, body): res = self.api_post('DescribeEncryptDRM', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def bind_encrypt_drm(self, body): res = self.api_post('BindEncryptDRM', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def un_bind_encrypt_drm(self, body): res = self.api_post('UnBindEncryptDRM', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_bind_encrypt_drm(self, body): res = self.api_post('ListBindEncryptDRM', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_ip_access_rule(self, body): res = self.api_post('DeleteIPAccessRule', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_ip_access_rule(self, body): res = self.api_post('UpdateIPAccessRule', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_ip_access_rule(self, body): res = self.api_post('DescribeIPAccessRule', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_cloud_mix_task(self, body): res = self.api_post('CreateCloudMixTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_cloud_mix_task(self, body): res = self.api_post('UpdateCloudMixTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_cloud_mix_task_detail(self, body): res = self.api_post('GetCloudMixTaskDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_cloud_mix_task(self, body): res = self.api_post('ListCloudMixTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_cloud_mix_task(self, body): res = self.api_post('DeleteCloudMixTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_subtitle_transcode_preset(self, body): res = self.api_post('DeleteSubtitleTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_subtitle_transcode_preset(self, body): res = self.api_post('UpdateSubtitleTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_vhost_subtitle_transcode_preset(self, body): res = self.api_post('ListVhostSubtitleTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_subtitle_transcode_preset(self, body): res = self.api_post('CreateSubtitleTranscodePreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_live_pad_preset(self, body): res = self.api_post('CreateLivePadPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_live_pad_preset(self, body): res = self.api_post('DeleteLivePadPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def stop_live_pad_stream(self, body): res = self.api_post('StopLivePadStream', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_live_pad_preset(self, body): res = self.api_post('UpdateLivePadPreset', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_pad_stream_list(self, body): res = self.api_post('DescribeLivePadStreamList', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_live_pad_preset_detail(self, body): res = self.api_post('DescribeLivePadPresetDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_carousel_task(self, body): res = self.api_post('CreateCarouselTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_carousel_task(self, body): res = self.api_post('DeleteCarouselTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_carousel_task(self, body): res = self.api_post('UpdateCarouselTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_carousel_detail(self, body): res = self.api_post('GetCarouselDetail', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_carousel_task(self, body): res = self.api_post('ListCarouselTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_high_light_task(self, body): res = self.api_post('CreateHighLightTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_task_by_account_id(self, body): res = self.api_post('DeleteTaskByAccountID', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def describe_high_light_task_by_account_id(self, body): res = self.api_post('DescribeHighLightTaskByAccountID', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def list_high_light_task(self, body): res = self.api_post('ListHighLightTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def create_speech_task(self, body): res = self.api_post('CreateSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def delete_speech_task(self, body): res = self.api_post('DeleteSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def search_speech_task(self, body): res = self.api_post('SearchSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def update_speech_task(self, body): res = self.api_post('UpdateSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_speech_task(self, body): res = self.api_post('GetSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_speech_config(self): res = self.api_get('GetSpeechConfig', {}) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def restart_speech_task(self, body): res = self.api_post('RestartSpeechTask', [], json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/livesaas/LivesaasService.py ================================================ # coding:utf-8 import json import os from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.Policy import * import aiohttp from volcengine.auth.SignerV4 import SignerV4 LIVESAAS_SERVICE_NAME = "livesaas" LIVESAAS_API_VERSION = "2020-06-01" service_info_map = { REGION_CN_NORTH1: ServiceInfo( "livesaas.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', LIVESAAS_SERVICE_NAME, REGION_CN_NORTH1), 5, 5, "https"), } api_info = { # 直播间管理类接口 "CreateActivityAPI": ApiInfo("POST", "/", {"Action": "CreateActivityAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "DeleteActivityAPI": ApiInfo("POST", "/", {"Action": "DeleteActivityAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "ListActivityAPI": ApiInfo("GET", "/", {"Action": "ListActivityAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), # 直播控制类接口 "UpdateActivityStatusAPI": ApiInfo("POST", "/", {"Action": "UpdateActivityStatusAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "UpdatePullToPushAPI": ApiInfo("POST", "/", {"Action": "UpdatePullToPushAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "GetActivityAPI": ApiInfo("GET", "/", {"Action": "GetActivityAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "GetStreamsAPI": ApiInfo("GET", "/", {"Action": "GetStreamsAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "UpdateActivityBasicConfigAPI": ApiInfo("POST", "/", {"Action": "UpdateActivityBasicConfigAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "GetActivityBasicConfigAPI": ApiInfo("GET", "/", {"Action": "GetActivityBasicConfigAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "UpdateLoopVideoAPI": ApiInfo("POST", "/", {"Action": "UpdateLoopVideoAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "UpdateLoopVideoStatusAPI": ApiInfo("POST", "/", {"Action": "UpdateLoopVideoStatusAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), # 回放管理类接口 "UploadReplayAPI": ApiInfo("POST", "/", {"Action": "UploadReplayAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "UpdateMediaOnlineStatusAPI": ApiInfo("POST", "/", {"Action": "UpdateMediaOnlineStatusAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "ListMediasAPI": ApiInfo("GET", "/", {"Action": "ListMediasAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), # 评论类接口 "PresenterChatAPI": ApiInfo("POST", "/", {"Action": "PresenterChatAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), "DeleteChatAPI": ApiInfo("POST", "/", {"Action": "DeleteChatAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), # 客户端SDK类接口 "GetSDKTokenAPI": ApiInfo("POST", "/", {"Action": "GetSDKTokenAPI", "Version": LIVESAAS_API_VERSION}, {}, {}), } class LivesaasService(Service): def __init__(self, region=REGION_CN_NORTH1): self.service_info = LivesaasService.get_service_info(region) self.api_info = LivesaasService.get_api_info() super(LivesaasService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info = service_info_map.get(region, None) if not service_info: raise Exception('LivesaasService not support region %s' % region) return service_info @staticmethod def get_api_info(): return api_info async def async_json(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body timeout = aiohttp.ClientTimeout(connect=self.service_info.connection_timeout, sock_connect=self.service_info.socket_timeout) SignerV4.sign(r, self.service_info.credentials) url = r.build() async with aiohttp.request("POST", url, headers=r.headers, data=r.body, timeout=timeout) as r: resp = await r.text(encoding="utf-8") if r.status == 200: return resp else: raise Exception(resp) async def async_get(self, api, params): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) timeout = aiohttp.ClientTimeout(connect=self.service_info.connection_timeout, sock_connect=self.service_info.socket_timeout) SignerV4.sign(r, self.service_info.credentials) url = r.build() async with aiohttp.request("GET", url, headers=r.headers, timeout=timeout) as r: resp = await r.text(encoding="utf-8") if r.status == 200: return resp else: raise Exception(resp) # ========================= 直播间管理类接口 ========================= # CreateActivityAPI def create_activity_api(self, body): res = self.json('CreateActivityAPI', dict(), json.dumps(body)) if res == '': raise Exception("CreateActivityAPI: empty response") res_json = json.loads(res) return res_json async def async_create_activity_api(self, body): res = await self.async_json('CreateActivityAPI', dict(), json.dumps(body)) if res == '': raise Exception("CreateActivityAPI: empty response") res_json = json.loads(res) return res_json # DeleteActivityAPI def delete_activity_api(self, body): res = self.json('DeleteActivityAPI', dict(), json.dumps(body)) if res == '': raise Exception("DeleteActivityAPI: empty response") res_json = json.loads(res) return res_json async def async_delete_activity_api(self, body): res = await self.async_json('DeleteActivityAPI', dict(), json.dumps(body)) if res == '': raise Exception("DeleteActivityAPI: empty response") res_json = json.loads(res) return res_json # ListActivityAPI def list_activity_api(self, params): res = self.get('ListActivityAPI', params) if res == '': raise Exception("ListActivityAPI: empty response") res_json = json.loads(res) return res_json async def async_list_activity_api(self, params): res = await self.async_get('ListActivityAPI', params) if res == '': raise Exception("ListActivityAPI: empty response") res_json = json.loads(res) return res_json # ========================= 直播间控制类接口 ========================= # UpdateActivityStatusAPI def update_activity_status_api(self, body): res = self.json('UpdateActivityStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateActivityStatusAPI: empty response") res_json = json.loads(res) return res_json async def async_update_activity_status_api(self, body): res = await self.async_json('UpdateActivityStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateActivityStatusAPI: empty response") res_json = json.loads(res) return res_json # UpdatePullToPushAPI def update_pull_to_push_api(self, body): res = self.json('UpdatePullToPushAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdatePullToPushAPI: empty response") res_json = json.loads(res) return res_json async def async_update_pull_to_push_api(self, body): res = await self.async_json('UpdatePullToPushAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdatePullToPushAPI: empty response") res_json = json.loads(res) return res_json # GetActivityAPI def get_activity_api(self, params): res = self.get('GetActivityAPI', params) if res == '': raise Exception("GetActivityAPI: empty response") res_json = json.loads(res) return res_json async def async_get_activity_api(self, params): res = await self.async_get('GetActivityAPI', params) if res == '': raise Exception("GetActivityAPI: empty response") res_json = json.loads(res) return res_json # GetStreamsAPI def get_streams_api(self, params): res = self.get('GetStreamsAPI', params) if res == '': raise Exception("GetStreamsAPI: empty response") res_json = json.loads(res) return res_json async def async_get_streams_api(self, params): res = await self.async_get('GetStreamsAPI', params) if res == '': raise Exception("GetStreamsAPI: empty response") res_json = json.loads(res) return res_json # UpdateActivityBasicConfigAPI def update_activity_basic_config_api(self, body): res = self.json('UpdateActivityBasicConfigAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateActivityBasicConfigAPI: empty response") res_json = json.loads(res) return res_json async def async_update_activity_basic_config_api(self, body): res = await self.async_json('UpdateActivityBasicConfigAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateActivityBasicConfigAPI: empty response") res_json = json.loads(res) return res_json # GetActivityBasicConfigAPI def get_activity_basic_config_api(self, params): res = self.get('GetActivityBasicConfigAPI', params) if res == '': raise Exception("GetActivityBasicConfigAPI: empty response") res_json = json.loads(res) return res_json async def async_get_activity_basic_config_api(self, params): res = await self.async_get('GetActivityBasicConfigAPI', params) if res == '': raise Exception("GetActivityBasicConfigAPI: empty response") res_json = json.loads(res) return res_json # UpdateLoopVideoAPI def update_loop_video_api(self, body): res = self.json('UpdateLoopVideoAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateLoopVideoAPI: empty response") res_json = json.loads(res) return res_json async def async_update_loop_video_api(self, body): res = await self.async_json('UpdateLoopVideoAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateLoopVideoAPI: empty response") res_json = json.loads(res) return res_json # UpdateLoopVideoStatusAPI def update_loop_video_status_api(self, body): res = self.json('UpdateLoopVideoStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateLoopVideoStatusAPI: empty response") res_json = json.loads(res) return res_json async def async_update_loop_video_status_api(self, body): res = await self.async_json('UpdateLoopVideoStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateLoopVideoStatusAPI: empty response") res_json = json.loads(res) return res_json # ========================= 回放管理类接口 ========================= # UploadReplayAPI def upload_replay_api(self, body): res = self.json('UploadReplayAPI', dict(), json.dumps(body)) if res == '': raise Exception("UploadReplayAPI: empty response") res_json = json.loads(res) return res_json async def async_upload_replay_api(self, body): res = await self.async_json('UploadReplayAPI', dict(), json.dumps(body)) if res == '': raise Exception("UploadReplayAPI: empty response") res_json = json.loads(res) return res_json # UpdateMediaOnlineStatusAPI def update_media_online_status_api(self, body): res = self.json('UpdateMediaOnlineStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateMediaOnlineStatusAPI: empty response") res_json = json.loads(res) return res_json async def async_update_media_online_status_api(self, body): res = await self.async_json('UpdateMediaOnlineStatusAPI', dict(), json.dumps(body)) if res == '': raise Exception("UpdateMediaOnlineStatusAPI: empty response") res_json = json.loads(res) return res_json # ListMediasAPI def list_medias_api(self, params): res = self.get('ListMediasAPI', params) if res == '': raise Exception("ListMediasAPI: empty response") res_json = json.loads(res) return res_json async def async_list_medias_api(self, params): res = await self.async_get('ListMediasAPI', params) if res == '': raise Exception("ListMediasAPI: empty response") res_json = json.loads(res) return res_json # ========================= 评论类接口 ========================= # PresenterChatAPI def presenter_chat_api(self, body): res = self.json('PresenterChatAPI', dict(), json.dumps(body)) if res == '': raise Exception("PresenterChatAPI: empty response") res_json = json.loads(res) return res_json async def async_presenter_chat_api(self, body): res = await self.async_json('PresenterChatAPI', dict(), json.dumps(body)) if res == '': raise Exception("PresenterChatAPI: empty response") res_json = json.loads(res) return res_json # DeleteChatAPI def delete_chat_api(self, body): res = self.json('DeleteChatAPI', dict(), json.dumps(body)) if res == '': raise Exception("DeleteChatAPI: empty response") res_json = json.loads(res) return res_json async def async_delete_chat_api(self, body): res = await self.async_json('DeleteChatAPI', dict(), json.dumps(body)) if res == '': raise Exception("DeleteChatAPI: empty response") res_json = json.loads(res) return res_json # ========================= 客户端SDK类接口 ========================= # GetSDKTokenAPI def get_sdk_token_api(self, body): res = self.json('GetSDKTokenAPI', dict(), json.dumps(body)) if res == '': raise Exception("GetSDKTokenAPI: empty response") res_json = json.loads(res) return res_json async def async_get_sdk_token_api(self, body): res = await self.async_json('GetSDKTokenAPI', dict(), json.dumps(body)) if res == '': raise Exception("GetSDKTokenAPI: empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/livesaas/__init__.py ================================================ ================================================ FILE: volcengine/maas/MaasService.py ================================================ # coding:utf-8 import sys import json import copy from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from volcengine.auth.SignerV4 import SignerV4 from .sse_decoder import SSEDecoder from .exception import MaasException, new_client_sdk_request_error from .utils import json_to_object class MaasService(Service): def __init__(self, host, region, connection_timeout=60, socket_timeout=60): service_info = MaasService.get_service_info(host, region, connection_timeout, socket_timeout) api_info = MaasService.get_api_info() super(MaasService, self).__init__(service_info, api_info) @staticmethod def get_service_info(host, region, connection_timeout, socket_timeout): service_info = ServiceInfo(host, {'Accept': 'application/json'}, Credentials('', '', 'ml_maas', region), connection_timeout, socket_timeout, 'https') return service_info @staticmethod def get_api_info(): api_info = { "chat": ApiInfo("POST", "/api/v1/chat", {}, {}, {}), "cert": ApiInfo("POST", "/api/v1/cert", {}, {}, {}), "tokenization": ApiInfo("POST", "/api/v1/tokenization", {}, {}, {}), "classification": ApiInfo("POST", "/api/v1/classification", {}, {}, {}), "embeddings": ApiInfo("POST", "/api/v1/embeddings", {}, {}, {}), } return api_info def chat(self, req, is_secret=False): self._validate(is_secret, req) try: req['stream'] = False if is_secret: key, nonce, req = self.encrypt_chat_request(req) res = self.json("chat", {}, json.dumps(req).encode("utf-8")) if res == '': raise new_client_sdk_request_error("empty response", req.get('req_id', None)) resp = json_to_object(res) if is_secret: self.decrypt_chat_response(key, nonce, resp) except Exception as e: try: resp = json_to_object(str(e.args[0], encoding='utf-8')) except Exception: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) else: raise MaasException(resp.error.code_n, resp.error.code, resp.error.message, resp.req_id) else: return resp def _validate(self, is_secret, req): if self.service_info.credentials is None or \ self.service_info.credentials.sk is None or \ self.service_info.credentials.ak is None: raise new_client_sdk_request_error("no valid credential", req.get('req_id', None)) if is_secret and (sys.version_info < (3, 6)): raise new_client_sdk_request_error("For content encryption, python version must be 3.6 or above", req.get('req_id', None)) def stream_chat(self, req, is_secret=False): self._validate(is_secret, req) try: req['stream'] = True if is_secret: key, nonce, req = self.encrypt_chat_request(req) if not ("chat" in self.api_info): raise new_client_sdk_request_error("no such api", req.get('req_id', None)) api_info = self.api_info["chat"] r = self.prepare_request(api_info, {}) r.headers['Content-Type'] = 'application/json' r.body = json.dumps(req).encode("utf-8") SignerV4.sign(r, self.service_info.credentials) url = r.build() res = self.session.post(url, headers=r.headers, data=r.body, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout), stream=True) if res.status_code != 200: raw = res.text.encode() res.close() try: resp = json_to_object(str(raw, encoding='utf-8')) except Exception: raise new_client_sdk_request_error(raw, req.get('req_id', None)) else: raise MaasException(resp.error.code_n, resp.error.code, resp.error.message, resp.req_id) decoder = SSEDecoder(res) def iter(): for data in decoder.next(): if data == b'[DONE]': return try: res = json_to_object(str(data, encoding='utf-8')) if is_secret: self.decrypt_chat_response(key, nonce, res) except: raise else: if res.error is not None and res.error.code_n != 0: raise MaasException(res.error.code_n, res.error.code, res.error.message, res.req_id) yield res return iter() except MaasException: raise except Exception as e: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) def tokenize(self, req): try: res = self.json("tokenization", {}, json.dumps(req).encode("utf-8")) if res == '': raise new_client_sdk_request_error("empty response", req.get('req_id', None)) resp = json_to_object(res) except Exception as e: try: resp = json_to_object(str(e.args[0], encoding='utf-8')) except Exception: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) else: raise MaasException(resp.error.code_n, resp.error.code, resp.error.message, resp.req_id) else: return resp def classification(self, req): try: res = self.json("classification", {}, json.dumps(req).encode("utf-8")) if res == '': raise new_client_sdk_request_error("empty response", req.get('req_id', None)) resp = json_to_object(res) except Exception as e: try: resp = json_to_object(str(e.args[0], encoding='utf-8')) except Exception: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) else: raise MaasException(resp.error.code_n, resp.error.code, resp.error.message, resp.req_id) else: return resp def embeddings(self, req): try: res = self.json("embeddings", {}, json.dumps(req).encode("utf-8")) if res == '': raise new_client_sdk_request_error("empty response", req.get('req_id', None)) resp = json_to_object(res) except Exception as e: try: resp = json_to_object(str(e.args[0], encoding='utf-8')) except Exception: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) else: raise MaasException(resp.error.code_n, resp.error.code, resp.error.message, resp.req_id) else: return resp def init_cert_by_req(self, req): cert_req = {"model": req['model']} try: resp = self.json("cert", {}, json.dumps(cert_req).encode("utf-8")) resp = json_to_object(resp) req['model']['endpoint_id'] = resp.model.endpoint_id if resp.cert is None or len(resp.cert) == 0: raise new_client_sdk_request_error("No cert found, cannot use secret mode", req.get('req_id', None)) from .ka_mgr import key_agreement_client return key_agreement_client(resp.cert) except ImportError: raise new_client_sdk_request_error( "Please install the cryptography package manually by using pip install cryptography~=38.0", req.get('req_id', None)) except Exception as e: raise new_client_sdk_request_error(str(e), req.get('req_id', None)) def encrypt_chat_request(self, req): req_c = copy.deepcopy(req) cert = self.init_cert_by_req(req_c) from .ka_mgr import aes_gcm_encrypt_base64_string key, nonce, token = cert.generate_ecies_key_pair() req_c['crypto_token'] = token for i in req_c['messages']: if i['content'] != '': i['content'] = aes_gcm_encrypt_base64_string(key, nonce, i['content']) return key, nonce, req_c def decrypt_chat_response(self, key, nonce, resp): from .ka_mgr import aes_gcm_decrypt_base64_string m = resp.choice.message.content if m != '': resp.choice.message.content = aes_gcm_decrypt_base64_string(key, nonce, m) return ================================================ FILE: volcengine/maas/__init__.py ================================================ from .MaasService import MaasService from .exception import MaasException from .utils import ChatRole __all__ = ['MaasService', 'MaasException', 'ChatRole'] ================================================ FILE: volcengine/maas/_response.py ================================================ from typing import Iterator, Optional from volcengine.maas.exception import new_client_sdk_request_error, MaasException from volcengine.maas.utils import json_to_object class BinaryResponseContent: def __init__(self, response, request_id) -> None: self.response = response self.request_id = request_id def stream_to_file( self, file: str ) -> None: is_first = True error_bytes = b'' with open(file, mode="wb") as f: for data in self.response: if len(error_bytes) > 0 or (is_first and "\"error\":" in str(data)): error_bytes += data else: f.write(data) if len(error_bytes) > 0: resp = json_to_object(str(error_bytes, encoding="utf-8"), req_id=self.request_id) raise MaasException( resp.error.code_n, resp.error.code, resp.error.message, self.request_id ) def iter_bytes(self) -> Iterator[bytes]: for data in self.response: yield data ================================================ FILE: volcengine/maas/exception.py ================================================ # coding=utf-8 class MaasException(Exception): def __init__(self, code_n, code, message, req_id): self.code_n = code_n self.code = code self.message = message self.req_id = req_id def __str__(self): return ("Detailed exception information is listed below.\n" + \ "req_id: {}\n" + \ "code_n: {}\n" + \ "code: {}\n" + \ "message: {}").format(self.req_id, self.code_n, self.code, self.message) def new_client_sdk_request_error(raw, req_id=""): return MaasException(1709701, "ClientSDKRequestError", "MaaS SDK request error: {}".format(raw), req_id) ================================================ FILE: volcengine/maas/ka_mgr.py ================================================ import os import base64 from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.kdf.hkdf import HKDF from cryptography.hazmat.primitives.ciphers import ( Cipher, algorithms, modes ) def aes_gcm_encrypt_bytes(key, iv, plain_bytes, associated_data=b""): # aes_gcm_encrypt_bytes encrypt message using AES-GCM encryptor = Cipher( algorithms.AES(key), modes.GCM(iv), ).encryptor() # associated_data will be authenticated but not encrypted, # it must also be passed in on decryption. encryptor.authenticate_additional_data(associated_data) # Encrypt the plaintext and get the associated ciphertext. # GCM does not require padding. ciphertext = encryptor.update(plain_bytes) + encryptor.finalize() return ciphertext + encryptor.tag def aes_gcm_encrypt_base64_string(key, nonce, plaintext): """aes_gcm_encrypt_base64_string Encrypt message from base64 string to string using AES-GCM """ plain_bytes = plaintext.encode() # Encrypt message to string using AES-GCM c = aes_gcm_encrypt_bytes(key, nonce, plain_bytes) return base64.b64encode(c).decode() def aes_gcm_decrypt_bytes(key, iv, cipher_bytes, associated_data=b""): """aes_gcm_decrypt_bytes Decrypt message from bytes to bytes using AES-GCM """ tag_length = 16 # default aes gcm tag length cipher = cipher_bytes[:-tag_length] tag = cipher_bytes[-tag_length:] # Construct a Cipher object, with the key, iv, and additionally the # GCM tag used for authenticating the message. decryptor = Cipher( algorithms.AES(key), modes.GCM(iv, tag), ).decryptor() # We put associated_data back in or the tag will fail to verify # when we finalize the decryptor. decryptor.authenticate_additional_data(associated_data) # Decryption gets us the authenticated plaintext. # If the tag does not match an InvalidTag exception will be raised. return decryptor.update(cipher) + decryptor.finalize() def aes_gcm_decrypt_base64_string(key, nonce, ciphertext): # Decrypt message(base64.std.string) using AES-GCM cipher_bytes = base64.decodebytes(ciphertext.encode()) return aes_gcm_decrypt_bytes(key, nonce, cipher_bytes).decode() def marshal_cryptography_pub_key(key): # python version of crypto/elliptic/elliptic.go Marshal # without point on curve check return bytes([4]) + key.x.to_bytes(32, 'big') + key.y.to_bytes(32, 'big') class key_agreement_client(): def __init__(self, pem_path_or_string): """ Load cert and extract public key """ if os.path.exists(pem_path_or_string): with open(pem_path_or_string, 'rb') as f: pem_data = f.read() else: pem_data = pem_path_or_string.encode() self._cert = x509.load_pem_x509_certificate(pem_data) cert_pub = self._cert.public_key().public_numbers() self._curve = ec._CURVE_TYPES[self._cert.public_key().curve.name]() self._public_key = ec.EllipticCurvePublicNumbers( cert_pub.x, cert_pub.y, self._curve).public_key() def generate_ecies_key_pair(self): """generate_ecies_key_pair generate ECIES key pair """ # Generate an ephemeral elliptic curve scalar and point peer_private_key = ec.generate_private_key(self._curve) dh = peer_private_key.exchange(ec.ECDH(), self._public_key) R = peer_private_key.public_key().public_numbers() # Derive symmetric key and nonce via HKDF length = 32 + 12 buf = HKDF( algorithm=hashes.SHA256(), length=length, salt=None, info=None, ).derive(dh) key = buf[:32] nonce = buf[32:length] token = marshal_cryptography_pub_key(R) return key, nonce, base64.b64encode(token).decode() ================================================ FILE: volcengine/maas/sse_decoder.py ================================================ class SSEDecoder(object): def __init__(self, source): self.source = source def _read(self): data = b'' for chunk in self.source: for line in chunk.splitlines(True): data += line if data.endswith((b'\r\r', b'\n\n', b'\r\n\r\n')): yield data data = b'' if data: yield data def next(self): for chunk in self._read(): for line in chunk.splitlines(): # skip comment if line.startswith(b':'): continue if b':' in line: field, value = line.split(b':', 1) else: field, value = line, b'' if field == b'data' and len(value) > 0: yield value ================================================ FILE: volcengine/maas/text_privatization/README.md ================================================ 欢迎使用火山方舟的文本隐私化功能。 在使用大模型精调服务时,直接上传私域训练数据存在一定的隐私泄露风险。 针对这一问题,本功能主要采用本地差分隐私技术,在用户本地对用于大模型精调的训练数据进行扰动,加强了对用户数据隐私的保护。 目前本功能仅支持文本分类任务,采用基于词元贡献度衡量的动态隐私预算分配机制,实现了更好的效用隐私权衡。 相关研究论文:[基于分割学习的“分割-隐私化”大语言模型精调框架](https://mp.weixin.qq.com/s/IuIY-QBOpl7_FDZCriVSjw) 以下为您介绍如何使用文本隐私化功能。 ## 获取与安装 建议使用不低于3.7的Python版本。 1. 使用pip安装SDK for Python: ``` pip install --user volcengine ``` 如果已经安装volcengine包,则用下面命令升级即可: ``` pip install --upgrade volcengine ``` 2. 使用pip安装依赖包: ``` pip install numpy typing_extensions sentencepiece torch~=1.13 transformers~=4.30 ``` ## 使用方式 1. 准备文本隐私化过程中需要用到的分词器tokenizer以及嵌入模型embedding model。 可以选择使用`get_bottom_model`方法从hugging face获取某个开源预训练模型的tokenizer以及embedding模块。 ```python from volcengine.maas.text_privatization import get_bottom_model your_tokenizer, your_embedding_model = get_bottom_model(model_id="MODEL_ID") ``` 2. 使用`make_privatizer`方法初始化文本隐私化器,其中`priv_level`参数表示隐私保护水平,分为"1","2","3"三档。 3. 使用`load_tokenizer_embedding`方法指定所用的tokenizer以及embedding model。 4. 给定训练数据路径,使用`fit`方法执行文本隐私化。数据格式要求符合[火山方舟大模型精调数据集格式](https://www.volcengine.com/docs/82379/1099461)。 3. 使用`save`方法保存隐私化结果,格式不变。 ```python from volcengine.maas.text_privatization import ClsPrivConf from volcengine.maas.text_privatization import make_privatizer text_privatizer = make_privatizer(task_type="classification", priv_conf=ClsPrivConf(priv_level="3")) text_privatizer.load_tokenizer_embedding(tokenizer=your_tokenizer, embedding_model=your_embedding_model) text_privatizer.fit(train_path="PATH/TO/DATA.jsonl") text_privatizer.save(out_dir="PATH/TO/SAVE") ``` ================================================ FILE: volcengine/maas/text_privatization/__init__.py ================================================ from .priv_conf import * from .privatizer import make_privatizer from .utils import get_bottom_model ================================================ FILE: volcengine/maas/text_privatization/budget_allocator/__init__.py ================================================ from .allocator import * from .cti_allocator import * ================================================ FILE: volcengine/maas/text_privatization/budget_allocator/allocator.py ================================================ from abc import ABC, abstractmethod from typing import List try: import torch from transformers.tokenization_utils import PreTrainedTokenizer except ImportError: raise ImportError("Please make sure to install torch and transformers: \n pip install torch~=1.13" "\n pip install transformers~=4.30") from ..priv_conf import * class BudgetAllocator(ABC): def __init__(self, priv_conf: "PrivConf") -> None: """ Init :param priv_conf: privacy config :return None """ super().__init__() self.priv_conf = priv_conf self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") @abstractmethod def pre_fit(self, tokenizer: "PreTrainedTokenizer", text: List[str], label: List[str] ) -> None: """ Dynamically allocate privacy budget :param tokenizer: tokenizer :param text: input text of user :param label: text label corresponding to the input text :return None """ pass ================================================ FILE: volcengine/maas/text_privatization/budget_allocator/cti_allocator.py ================================================ from typing import Tuple, List try: import numpy as np from transformers.tokenization_utils import PreTrainedTokenizer except ImportError: raise ImportError("Please make sure to install numpy and transformers: \n pip install numpy " "\n pip install transformers~=4.30") from .allocator import BudgetAllocator class CTIBudgetAllocator(BudgetAllocator): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self.budget_dict = {"1": 500, "2": 400, "3": 300} def pre_fit(self, tokenizer: "PreTrainedTokenizer", text: List[str], label: List[str] ) -> Tuple[np.ndarray, List[int]]: """ Dynamically allocate privacy budget based on the contributing token identification (CTI) method :param tokenizer: tokenizer :param text: input text of user :param label: text label corresponding to the input text :return (adaptive_budget, label): adaptive privacy budget corresponding to each token and numeric label """ # Tokenize and convert text labels to numeric types input_id = tokenizer(text)["input_ids"] label_set = set(label) label_dict = {element: index for index, element in enumerate(label_set)} label = [label_dict[label] for label in label] # Count the frequency of each token in each category class_num = len(label_set) count = np.zeros((class_num, tokenizer.vocab_size)) for i in range(len(input_id)): for j in range(len(input_id[i])): count[label[i]][input_id[i][j]] += 1 sums = np.sum(count, axis=1) freq = np.zeros(count.shape) for i in range(len(count)): freq[i, :] = count[i, :] / sums[i] # Compute the utility importance ksi = 1 / max(sums) utility_importance = np.zeros(count.shape) for i in range(class_num): for j in range(tokenizer.vocab_size): if count[i][j] > 0: utility_importance[i][j] = sum( [np.log((freq[i][j] / (freq[k][j] + 3 * ksi))) for k in range(class_num) if k != i]) # Determine privacy budget based on the privacy protection level if self.priv_conf.base_budget: if self.priv_conf.base_budget > 0: base_budget = self.priv_conf.base_budget else: raise ValueError("The base budget is required to be a positive number.") else: base_budget = self.budget_dict[self.priv_conf.priv_level] adaptive_budget = np.maximum(utility_importance, 0.6) * base_budget return adaptive_budget, label ================================================ FILE: volcengine/maas/text_privatization/priv_conf/__init__.py ================================================ from .priv import * from .cls_priv import * from .gen_priv import * ================================================ FILE: volcengine/maas/text_privatization/priv_conf/cls_priv.py ================================================ from dataclasses import dataclass, field from typing import Optional try: from typing import Literal except ImportError: from typing_extensions import Literal from .priv import PrivConf @dataclass class ClsPrivConf(PrivConf): """ Args: priv_level (`Literal["1", "2", "3"]`): privacy protection level, where "3" represents the strongest. base_budget (`int`, *optional*): If base_budget is 'None', the base budget is determined based on the privacy protection level. Otherwise, the base budget is determined by base_budget. """ priv_level: Literal["1", "2", "3"] = field(default="1") base_budget: Optional[int] = None ================================================ FILE: volcengine/maas/text_privatization/priv_conf/gen_priv.py ================================================ from dataclasses import dataclass, field from .priv import PrivConf @dataclass class GenPrivConf(PrivConf): pass ================================================ FILE: volcengine/maas/text_privatization/priv_conf/priv.py ================================================ import sys if sys.version_info < (3, 7): raise Exception("为正常使用火山文本隐私化服务,请将您的 Python 版本升级到 3.7 或更高版本!") from dataclasses import dataclass @dataclass class PrivConf: pass ================================================ FILE: volcengine/maas/text_privatization/privatizer/__init__.py ================================================ from .make import make as make_privatizer ================================================ FILE: volcengine/maas/text_privatization/privatizer/cls_privatizer.py ================================================ from typing import Optional, List import os import math import random try: import numpy as np import torch from transformers import AutoTokenizer from transformers.tokenization_utils import PreTrainedTokenizer except ImportError: raise ImportError("Please make sure to install numpy, torch, and transformers: \n pip install numpy " "\n pip install torch~=1.13 \n pip install transformers~=4.30") from .privatizer import TextPrivatizer from ..budget_allocator import CTIBudgetAllocator class TextClsPrivatizer(TextPrivatizer): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self.tokenizer = None self.embedding_model = None self.budget_allocator = CTIBudgetAllocator(self.priv_conf) def load_tokenizer_embedding(self, tokenizer: "PreTrainedTokenizer", embedding_model: "torch.nn.Embedding") -> None: """ Load the tokenizer and embedding model :param tokenizer: tokenizer :param embedding_model: embedding model :return None """ self.tokenizer = tokenizer self.embedding_model = embedding_model.to(self.device) def privatize(self, text: List[str], label: List[int], adaptive_budget: np.ndarray) -> List[str]: """ Privatize the text in batches :param text: original text to be privatized :param label: label corresponding to the original text :param adaptive_budget: adaptive budget :return privated_text: text after privatization """ # Privatize in batches batch_size = 32 batch_num = math.ceil(len(text) / batch_size) privated_ids = [] for i in range(batch_num): sub_text = text[i * batch_size: (i + 1) * batch_size] sub_label = label[i * batch_size: (i + 1) * batch_size] model_input = self.tokenizer(sub_text, padding="longest", return_tensors="pt") input_ids, mask = model_input["input_ids"].to(self.device), model_input["attention_mask"].to(self.device) # add noise to embedding vector input_embeds = self.embedding_model(input_ids) shape = input_embeds.shape input_embeds = input_embeds.view(-1, shape[2]) ones_count_per_row = mask.sum(dim=1) mask = mask.view(-1, 1) repeated_labels = np.repeat(sub_label, shape[1]) mvn = torch.distributions.MultivariateNormal(torch.zeros(shape[2]).to(self.device), covariance_matrix=torch.eye(shape[2]).to(self.device)) vec = mvn.sample((len(input_embeds),)) vec = torch.nn.functional.normalize(vec, p=2, dim=1) l = [ random.gammavariate(alpha=shape[2], beta=1 / adaptive_budget[repeated_labels[j]][input_ids.view(-1)[j]]) for j in range(len(input_embeds))] input_embeds = input_embeds + vec * (torch.tensor(l).view(-1, 1).to(self.device) * mask).to(torch.float32) # find nearest embedding vector nearest_indices = torch.argmin(torch.cdist(input_embeds, self.embedding_model.weight.data.to(torch.float32), p=2), dim=1).view(shape[0], shape[1]) result = [row[shape[1] - j + 2:].tolist() for row, j in zip(nearest_indices, ones_count_per_row)] privated_ids = privated_ids + result privated_text = self.tokenizer.batch_decode(privated_ids) return privated_text def fit(self, train_path: str, test_path: Optional[str] = None) -> None: """ Perform text privatization :param train_path: input path of training data :param test_path: input path of test data :return None """ self.load_data(train_path, test_path) # Perform data preprocess and determine privacy budget train_text, train_label, test_text = self.data_preprocess() adaptive_budget, train_label = self.budget_allocator.pre_fit(self.tokenizer, train_text, train_label) # Privatize and postprocess privated_train_text = self.privatize(train_text, train_label, adaptive_budget) self.data_postprocess(privated_train_text) if self.test_data: privated_test_text = self.privatize(test_text, [0] * len(test_text), np.max(adaptive_budget, axis=0)) self.data_postprocess(privated_test_text) del self.tokenizer del self.embedding_model ================================================ FILE: volcengine/maas/text_privatization/privatizer/make.py ================================================ from ..priv_conf import * from .privatizer import TextPrivatizer from .cls_privatizer import TextClsPrivatizer def make(task_type: Literal["classification", "generation"], priv_conf: "PrivConf") -> "TextPrivatizer": """ Make an instance :param task_type: task type, classification or generation :param priv_conf: privacy config :return TextPrivatizer """ if isinstance(priv_conf, ClsPrivConf): return TextClsPrivatizer( task_type, priv_conf ) else: raise TypeError("unsupported priv_conf type: {}".format(type(priv_conf))) ================================================ FILE: volcengine/maas/text_privatization/privatizer/privatizer.py ================================================ from abc import ABC, abstractmethod from typing import Tuple, List import json try: import torch except ImportError: raise ImportError("Please make sure to install torch: \n pip install torch~=1.13") from ..priv_conf import * class TextPrivatizer(ABC): def __init__(self, task_type: Literal["classification", "generation"], priv_conf: "PrivConf") -> None: """ Init :param task_type: task type, classification or generation :param priv_conf: privacy config :return None """ super().__init__() self.task_type = task_type self.priv_conf = priv_conf self.train_data = None self.test_data = None self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") @abstractmethod def fit(self, train_path: str, test_path: Optional[str] = None) -> None: """ Perform text privatization :param train_path: input path of training data :param test_path: input path of test data :return None """ pass def load_data(self, train_path: str, test_path: Optional[str] = None) -> None: """ Load training data and test data in jsonl format :param train_path: input path of training data :param test_path: input path of test data :return None """ self.train_data = [] with open(train_path, "r") as jsonl_file: for line in jsonl_file: data = json.loads(line.strip()) self.train_data.append(data) if test_path: self.test_data = [] with open(test_path, "r") as jsonl_file: for line in jsonl_file: data = json.loads(line.strip()) self.test_data.append(data) def data_preprocess(self) -> Tuple[List[str], List[str], List[str]]: """ Perform data preprocess :return (train_text, train_label, test_text): content of the user (text) and the assistant (label) in training data and test data """ train_text, train_label, test_text = [], [], [] for dic in self.train_data: for sub_dic in dic["messages"]: if sub_dic["role"] == "user": train_text.append(sub_dic["content"]) elif sub_dic["role"] == "assistant": train_label.append(sub_dic["content"]) if len(train_text) != len(train_label): raise ValueError("There is a problem with the format of the training data set.") if self.test_data: for dic in self.test_data: for sub_dic in dic["messages"]: if sub_dic["role"] == "user": test_text.append(sub_dic["content"]) return train_text, train_label, test_text def data_postprocess(self, privated_text: List[str]) -> None: """ Perform data postprocess :param privated_text: text after privatization :return None """ index = 0 for i in range(len(self.train_data)): for sub_dic in self.train_data[i]["messages"]: if sub_dic["role"] == "user": sub_dic["content"] = privated_text[index] index += 1 def save(self, out_dir: Optional[str] = None) -> None: """ Save the privatized data :param out_dir: output directory :return None """ out_dir = "" if out_dir is None else out_dir with open(out_dir + "privatized_train_data.jsonl", "w") as jsonl_file: for data in self.train_data: json_line = json.dumps(data, ensure_ascii=False) jsonl_file.write(json_line + "\n") if self.test_data: with open(out_dir + "privatized_test_data.jsonl", "w") as jsonl_file: for data in self.train_data: json_line = json.dumps(data, ensure_ascii=False) jsonl_file.write(json_line + "\n") ================================================ FILE: volcengine/maas/text_privatization/utils.py ================================================ import os from typing import Tuple try: import torch from transformers import AutoModel, AutoTokenizer from transformers.tokenization_utils import PreTrainedTokenizer except ImportError: raise ImportError("Please make sure to install torch and transformers: " "\n pip install torch~=1.13 \n pip install transformers~=4.30.2") def get_bottom_model(model_id: str) -> Tuple["PreTrainedTokenizer", "torch.nn.Embedding"]: """ Load the specified pre-trained model from huggingface and save the embedding model and tokenizer :param model_id: id of pre-trained model :return None """ model = AutoModel.from_pretrained(model_id, trust_remote_code=True) # Search the embedding layer for name, module in model.named_modules(): if isinstance(module, torch.nn.Embedding): break tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True) return tokenizer, module ================================================ FILE: volcengine/maas/utils.py ================================================ import json class ChatRole: USER = "user" ASSISTANT = "assistant" SYSTEM = "system" FUNCTION = "function" class _Dict(dict): __setattr__ = dict.__setitem__ __getattr__ = dict.__getitem__ def __missing__(self, key): return None def dict_to_object(dict_obj): # 支持嵌套类型 if isinstance(dict_obj, list): insts = [] for i in dict_obj: insts.append(dict_to_object(i)) return insts if isinstance(dict_obj, dict): inst = _Dict() for k, v in dict_obj.items(): inst[k] = dict_to_object(v) return inst return dict_obj def json_to_object(json_str, req_id=None): obj = dict_to_object(json.loads(json_str)) if obj and isinstance(obj, dict) and req_id: obj["req_id"] = req_id return obj ================================================ FILE: volcengine/maas/v2/MaasService.py ================================================ # coding:utf-8 import json import copy import time from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from volcengine.auth.SignerV4 import SignerV4 from volcengine.maas.sse_decoder import SSEDecoder from volcengine.maas.exception import MaasException, new_client_sdk_request_error from volcengine.maas.utils import dict_to_object, json_to_object from .utils import gen_req_id from volcengine.maas.v2.audio.audio import Audio from volcengine.maas.v2.images.images import Images class MaasService(Service): def __init__(self, host, region, connection_timeout=60, socket_timeout=60): service_info = MaasService.get_service_info( host, region, connection_timeout, socket_timeout ) api_info = MaasService.get_api_info() self._setted_apikey = None api_info = self.get_api_info() super(MaasService, self).__init__(service_info, api_info) self.audio = Audio(self) self.images = Images(self) def set_apikey(self, apikey): self._setted_apikey = apikey @staticmethod def get_service_info(host, region, connection_timeout, socket_timeout): service_info = ServiceInfo( host, {"Accept": "application/json"}, Credentials("", "", "ml_maas", region), connection_timeout, socket_timeout, "https", ) return service_info @staticmethod def get_api_info(): api_info = { "chat": ApiInfo("POST", "/api/v2/endpoint/{endpoint_id}/chat", {}, {}, {}), "tokenization": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/tokenization", {}, {}, {} ), "classification": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/classification", {}, {}, {} ), "embeddings": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/embeddings", {}, {}, {} ), "audio.speech": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/audio/speech", {}, {}, {} ), "images.quick_gen": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/images/quick-gen", {}, {}, {} ), "images.flex_gen": ApiInfo( "POST", "/api/v2/endpoint/{endpoint_id}/images/flex-gen", {}, {}, {} ), } return api_info def chat(self, endpoint_id, req): req["stream"] = False return self._request(endpoint_id, "chat", req) def stream_chat(self, endpoint_id, req): req_id = gen_req_id() self._validate("chat", req_id) apikey = self._setted_apikey try: req["stream"] = True res = self._call( endpoint_id, "chat", req_id, {}, json.dumps(req).encode("utf-8"), apikey, stream=True ) decoder = SSEDecoder(res) def iter(): for data in decoder.next(): if data == b"[DONE]": return try: res = json_to_object(str(data, encoding="utf-8"), req_id=req_id) except: raise else: if res.error is not None and res.error.code_n != 0: raise MaasException( res.error.code_n, res.error.code, res.error.message, req_id, ) yield res return iter() except MaasException: raise except Exception as e: raise new_client_sdk_request_error(str(e)) def tokenize(self, endpoint_id, req): return self._request(endpoint_id, "tokenization", req) def classification(self, endpoint_id, req): return self._request(endpoint_id, "classification", req) def embeddings(self, endpoint_id, req): return self._request(endpoint_id, "embeddings", req) def _request(self, endpoint_id, api, req, params={}): req_id = gen_req_id() self._validate(api, req_id) apikey = self._setted_apikey try: res = self._call(endpoint_id, api, req_id, params, json.dumps(req).encode("utf-8"), apikey) resp = dict_to_object(res.json()) if resp and isinstance(resp, dict): resp["req_id"] = req_id return resp except MaasException as e: raise e except Exception as e: raise new_client_sdk_request_error(str(e), req_id) def _validate(self, api, req_id): credentials_exist = ( self.service_info.credentials is not None and self.service_info.credentials.sk is not None and self.service_info.credentials.ak is not None ) if not self._setted_apikey and not credentials_exist: raise new_client_sdk_request_error("no valid credential", req_id) if not (api in self.api_info): raise new_client_sdk_request_error("no such api", req_id) def _call(self, endpoint_id, api, req_id, params, body, apikey=None, stream=False): api_info = copy.deepcopy(self.api_info[api]) api_info.path = api_info.path.format(endpoint_id=endpoint_id) r = self.prepare_request(api_info, params) r.headers["x-tt-logid"] = req_id r.headers["Content-Type"] = "application/json" r.body = body if apikey is None: SignerV4.sign(r, self.service_info.credentials) elif apikey is not None: r.headers["Authorization"] = "Bearer " + apikey url = r.build() res = self.session.post( url, headers=r.headers, data=r.body, timeout=( self.service_info.connection_timeout, self.service_info.socket_timeout, ), stream=stream, ) if res.status_code != 200: raw = res.text.encode() res.close() try: resp = json_to_object(str(raw, encoding="utf-8"), req_id=req_id) except Exception: raise new_client_sdk_request_error(raw, req_id) else: if resp.error: raise MaasException( resp.error.code_n, resp.error.code, resp.error.message, req_id ) else: raise new_client_sdk_request_error(resp, req_id) return res ================================================ FILE: volcengine/maas/v2/__init__.py ================================================ from .MaasService import MaasService __all__ = ['MaasService'] ================================================ FILE: volcengine/maas/v2/_resource.py ================================================ from volcengine.maas.v2 import MaasService class SyncAPIResource: _service: MaasService def __init__(self, service: MaasService) -> None: self._service = service ================================================ FILE: volcengine/maas/v2/audio/__init__.py ================================================ ================================================ FILE: volcengine/maas/v2/audio/audio.py ================================================ from volcengine.maas.v2._resource import SyncAPIResource from volcengine.maas.v2.audio.speech import Speech class Audio(SyncAPIResource): __speech: Speech = None @property def speech(self) -> Speech: if self.__speech is None: self.__speech = Speech(self._service) return self.__speech ================================================ FILE: volcengine/maas/v2/audio/speech.py ================================================ import copy import json from volcengine.maas._response import BinaryResponseContent from volcengine.maas.v2._resource import SyncAPIResource from volcengine.maas.v2 import MaasService from volcengine.maas.exception import MaasException, new_client_sdk_request_error from volcengine.auth.SignerV4 import SignerV4 from volcengine.maas.utils import json_to_object from volcengine.maas.v2.utils import gen_req_id class Speech(SyncAPIResource): def create(self, endpoint_id, req): api = "audio.speech" req_id = gen_req_id() self._service._validate(api, req_id) apikey = self._service._setted_apikey try: res = self._service._call(endpoint_id, api, req_id, {}, json.dumps(req), apikey, stream=True) return BinaryResponseContent(res, req_id) except MaasException as e: raise e except Exception as e: raise new_client_sdk_request_error(str(e), req_id) ================================================ FILE: volcengine/maas/v2/images/__init__.py ================================================ ================================================ FILE: volcengine/maas/v2/images/images.py ================================================ import json from volcengine.maas.exception import new_client_sdk_request_error, MaasException from volcengine.maas.utils import json_to_object from volcengine.maas.v2._resource import SyncAPIResource class Images(SyncAPIResource): def quick_gen(self, endpoint_id, req): return self._service._request(endpoint_id, "images.quick_gen", req) def flex_gen(self, endpoint_id, req): return self._service._request(endpoint_id, "images.flex_gen", req) ================================================ FILE: volcengine/maas/v2/utils.py ================================================ from datetime import datetime import random def gen_req_id(): return datetime.now().strftime("%Y%m%d%H%M%S") + format( random.randint(0, 2**64 - 1), "020X" ) ================================================ FILE: volcengine/nlp/NLPService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo class NLPService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(NLPService, "_instance"): with NLPService._instance_lock: if not hasattr(NLPService, "_instance"): NLPService._instance = object.__new__(cls) return NLPService._instance def __init__(self): self.service_info = NLPService.get_service_info() self.api_info = NLPService.get_api_info() super(NLPService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("open.volcengineapi.com", {}, Credentials('', '', 'nlp_gateway', 'cn-north-1'), 10, 10) return service_info @staticmethod def get_api_info(): api_info = { "KeyphraseExtractionExtract": ApiInfo("POST", "/", {"Action": "KeyphraseExtractionExtract", "Version": "2020-09-01"}, {}, {}), "TextCorrectionZhCorrect": ApiInfo("POST", "/", {"Action": "TextCorrectionZhCorrect", "Version": "2020-09-01"}, {}, {}), "TextCorrectionEnCorrect": ApiInfo("POST", "/", {"Action": "TextCorrectionEnCorrect", "Version": "2020-09-01"}, {}, {}), "SentimentAnalysis": ApiInfo("POST", "/", {"Action": "SentimentAnalysis", "Version": "2020-12-01"}, {}, {}), "TextSummarization": ApiInfo("POST", "/", {"Action": "TextSummarization", "Version": "2020-12-01"}, {}, {}), "EssayAutoGrade": ApiInfo("POST", "/", {"Action": "EssayAutoGrade", "Version": "2021-05-20"}, {}, {}), "NovelCorrection": ApiInfo("POST", "/", {"Action": "NovelCorrection", "Version": "2021-07-22"}, {}, {}), } return api_info def common_json_handler(self, api, body): params = dict() try: body = json.dumps(body) res = self.json(api, params, body) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def keyphrase_extraction_extract(self, body): try: res_json = self.common_json_handler("KeyphraseExtractionExtract", body) return res_json except Exception as e: raise Exception(str(e)) def text_correction_zh_correct(self, body): try: res_json = self.common_json_handler("TextCorrectionZhCorrect", body) return res_json except Exception as e: raise Exception(str(e)) def text_correction_en_correct(self, body): try: res_json = self.common_json_handler("TextCorrectionEnCorrect", body) return res_json except Exception as e: raise Exception(str(e)) def sentiment_analysis(self, body): try: res_json = self.common_json_handler("SentimentAnalysis", body) return res_json except Exception as e: raise Exception(str(e)) def text_summarization(self, body): try: res_json = self.common_json_handler("TextSummarization", body) return res_json except Exception as e: raise Exception(str(e)) def essay_auto_grade(self, body): try: res_json = self.common_json_handler("EssayAutoGrade", body) return res_json except Exception as e: raise Exception(str(e)) def novel_correction(self, body): try: res_json = self.common_json_handler("NovelCorrection", body) return res_json except Exception as e: raise Exception(str(e)) ================================================ FILE: volcengine/nlp/README.md ================================================ ## Example 调用代码示例均在`volcengine/example/nlp`文件夹下,以下为文本情感分析调用示例 ```python # -*- coding: utf-8 -*- from __future__ import print_function from volcengine.nlp.NLPService import NLPService if __name__ == '__main__': nlp_service = NLPService() # call below method if you dont set ak and sk in $HOME/.volc/config nlp_service.set_ak('ak') nlp_service.set_sk('sk') params = dict() form = { "text": "我很生气" } resp = nlp_service.sentiment_analysis(form) print(resp) ``` 运行代码方式,在根目录下执行 ```bash python volcengine/example/nlp/example_sentiment_analysis.py ``` ================================================ FILE: volcengine/nlp/__init__.py ================================================ ================================================ FILE: volcengine/rdspostgresql/__init__.py ================================================ ================================================ FILE: volcengine/rdspostgresql/rdspostgresql.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service class RdsPostgreSQL(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(RdsPostgreSQL, "_instance"): with RdsPostgreSQL._instance_lock: if not hasattr(RdsPostgreSQL, "_instance"): RdsPostgreSQL._instance = object.__new__(cls) return RdsPostgreSQL._instance def __init__(self, region='cn-north-1'): self.service_info = RdsPostgreSQL.get_service_info(region) self.api_info = RdsPostgreSQL.get_api_info() self.domain_cache = {} self.fallback_domain_weights = {} self.update_interval = 10 self.lock = threading.Lock() super(RdsPostgreSQL, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'rds_postgresql', 'cn-north-1'), 10, 10), } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info @staticmethod def get_api_info(): api_info = { "CreateDBInstance": ApiInfo("POST", "/", {"Action": "CreateDBInstance", "Version": "2018-01-01"}, {}, {}), "CreateDBInstanceIPList": ApiInfo("POST", "/", {"Action": "CreateDBInstanceIPList", "Version": "2018-01-01"}, {}, {}), "CreateAccount": ApiInfo("POST", "/", {"Action": "CreateAccount", "Version": "2018-01-01"}, {}, {}), "ModifyDatabaseOwner": ApiInfo("POST", "/", {"Action": "ModifyDatabaseOwner", "Version": "2018-01-01"}, {}, {}), "CreateDatabase": ApiInfo("POST", "/", {"Action": "CreateDatabase", "Version": "2018-01-01"}, {}, {}), } return api_info def common_handler(self, api, form): params = dict() try: res = self.post(api, params, form) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def common_json_handler(self, api, body): params = dict() try: body = json.dumps(body) res = self.json(api, params, body) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def create_instance(self, form): try: return self.common_json_handler("CreateDBInstance", form) except Exception as e: raise Exception(str(e)) def create_instance_white_list(self, form): try: return self.common_json_handler("CreateDBInstanceIPList", form) except Exception as e: raise Exception(str(e)) def create_account(self, form): try: return self.common_json_handler("CreateAccount", form) except Exception as e: raise Exception(str(e)) def modify_database_owner(self, form): try: return self.common_json_handler("ModifyDatabaseOwner", form) except Exception as e: raise Exception(str(e)) def create_database(self, form): try: return self.common_json_handler("CreateDatabase", form) except Exception as e: raise Exception(str(e)) ================================================ FILE: volcengine/sms/SmsService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfoHttps import ServiceInfoSms from volcengine.const.Const import * from tenacity import retry, stop_after_attempt class SmsService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(SmsService, "_instance"): with SmsService._instance_lock: if not hasattr(SmsService, "_instance"): SmsService._instance = object.__new__(cls) return SmsService._instance def __init__(self): self.service_info = SmsService.get_service_info(self, REGION_CN_NORTH1) self.api_info = SmsService.get_api_info() super(SmsService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(self, region): service_info = ServiceInfoSms("sms.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'volcSMS', region), 5, 5) return service_info @staticmethod def get_api_info(): api_info = { "SendSms": ApiInfo("POST", "/", {"Action": "SendSms", "Version": "2020-01-01"}, {}, {}), "SendSmsVerifyCode": ApiInfo("POST", "/", {"Action": "SendSmsVerifyCode", "Version": "2020-01-01"}, {}, {}), "CheckSmsVerifyCode": ApiInfo("POST", "/", {"Action": "CheckSmsVerifyCode", "Version": "2020-01-01"}, {}, {}), "SendBatchSms": ApiInfo("POST", "/", {"Action": "SendBatchSms", "Version": "2021-01-01"}, {}, {}), "Conversion": ApiInfo("POST", "/", {"Action": "Conversion", "Version": "2020-01-01"}, {}, {}), "GetSmsTemplateAndOrderList": ApiInfo("GET", "/", {"Action": "GetSmsTemplateAndOrderList", "Version": "2021-01-11"}, {}, {}), "ApplySmsTemplate": ApiInfo("POST", "/", {"Action": "ApplySmsTemplate", "Version": "2021-01-11"}, {}, {}), "DeleteSmsTemplate": ApiInfo("POST", "/", {"Action": "DeleteSmsTemplate", "Version": "2021-01-11"}, {}, {}), "GetSubAccountList": ApiInfo("GET", "/", {"Action": "GetSubAccountList", "Version": "2021-01-11"}, {}, {}), "GetSubAccountDetail": ApiInfo("GET", "/", {"Action": "GetSubAccountDetail", "Version": "2021-01-11"}, {}, {}), "GetSignatureAndOrderList": ApiInfo("GET", "/", {"Action": "GetSignatureAndOrderList", "Version": "2021-01-11"}, {}, {}), "ApplySmsSignature": ApiInfo("POST", "/", {"Action": "ApplySmsSignature", "Version": "2021-01-11"}, {}, {}), "DeleteSignature": ApiInfo("POST", "/", {"Action": "DeleteSignature", "Version": "2021-01-11"}, {}, {}), "ApplyVmsTemplate": ApiInfo("POST", "/", {"Action": "ApplyVmsTemplate", "Version": "2021-01-11"}, {}, {}), "GetVmsTemplateStatus": ApiInfo("POST", "/", {"Action": "GetVmsTemplateStatus", "Version": "2021-01-11"}, {}, {}), "InsertSubAccount": ApiInfo("POST", "/", {"Action": "InsertSubAccount", "Version": "2021-01-11"}, {}, {}), "GetSmsSendDetails": ApiInfo("POST", "/", {"Action": "GetSmsSendDetails", "Version": "2021-01-11"}, {}, {}), "ApplySignatureIdent": ApiInfo("POST", "/", {"Action": "ApplySignatureIdent", "Version": "2021-01-11"}, {}, {}), "GetSignatureIdentList": ApiInfo("POST", "/", {"Action": "GetSignatureIdentList", "Version": "2021-01-11"}, {}, {}), "BatchBindSignatureIdent": ApiInfo("POST", "/", {"Action": "BatchBindSignatureIdent", "Version": "2021-01-11"}, {}, {}), "ApplySmsSignatureV2": ApiInfo("POST", "/", {"Action": "ApplySmsSignatureV2", "Version": "2021-01-11"}, {}, {}), "UpdateSmsSignature": ApiInfo("POST", "/", {"Action": "UpdateSmsSignature", "Version": "2021-01-11"}, {}, {}) } return api_info @retry(stop=stop_after_attempt(2)) def send_sms(self, body): res = self.json('SendSms', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def send_sms_verify_code(self, body): res = self.json('SendSmsVerifyCode', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def check_sms_verify_code(self, body): res = self.json('CheckSmsVerifyCode', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def send_batch_sms(self, body): res = self.json('SendBatchSms', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def conversion(self, body): res = self.json('Conversion', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def get_sms_template_and_order_list(self, param): res = self.get('GetSmsTemplateAndOrderList', param) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def apply_sms_template(self, body): res = self.json('ApplySmsTemplate', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def delete_sms_template(self, body): res = self.post('DeleteSmsTemplate', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def get_sub_account_list(self, param): res = self.get('GetSubAccountList', param) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def get_sub_account_detail(self, param): res = self.get('GetSubAccountDetail', param) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def get_signature_and_order_list(self, param): res = self.get('GetSignatureAndOrderList', param) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def apply_sms_signature(self, body): res = self.json('ApplySmsSignature', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def delete_signature(self, body): res = self.json('DeleteSignature', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def apply_vms_template(self, body): body["caller"] = "sdk" if body["channelType"] is None or body["channelType"] == "": body["channelType"] = "CN_VMS" res = self.json('ApplyVmsTemplate', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) if 'Result' in res_json.keys() and 'templateId' in res_json['Result'].keys(): res_json['Result'] = { "templateId": res_json['Result']["templateId"]} return res_json @retry(stop=stop_after_attempt(2)) def get_vms_template_status(self, body): res = self.json('GetVmsTemplateStatus', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def send_vms(self, body): res = self.json('SendSms', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def insert_sms_sub_account(self, body): res = self.json('InsertSubAccount', {}, json.dumps(body)) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json @retry(stop=stop_after_attempt(2)) def get_sms_send_details(self, body): res = self.json('GetSmsSendDetails', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) @retry(stop=stop_after_attempt(2)) def apply_signature_ident(self, body): res = self.json('ApplySignatureIdent', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) @retry(stop=stop_after_attempt(2)) def get_signature_ident_list(self, body): res = self.json('GetSignatureIdentList', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) @retry(stop=stop_after_attempt(2)) def batch_bind_signature_ident(self, body): res = self.json('BatchBindSignatureIdent', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) @retry(stop=stop_after_attempt(2)) def apply_sms_signature_v2(self, body): res = self.json('ApplySmsSignatureV2', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) @retry(stop=stop_after_attempt(2)) def update_sms_signature(self, body): res = self.json('UpdateSmsSignature', {}, json.dumps(body)) if res == '': raise Exception("empty response") return json.loads(res) ================================================ FILE: volcengine/sms/__init__.py ================================================ ================================================ FILE: volcengine/sts/StsService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo class StsService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(StsService, "_instance"): with StsService._instance_lock: if not hasattr(StsService, "_instance"): StsService._instance = object.__new__(cls) return StsService._instance def __init__(self): self.service_info = StsService.get_service_info() self.api_info = StsService.get_api_info() super(StsService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("sts.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'sts', 'cn-north-1'), 5, 5) return service_info @staticmethod def get_api_info(): api_info = {"AssumeRole": ApiInfo("GET", "/", {"Action": "AssumeRole", "Version": "2018-01-01"}, {}, {})} return api_info def assume_role(self, params): res = self.get("AssumeRole", params) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/sts/__init__.py ================================================ ================================================ FILE: volcengine/tls/README.md ================================================ # 日志服务Python SDK 火山引擎日志服务 Python SDK 封装了日志服务的常用接口,您可以通过日志服务 Python SDK 调用服务端 API,实现日志采集、日志检索等功能。 ## 快速开始 ### 初始化客户端 初始化 Client 实例之后,才可以向 TLS 服务发送请求。初始化时推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免 AccessKey 硬编码引发数据安全风险。 初始化代码如下: ```python import os from volcengine.tls.TLSService import TLSService # 注意,环境变量中的endpoint不包含协议头(https://或http://),例如 tls-cn-beijing.ivolces.com。 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) ``` 如需使用 API Key 匿名鉴权写入日志,请使用显式 API Key 初始化入口。当前匿名鉴权仅支持最终请求为 `/PutLogs` 的接口,例如 `put_logs`、`put_logs_v2` 和 Producer 写入;其他接口仍需要完整 AK/SK。 ```python tls_service = TLSService.with_api_key( endpoint=os.environ["VOLCENGINE_ENDPOINT"], region=os.environ["VOLCENGINE_REGION"], api_key=os.environ["VOLCENGINE_TLS_API_KEY"], ) ``` 如果同时配置 API Key 与 AK/SK,`put_logs`/`put_logs_v2` 会优先使用 API Key 匿名鉴权,其他接口继续使用 AK/SK 签名: ```python tls_service = TLSService.with_api_key( endpoint, region, os.environ["VOLCENGINE_TLS_API_KEY"], access_key_id=access_key_id, access_key_secret=access_key_secret, ) ``` Producer 可通过 `ProducerConfig` 透传 API Key: ```python producer_config = ProducerConfig(endpoint, region, "", "", api_key=os.environ["VOLCENGINE_TLS_API_KEY"]) ``` API Key 可在运行时更新: ```python tls_service.reset_api_key(os.environ["VOLCENGINE_TLS_API_KEY_NEW"]) producer.reset_api_key(os.environ["VOLCENGINE_TLS_API_KEY_NEW"]) ``` 请勿在日志或错误信息中打印 API Key 原文。 ### 示例代码 本示例中,创建一个 example_tls.py 文件,并调用接口分别完成创建项目、创建主题、创建索引、写入日志数据、消费日志和查询日志数据。 代码示例如下: ```python # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * if __name__ == "__main__": # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考 https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) now = str(int(time.time())) # 创建日志项目 create_project_request = CreateProjectRequest(project_name="project-name-" + now, region=region, description="project-description") create_project_response = tls_service.create_project(create_project_request) project_id = create_project_response.project_id # 创建日志主题 create_topic_request = CreateTopicRequest(topic_name="topic-name-" + now, project_id=project_id, ttl=3650, description="topic-description", shard_count=2) create_topic_response = tls_service.create_topic(create_topic_request) topic_id = create_topic_response.get_topic_id() # 创建索引 full_text = FullTextInfo(case_sensitive=False, delimiter=",-;", include_chinese=False) value_info_a = ValueInfo(value_type="text", delimiter="", case_sensitive=True, include_chinese=False, sql_flag=True) value_info_b = ValueInfo(value_type="long", delimiter="", case_sensitive=False, include_chinese=False, sql_flag=True) key_value_info_a = KeyValueInfo(key="key1", value=value_info_a) key_value_info_b = KeyValueInfo(key="key2", value=value_info_b) key_value = [key_value_info_a, key_value_info_b] create_index_request = CreateIndexRequest(topic_id, full_text, key_value) create_index_response = tls_service.create_index(create_index_request) # 写入日志数据 # 建议您一次性聚合多条日志后调用一次put_logs_v2接口,以提高日志上传吞吐率 logs = PutLogsV2Logs(source="192.168.1.1", filename="sys.log") for i in range(100): logs.add_log(contents={"key1": "value1-" + str(i + 1), "key2": "value2-" + str(i + 1)}, log_time=int(round(time.time()))) tls_service.put_logs_v2(PutLogsV2Request(topic_id, logs)) time.sleep(30) # 查询消费游标 describe_cursor_request = DescribeCursorRequest(topic_id, shard_id=0, from_time="begin") describe_cursor_response = tls_service.describe_cursor(describe_cursor_request) # 消费日志数据 consume_logs_request = ConsumeLogsRequest(topic_id, shard_id=0, cursor=describe_cursor_response.cursor) consume_logs_response = tls_service.consume_logs(consume_logs_request) # 当您需要检索和分析日志时,推荐您使用Python SDK提供的search_logs_v2方法,下面的代码提供了具体的调用示例 # 查询日志数据(全文检索) search_logs_request = SearchLogsRequest(topic_id, query="error", limit=10, start_time=1346457600000, end_time=1630454400000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(键值检索) search_logs_request = SearchLogsRequest(topic_id, query="key1:error", limit=10, start_time=1346457600000, end_time=1630454400000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(SQL分析) search_logs_request = SearchLogsRequest(topic_id, query="* | select key1, key2", limit=10, start_time=1346457600000, end_time=1630454400000) search_logs_response = tls_service.search_logs_v2(search_logs_request) # 查询日志数据(SQL分析) search_logs_request = SearchLogsRequest(topic_id, query="* | select key1, key2", limit=10, start_time=1346457600000, end_time=1630454400000) search_logs_response = tls_service.search_logs(search_logs_request) ``` ## 通过消费组消费数据 日志服务提供消费日志的OpenAPI接口ConsumeLogs,支持实时消费采集到服务端的日志数据。 在使用ConsumeLogs接口时,需要按照日志分区维度消费日志数据,消费时自行指定日志主题ID、Shard ID和起始结束游标(Cursor),所以消费日志的进度受限于单个Shard的读写能力,还需要自行维护消费进度,在Shard自动分裂的场景下消费逻辑与流程繁琐。 日志服务通过SDK提供了消费组(ConsumerGroup)功能,支持通过消费组消费日志数据,通过消费组消费时,日志服务会自动均衡各个消费者的消费能力与进度,自动分配Shard,您无需关注消费组的内部调度细节及消费者之间的负载均衡、故障转移等,只需要专注于业务逻辑。 日志服务提供了Consumer异步日志消费库,支持消费同一个日志项目下多个日志主题,具有异步消费、高性能、失败重试、优雅关闭等特性。 关于通过消费组消费数据的基本概念和限制说明等更多信息,请您参阅[通过消费组消费数据](https://www.volcengine.com/docs/6470/1152208)。 ### 示例代码 以下代码以Python SDK为例,演示通过SDK创建消费组和消费者,并消费日志的整体流程。 ```python # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from volcengine.tls.TLSService import TLSService from volcengine.tls.consumer.consumer import TLSConsumer, LogProcessor from volcengine.tls.consumer.consumer_model import ConsumerConfig from volcengine.tls.log_pb2 import LogGroupList # 用户需要实现一个继承LogProcessor的类,并按照业务需要自行实现process函数,用于处理消费到的每个LogGroupList class MyLogProcessor(LogProcessor): def process(self, topic_id: str, shard_id: int, log_group_list: LogGroupList): print(topic_id + " --- " + str(shard_id)) count = 0 for log_group in log_group_list.log_groups: for log in log_group.logs: count += 1 print("*** Count = {} ***".format(count)) for content in log.contents: print("{}: {}".format(content.key, content.value)) print() if __name__ == '__main__': # 初始化客户端,推荐通过环境变量动态获取火山引擎密钥等身份认证信息,以免AccessKey硬编码引发数据安全风险。详细说明请参考https://www.volcengine.com/docs/6470/1166455 # 使用STS时,ak和sk均使用临时密钥,且设置VOLCENGINE_TOKEN;不使用STS时,VOLCENGINE_TOKEN部分传空 endpoint = os.environ["VOLCENGINE_ENDPOINT"] region = os.environ["VOLCENGINE_REGION"] access_key_id = os.environ["VOLCENGINE_ACCESS_KEY_ID"] access_key_secret = os.environ["VOLCENGINE_ACCESS_KEY_SECRET"] # 实例化TLS客户端 tls_service = TLSService(endpoint, access_key_id, access_key_secret, region) # 配置消费组的必填参数,ConsumerConfig构造函数设定了一些默认参数,您也可根据需要自定义配置 consumer_config = ConsumerConfig(project_id="ProjectID", consumer_group_name="python-consumer-group", consumer_name="python-consumer", topic_id_list=["TopicID"]) tls_consumer = TLSConsumer(consumer_config, tls_service, MyLogProcessor()) # 调用start方法开始持续消费 tls_consumer.start() # 可通过调用tls_consumer.stop()来结束消费组消费 time.sleep(10) tls_consumer.stop() ``` ### 配置说明 在上述示例代码中,ConsumerConfig类的构造函数返回了Python SDK消费组配置,并向您展示了如何配置您的endpoint、region、accessKeyID、accessKeySecret等基本信息、日志项目ID和日志主题ID列表、消费组名称和消费者名称。 除此之外,您还可通过ConsumerConfig的其他字段进行额外的自定义配置。ConsumerConfig的可配置字段如下所示。 | 参数 | 类型 | 示例值 | 描述 | |:------------------------------------|:-----|:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | max_fetch_log_group_count | int | 100 | 消费者单次消费日志时,最大获取LogGroup数量,默认为100,最大为1000。 | | heartbeat_interval_in_second | int | 20 | Consumer心跳上报时间间隔,单位为秒。 | | data_fetch_interval_in_millisecond | int | 200 | Consumer消费日志时间间隔,单位为毫秒。 | | flush_checkpoint_interval_in_second | int | 5 | Consumer上传消费进度的时间间隔,单位为秒。 | | consume_from | str | begin | 开始消费时的默认消费位点,与DescribeCursor的From参数一致,仅在该消费者从未上传过消费位点时有效。 | | ordered_consume | bool | false | 是否开启顺序消费。开启顺序消费后,消费者会根据Shard分裂的父子关系进行消费。例如Shard0分裂为Shard1与Shard2,而Shard1又分裂为Shard3与Shard4。在开启顺序消费之后,会根据(Shard0) -> (Shard1, Shard2) -> (Shard2, Shard3, Shard4)的顺序进行消费。 | ================================================ FILE: volcengine/tls/TLSService.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import time from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.auth.SignerV4 import SignerV4 from volcengine.base.Service import Service from volcengine.tls.tls_requests import * from volcengine.tls.tls_responses import * from volcengine.tls.tls_requests import DescribeETLTaskRequest, ModifyAlarmContentTemplateRequest from volcengine.tls.tls_responses import DescribeETLTaskResponse, ModifyAlarmContentTemplateResponse from volcengine.tls.tls_responses import ModifyTraceInstanceResponse from volcengine.tls.tls_exception import TLSException from volcengine.tls.retry_policy import RetryPolicy from volcengine.tls.const import DELETE_TRACE_INSTANCE, DESCRIBE_TRACE_INSTANCE, DESCRIBE_TRACE, SEARCH_TRACES, \ CREATE_ALARM_CONTENT_TEMPLATE, CREATE_ALARM_WEBHOOK_INTEGRATION, DELETE_ALARM_WEBHOOK_INTEGRATION, \ X_TLS_ANONYMOUS_IDENTITY from volcengine.tls.util import get_logger API_INFO = { # APIs of log projects. CREATE_PROJECT: ApiInfo(HTTP_POST, CREATE_PROJECT, {}, {}, {}), DELETE_PROJECT: ApiInfo(HTTP_DELETE, DELETE_PROJECT, {}, {}, {}), MODIFY_PROJECT: ApiInfo(HTTP_PUT, MODIFY_PROJECT, {}, {}, {}), DESCRIBE_PROJECT: ApiInfo(HTTP_GET, DESCRIBE_PROJECT, {}, {}, {}), DESCRIBE_PROJECTS: ApiInfo(HTTP_GET, DESCRIBE_PROJECTS, {}, {}, {}), # APIs of log topics. CREATE_TOPIC: ApiInfo(HTTP_POST, CREATE_TOPIC, {}, {}, {}), DELETE_TOPIC: ApiInfo(HTTP_DELETE, DELETE_TOPIC, {}, {}, {}), MODIFY_TOPIC: ApiInfo(HTTP_PUT, MODIFY_TOPIC, {}, {}, {}), DESCRIBE_TOPIC: ApiInfo(HTTP_GET, DESCRIBE_TOPIC, {}, {}, {}), DESCRIBE_TOPICS: ApiInfo(HTTP_GET, DESCRIBE_TOPICS, {}, {}, {}), # APIs of log index. CREATE_INDEX: ApiInfo(HTTP_POST, CREATE_INDEX, {}, {}, {}), DELETE_INDEX: ApiInfo(HTTP_DELETE, DELETE_INDEX, {}, {}, {}), MODIFY_INDEX: ApiInfo(HTTP_PUT, MODIFY_INDEX, {}, {}, {}), DESCRIBE_INDEX: ApiInfo(HTTP_GET, DESCRIBE_INDEX, {}, {}, {}), # APIs of processors. CREATE_PROCESSOR: ApiInfo(HTTP_POST, CREATE_PROCESSOR, {}, {}, {}), DELETE_PROCESSOR: ApiInfo(HTTP_DELETE, DELETE_PROCESSOR, {}, {}, {}), MODIFY_PROCESSOR: ApiInfo(HTTP_PUT, MODIFY_PROCESSOR, {}, {}, {}), DESCRIBE_PROCESSOR: ApiInfo(HTTP_GET, DESCRIBE_PROCESSOR, {}, {}, {}), DESCRIBE_PROCESSORS: ApiInfo(HTTP_GET, DESCRIBE_PROCESSORS, {}, {}, {}), EXEC_PROCESSOR: ApiInfo(HTTP_POST, EXEC_PROCESSOR, {}, {}, {}), OPERATE_PROCESSOR: ApiInfo(HTTP_PUT, OPERATE_PROCESSOR, {}, {}, {}), DESCRIBE_TOPICS_BY_PROCESSOR: ApiInfo(HTTP_GET, DESCRIBE_TOPICS_BY_PROCESSOR, {}, {}, {}), BIND_TOPIC_PROCESSOR: ApiInfo(HTTP_PUT, BIND_TOPIC_PROCESSOR, {}, {}, {}), BATCH_BIND_TOPICS: ApiInfo(HTTP_PUT, BATCH_BIND_TOPICS, {}, {}, {}), UNBIND_TOPIC_PROCESSOR: ApiInfo(HTTP_DELETE, UNBIND_TOPIC_PROCESSOR, {}, {}, {}), DESCRIBE_PROCESSOR_BY_TOPIC: ApiInfo(HTTP_GET, DESCRIBE_PROCESSOR_BY_TOPIC, {}, {}, {}), DESCRIBE_PROCESSOR_BINDINGS: ApiInfo(HTTP_GET, DESCRIBE_PROCESSOR_BINDINGS, {}, {}, {}), DESCRIBE_PROCESSOR_FUNCTIONS: ApiInfo(HTTP_GET, DESCRIBE_PROCESSOR_FUNCTIONS, {}, {}, {}), # APIs of logs. PUT_LOGS: ApiInfo(HTTP_POST, PUT_LOGS, {}, {}, {}), DESCRIBE_CURSOR: ApiInfo(HTTP_GET, DESCRIBE_CURSOR, {}, {}, {}), CONSUME_LOGS: ApiInfo(HTTP_GET, CONSUME_LOGS, {}, {}, {}), SEARCH_LOGS: ApiInfo(HTTP_POST, SEARCH_LOGS, {}, {}, {}), DESCRIBE_LOG_CONTEXT: ApiInfo(HTTP_POST, DESCRIBE_LOG_CONTEXT, {}, {}, {}), WEB_TRACKS: ApiInfo(HTTP_POST, WEB_TRACKS, {}, {}, {}), DESCRIBE_HISTOGRAM: ApiInfo(HTTP_POST, DESCRIBE_HISTOGRAM, {}, {}, {}), DESCRIBE_HISTOGRAM_V1: ApiInfo(HTTP_POST, DESCRIBE_HISTOGRAM_V1, {}, {}, {}), CREATE_DOWNLOAD_TASK: ApiInfo(HTTP_POST, CREATE_DOWNLOAD_TASK, {}, {}, {}), DESCRIBE_DOWNLOAD_TASKS: ApiInfo(HTTP_GET, DESCRIBE_DOWNLOAD_TASKS, {}, {}, {}), DESCRIBE_DOWNLOAD_URL: ApiInfo(HTTP_GET, DESCRIBE_DOWNLOAD_URL, {}, {}, {}), CANCEL_DOWNLOAD_TASK: ApiInfo(HTTP_POST, CANCEL_DOWNLOAD_TASK, {}, {}, {}), # APIs of shards. DESCRIBE_SHARDS: ApiInfo(HTTP_GET, DESCRIBE_SHARDS, {}, {}, {}), MANUAL_SHARD_SPLIT: ApiInfo(HTTP_POST, MANUAL_SHARD_SPLIT, {}, {}, {}), # APIs of host groups. CREATE_HOST_GROUP: ApiInfo(HTTP_POST, CREATE_HOST_GROUP, {}, {}, {}), DELETE_HOST_GROUP: ApiInfo(HTTP_DELETE, DELETE_HOST_GROUP, {}, {}, {}), MODIFY_HOST_GROUP: ApiInfo(HTTP_PUT, MODIFY_HOST_GROUP, {}, {}, {}), DESCRIBE_HOST_GROUP: ApiInfo(HTTP_GET, DESCRIBE_HOST_GROUP, {}, {}, {}), DESCRIBE_HOST_GROUPS: ApiInfo(HTTP_GET, DESCRIBE_HOST_GROUPS, {}, {}, {}), DESCRIBE_HOSTS: ApiInfo(HTTP_GET, DESCRIBE_HOSTS, {}, {}, {}), DELETE_HOST: ApiInfo(HTTP_DELETE, DELETE_HOST, {}, {}, {}), DESCRIBE_HOST_GROUP_RULES: ApiInfo(HTTP_GET, DESCRIBE_HOST_GROUP_RULES, {}, {}, {}), MODIFY_HOST_GROUPS_AUTO_UPDATE: ApiInfo(HTTP_PUT, MODIFY_HOST_GROUPS_AUTO_UPDATE, {}, {}, {}), DELETE_ABNORMAL_HOSTS: ApiInfo(HTTP_DELETE, DELETE_ABNORMAL_HOSTS, {}, {}, {}), # APIs of rules. CREATE_RULE: ApiInfo(HTTP_POST, CREATE_RULE, {}, {}, {}), DELETE_RULE: ApiInfo(HTTP_DELETE, DELETE_RULE, {}, {}, {}), MODIFY_RULE: ApiInfo(HTTP_PUT, MODIFY_RULE, {}, {}, {}), DESCRIBE_RULE: ApiInfo(HTTP_GET, DESCRIBE_RULE, {}, {}, {}), DESCRIBE_RULES: ApiInfo(HTTP_GET, DESCRIBE_RULES, {}, {}, {}), APPLY_RULE_TO_HOST_GROUPS: ApiInfo(HTTP_PUT, APPLY_RULE_TO_HOST_GROUPS, {}, {}, {}), DELETE_RULE_FROM_HOST_GROUPS: ApiInfo(HTTP_PUT, DELETE_RULE_FROM_HOST_GROUPS, {}, {}, {}), # APIs of alarms. CREATE_ALARM_NOTIFY_GROUP: ApiInfo(HTTP_POST, CREATE_ALARM_NOTIFY_GROUP, {}, {}, {}), DELETE_ALARM_NOTIFY_GROUP: ApiInfo(HTTP_DELETE, DELETE_ALARM_NOTIFY_GROUP, {}, {}, {}), MODIFY_ALARM_NOTIFY_GROUP: ApiInfo(HTTP_PUT, MODIFY_ALARM_NOTIFY_GROUP, {}, {}, {}), DESCRIBE_ALARM_NOTIFY_GROUPS: ApiInfo(HTTP_GET, DESCRIBE_ALARM_NOTIFY_GROUPS, {}, {}, {}), CREATE_ALARM: ApiInfo(HTTP_POST, CREATE_ALARM, {}, {}, {}), DELETE_ALARM: ApiInfo(HTTP_DELETE, DELETE_ALARM, {}, {}, {}), MODIFY_ALARM: ApiInfo(HTTP_PUT, MODIFY_ALARM, {}, {}, {}), DESCRIBE_ALARMS: ApiInfo(HTTP_GET, DESCRIBE_ALARMS, {}, {}, {}), MODIFY_ALARM_CONTENT_TEMPLATE: ApiInfo(HTTP_PUT, MODIFY_ALARM_CONTENT_TEMPLATE, {}, {}, {}), DELETE_ALARM_CONTENT_TEMPLATE: ApiInfo(HTTP_DELETE, DELETE_ALARM_CONTENT_TEMPLATE, {}, {}, {}), DESCRIBE_ALARM_CONTENT_TEMPLATES: ApiInfo(HTTP_GET, DESCRIBE_ALARM_CONTENT_TEMPLATES, {}, {}, {}), DESCRIBE_ALARM_WEBHOOK_INTEGRATIONS: ApiInfo(HTTP_GET, DESCRIBE_ALARM_WEBHOOK_INTEGRATIONS, {}, {}, {}), MODIFY_ALARM_WEBHOOK_INTEGRATION: ApiInfo(HTTP_PUT, MODIFY_ALARM_WEBHOOK_INTEGRATION, {}, {}, {}), # APIs of Kafka consumer. OPEN_KAFKA_CONSUMER: ApiInfo(HTTP_PUT, OPEN_KAFKA_CONSUMER, {}, {}, {}), CLOSE_KAFKA_CONSUMER: ApiInfo(HTTP_PUT, CLOSE_KAFKA_CONSUMER, {}, {}, {}), DESCRIBE_KAFKA_CONSUMER: ApiInfo(HTTP_GET, DESCRIBE_KAFKA_CONSUMER, {}, {}, {}), # APIs of consumer group. CREATE_CONSUMER_GROUP: ApiInfo(HTTP_POST, CREATE_CONSUMER_GROUP, {}, {}, {}), DELETE_CONSUMER_GROUP: ApiInfo(HTTP_DELETE, DELETE_CONSUMER_GROUP, {}, {}, {}), MODIFY_CONSUMER_GROUP: ApiInfo(HTTP_PUT, MODIFY_CONSUMER_GROUP, {}, {}, {}), DESCRIBE_CONSUMER_GROUPS: ApiInfo(HTTP_GET, DESCRIBE_CONSUMER_GROUPS, {}, {}, {}), CONSUMER_HEARTBEAT: ApiInfo(HTTP_POST, CONSUMER_HEARTBEAT, {}, {}, {}), MODIFY_CHECKPOINT: ApiInfo(HTTP_PUT, MODIFY_CHECKPOINT, {}, {}, {}), RESET_CHECKPOINT: ApiInfo(HTTP_PUT, RESET_CHECKPOINT, {}, {}, {}), DESCRIBE_CHECKPOINT: ApiInfo(HTTP_GET, DESCRIBE_CHECKPOINT, {}, {}, {}), # APIs of resource labels. ADD_TAGS_TO_RESOURCE: ApiInfo(HTTP_POST, ADD_TAGS_TO_RESOURCE, {}, {}, {}), REMOVE_TAGS_FROM_RESOURCE: ApiInfo(HTTP_POST, REMOVE_TAGS_FROM_RESOURCE, {}, {}, {}), TAG_RESOURCES: ApiInfo(HTTP_POST, TAG_RESOURCES, {}, {}, {}), UNTAG_RESOURCES: ApiInfo(HTTP_POST, UNTAG_RESOURCES, {}, {}, {}), LIST_TAGS_FOR_RESOURCES: ApiInfo(HTTP_POST, LIST_TAGS_FOR_RESOURCES, {}, {}, {}), # APIs of import task. CREATE_IMPORT_TASK: ApiInfo(HTTP_POST, CREATE_IMPORT_TASK, {}, {}, {}), DELETE_IMPORT_TASK: ApiInfo(HTTP_DELETE, DELETE_IMPORT_TASK, {}, {}, {}), MODIFY_IMPORT_TASK: ApiInfo(HTTP_PUT, MODIFY_IMPORT_TASK, {}, {}, {}), DESCRIBE_IMPORT_TASKS: ApiInfo(HTTP_GET, DESCRIBE_IMPORT_TASKS, {}, {}, {}), DESCRIBE_IMPORT_TASK: ApiInfo(HTTP_GET, DESCRIBE_IMPORT_TASK, {}, {}, {}), # APIs of schedule sql tasks. DESCRIBE_SCHEDULE_SQL_TASKS: ApiInfo(HTTP_GET, DESCRIBE_SCHEDULE_SQL_TASKS, {}, {}, {}), # APIs of shipper. CREATE_SHIPPER: ApiInfo(HTTP_POST, CREATE_SHIPPER, {}, {}, {}), DELETE_SHIPPER: ApiInfo(HTTP_DELETE, DELETE_SHIPPER, {}, {}, {}), MODIFY_SHIPPER: ApiInfo(HTTP_PUT, MODIFY_SHIPPER, {}, {}, {}), DESCRIBE_SHIPPERS: ApiInfo(HTTP_GET, DESCRIBE_SHIPPERS, {}, {}, {}), DESCRIBE_SHIPPER: ApiInfo(HTTP_GET, DESCRIBE_SHIPPER, {}, {}, {}), # APIs of ETL tasks. CREATE_ETL_TASK: ApiInfo(HTTP_POST, CREATE_ETL_TASK, {}, {}, {}), DELETE_ETL_TASK: ApiInfo(HTTP_DELETE, DELETE_ETL_TASK, {}, {}, {}), MODIFY_ETL_TASK: ApiInfo(HTTP_PUT, MODIFY_ETL_TASK, {}, {}, {}), DESCRIBE_ETL_TASK: ApiInfo(HTTP_GET, DESCRIBE_ETL_TASK, {}, {}, {}), DESCRIBE_ETL_TASKS: ApiInfo(HTTP_GET, DESCRIBE_ETL_TASKS, {}, {}, {}), MODIFY_ETL_TASK_STATUS: ApiInfo(HTTP_PUT, MODIFY_ETL_TASK_STATUS, {}, {}, {}), # APIs of schedule SQL task. CREATE_SCHEDULE_SQL_TASK: ApiInfo(HTTP_POST, CREATE_SCHEDULE_SQL_TASK, {}, {}, {}), DELETE_SCHEDULE_SQL_TASK: ApiInfo(HTTP_DELETE, DELETE_SCHEDULE_SQL_TASK, {}, {}, {}), DESCRIBE_SCHEDULE_SQL_TASK: ApiInfo(HTTP_GET, DESCRIBE_SCHEDULE_SQL_TASK, {}, {}, {}), MODIFY_SCHEDULE_SQL_TASK: ApiInfo(HTTP_PUT, MODIFY_SCHEDULE_SQL_TASK, {}, {}, {}), # APIs of account. ACTIVE_TLS_ACCOUNT: ApiInfo(HTTP_POST, ACTIVE_TLS_ACCOUNT, {}, {}, {}), # APIs of trace instance. CREATE_TRACE_INSTANCE: ApiInfo(HTTP_POST, CREATE_TRACE_INSTANCE, {}, {}, {}), DELETE_TRACE_INSTANCE: ApiInfo(HTTP_DELETE, DELETE_TRACE_INSTANCE, {}, {}, {}), MODIFY_TRACE_INSTANCE: ApiInfo(HTTP_PUT, MODIFY_TRACE_INSTANCE, {}, {}, {}), DESCRIBE_TRACE_INSTANCE: ApiInfo(HTTP_GET, DESCRIBE_TRACE_INSTANCE, {}, {}, {}), DESCRIBE_TRACE_INSTANCES: ApiInfo(HTTP_GET, DESCRIBE_TRACE_INSTANCES, {}, {}, {}), DESCRIBE_TRACE: ApiInfo(HTTP_POST, DESCRIBE_TRACE, {}, {}, {}), SEARCH_TRACES: ApiInfo(HTTP_POST, SEARCH_TRACES, {}, {}, {}), # APIs of account status. GET_ACCOUNT_STATUS: ApiInfo(HTTP_GET, GET_ACCOUNT_STATUS, {}, {}, {}), # APIs of alarm content template. CREATE_ALARM_CONTENT_TEMPLATE: ApiInfo(HTTP_POST, CREATE_ALARM_CONTENT_TEMPLATE, {}, {}, {}), # APIs of alarm webhook integration. CREATE_ALARM_WEBHOOK_INTEGRATION: ApiInfo(HTTP_POST, CREATE_ALARM_WEBHOOK_INTEGRATION, {}, {}, {}), DELETE_ALARM_WEBHOOK_INTEGRATION: ApiInfo(HTTP_DELETE, DELETE_ALARM_WEBHOOK_INTEGRATION, {}, {}, {}), } HEADER_API_VERSION = "x-tls-apiversion" API_VERSION_V_0_3_0 = "0.3.0" API_VERSION_V_0_2_0 = "0.2.0" class TLSService(Service): def __init__(self, endpoint: str, access_key_id: str, access_key_secret: str, region: str, security_token: str = None, scheme: str = "https", timeout: int = 60, api_version=API_VERSION_V_0_3_0, api_key: str = None): self.__endpoint = endpoint self.__access_key_id = access_key_id self.__access_key_secret = access_key_secret self.__region = region self.__security_token = security_token self.__scheme = scheme self.__timeout = timeout self.__api_version = api_version self.__api_key = api_key self.__retry_policy = None self.check_scheme_and_endpoint() self.__logger = get_logger("tls-python-sdk-logger") self.__logger.info("Successfully initialize the TLS client.") super(TLSService, self).__init__(service_info=self.get_service_info(), api_info=API_INFO) @classmethod def with_api_key(cls, endpoint: str, region: str, api_key: str, access_key_id: str = "", access_key_secret: str = "", security_token: str = None, scheme: str = "https", timeout: int = 60, api_version=API_VERSION_V_0_3_0): return cls(endpoint, access_key_id, access_key_secret, region, security_token=security_token, scheme=scheme, timeout=timeout, api_version=api_version, api_key=api_key) def check_scheme_and_endpoint(self): schemes = { "http://": "http", "https://": "https", } for prefix, scheme in schemes.items(): if self.__endpoint.startswith(prefix): self.__scheme = scheme self.__endpoint = self.__endpoint[len(prefix):] return def get_region(self): return self.__region def get_service_info(self): header = {} if self.__security_token is not None: header[X_SECURITY_TOKEN] = self.__security_token credentials = Credentials(ak=self.__access_key_id, sk=self.__access_key_secret, service="TLS", region=self.__region) service_info = ServiceInfo(host=self.__endpoint, header=header, credentials=credentials, scheme=self.__scheme, connection_timeout=self.__timeout, socket_timeout=self.__timeout) return service_info def __prepare_request(self, api: str, params: dict = None, body: dict = None, request_headers: dict = None): if params is None: params = {} if body is None: body = {} request = self.prepare_request(self.api_info[api], params) if request_headers is None: request_headers = {CONTENT_TYPE: APPLICATION_JSON} request.headers.update(request_headers) if "json" in request.headers[CONTENT_TYPE] and api != WEB_TRACKS: request.body = json.dumps(body) else: request.body = body[DATA] if len(request.body) != 0: if isinstance(request.body, str): request.headers[CONTENT_MD5] = hashlib.md5(request.body.encode("utf-8")).hexdigest() else: request.headers[CONTENT_MD5] = hashlib.md5(request.body).hexdigest() if self.__api_key and api == PUT_LOGS: request.headers[X_TLS_ANONYMOUS_IDENTITY] = self.__api_key request.headers.pop("Authorization", None) request.headers.pop(X_SECURITY_TOKEN, None) else: credentials = self.service_info.credentials if self.__api_key and not (credentials.ak and credentials.sk): raise TLSException(error_code="MissingCredentials", error_message="AK/SK credentials are required for TLS APIs except PutLogs " "when initialized with api_key.") SignerV4.sign(request, credentials) return request def __request(self, api: str, params: dict = None, body: dict = None, request_headers: dict = None): if request_headers is None: request_headers = {HEADER_API_VERSION: self.__api_version} elif HEADER_API_VERSION not in request_headers: request_headers[HEADER_API_VERSION] = self.__api_version if CONTENT_TYPE not in request_headers: request_headers[CONTENT_TYPE] = APPLICATION_JSON request = self.__prepare_request(api, params, body, request_headers) method = self.api_info[api].method url = request.build() policy = self.get_retry_policy() deadline = time.monotonic() + policy.total_timeout try_count = 0 retry_index = 0 while True: try_count += 1 try: # if try_count == 1: # self.__logger.info("TLS client is trying to request {}.".format(api)) response = self.session.request(method, url, headers=request.headers, data=request.body, timeout=self.__timeout) except Exception as e: if self.__can_retry(try_count, policy) is False or self.__should_retry_exception(e) is False: raise TLSException(error_code=e.__class__.__name__, error_message=e.__str__()) sleep_seconds = self.__calc_backoff_seconds(policy, retry_index + 1, deadline) if sleep_seconds <= 0: raise TLSException(error_code="RequestTimeout", error_message="Request exceeded retry total timeout") time.sleep(sleep_seconds) retry_index += 1 else: if response.status_code == 200: # self.__logger.info("TLS client successfully got the response for requesting {}".format(api)) return response elif response.status_code in [429, 500, 502, 503] and self.__can_retry(try_count, policy): sleep_seconds = self.__calc_backoff_seconds(policy, retry_index + 1, deadline) if sleep_seconds > 0: time.sleep(sleep_seconds) retry_index += 1 continue raise TLSException(response) else: raise TLSException(response) def reset_access_key_token(self, access_key_id: str, access_key_secret: str, security_token: str = None): self.__access_key_id = access_key_id self.__access_key_secret = access_key_secret self.__security_token = security_token self.service_info = self.get_service_info() def reset_api_key(self, api_key: str): self.__api_key = api_key def set_timeout(self, timeout: int): self.__timeout = timeout self.service_info = self.get_service_info() def set_retry_policy(self, policy): if policy is None: self.__retry_policy = None return self.__retry_policy = policy.normalize() def get_retry_policy(self): if self.__retry_policy is None: return RetryPolicy.default_policy() return self.__retry_policy.normalize() def __can_retry(self, attempts, policy): if policy.max_attempts <= 0: return True return attempts < policy.max_attempts def __calc_backoff_seconds(self, policy, retry_index, deadline): remaining = deadline - time.monotonic() if remaining <= 0: return 0 sleep_seconds = policy.backoff_seconds(retry_index) if sleep_seconds > remaining: sleep_seconds = remaining return sleep_seconds def __should_retry_exception(self, e): try: from requests import exceptions as req_exc except Exception: return True return isinstance(e, (req_exc.Timeout, req_exc.ConnectionError, req_exc.ChunkedEncodingError, req_exc.ContentDecodingError)) def create_project(self, create_project_request: CreateProjectRequest) -> CreateProjectResponse: if create_project_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_PROJECT, body=create_project_request.get_api_input()) return CreateProjectResponse(response) def delete_project(self, delete_project_request: DeleteProjectRequest) -> DeleteProjectResponse: if delete_project_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_PROJECT, body=delete_project_request.get_api_input()) return DeleteProjectResponse(response) def modify_project(self, modify_project_request: ModifyProjectRequest) -> ModifyProjectResponse: if modify_project_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_PROJECT, body=modify_project_request.get_api_input()) return ModifyProjectResponse(response) def describe_project(self, describe_project_request: DescribeProjectRequest) -> DescribeProjectResponse: if describe_project_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROJECT, params=describe_project_request.get_api_input()) return DescribeProjectResponse(response) def describe_projects(self, describe_projects_request: DescribeProjectsRequest) -> DescribeProjectsResponse: if describe_projects_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROJECTS, params=describe_projects_request.get_api_input()) return DescribeProjectsResponse(response) def create_topic(self, create_topic_request: CreateTopicRequest) -> CreateTopicResponse: if create_topic_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_TOPIC, body=create_topic_request.get_api_input()) return CreateTopicResponse(response) def delete_topic(self, delete_topic_request: DeleteTopicRequest) -> DeleteTopicResponse: if delete_topic_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_TOPIC, body=delete_topic_request.get_api_input()) return DeleteTopicResponse(response) def modify_topic(self, modify_topic_request: ModifyTopicRequest) -> ModifyTopicResponse: if modify_topic_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_TOPIC, body=modify_topic_request.get_api_input()) return ModifyTopicResponse(response) def describe_topic(self, describe_topic_request: DescribeTopicRequest) -> DescribeTopicResponse: if describe_topic_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TOPIC, params=describe_topic_request.get_api_input()) return DescribeTopicResponse(response) def describe_topics(self, describe_topics_request: DescribeTopicsRequest) -> DescribeTopicsResponse: if describe_topics_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TOPICS, params=describe_topics_request.get_api_input()) return DescribeTopicsResponse(response) def create_index(self, create_index_request: CreateIndexRequest) -> CreateIndexResponse: if create_index_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_INDEX, body=create_index_request.get_api_input()) return CreateIndexResponse(response) def delete_index(self, delete_index_request: DeleteIndexRequest) -> DeleteIndexResponse: if delete_index_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_INDEX, body=delete_index_request.get_api_input()) return DeleteIndexResponse(response) def modify_index(self, modify_index_request: ModifyIndexRequest) -> ModifyIndexResponse: if modify_index_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_INDEX, body=modify_index_request.get_api_input()) return ModifyIndexResponse(response) def describe_index(self, describe_index_request: DescribeIndexRequest) -> DescribeIndexResponse: if describe_index_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_INDEX, params=describe_index_request.get_api_input()) return DescribeIndexResponse(response) def create_processor(self, create_processor_request: CreateProcessorRequest) -> CreateProcessorResponse: if create_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_PROCESSOR, body=create_processor_request.get_api_input()) return CreateProcessorResponse(response) def delete_processor(self, delete_processor_request: DeleteProcessorRequest) -> DeleteProcessorResponse: if delete_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_PROCESSOR, body=delete_processor_request.get_api_input()) return DeleteProcessorResponse(response) def modify_processor(self, modify_processor_request: ModifyProcessorRequest) -> ModifyProcessorResponse: if modify_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_PROCESSOR, body=modify_processor_request.get_api_input()) return ModifyProcessorResponse(response) def describe_processor(self, describe_processor_request: DescribeProcessorRequest) -> DescribeProcessorResponse: if describe_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROCESSOR, params=describe_processor_request.get_api_input()) return DescribeProcessorResponse(response) def describe_processors(self, describe_processors_request: DescribeProcessorsRequest) -> DescribeProcessorsResponse: if describe_processors_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROCESSORS, params=describe_processors_request.get_api_input()) return DescribeProcessorsResponse(response) def exec_processor(self, exec_processor_request: ExecProcessorRequest) -> ExecProcessorResponse: if exec_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=EXEC_PROCESSOR, body=exec_processor_request.get_api_input()) return ExecProcessorResponse(response) def operate_processor(self, operate_processor_request: OperateProcessorRequest) -> OperateProcessorResponse: if operate_processor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=OPERATE_PROCESSOR, body=operate_processor_request.get_api_input()) return OperateProcessorResponse(response) def describe_topics_by_processor(self, request: DescribeTopicsByProcessorRequest) -> DescribeTopicsByProcessorResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TOPICS_BY_PROCESSOR, params=request.get_api_input()) return DescribeTopicsByProcessorResponse(response) def bind_topic_processor(self, request: BindTopicProcessorRequest) -> BindTopicProcessorResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=BIND_TOPIC_PROCESSOR, body=request.get_api_input()) return BindTopicProcessorResponse(response) def batch_bind_topics(self, request: BatchBindTopicsRequest) -> BatchBindTopicsResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=BATCH_BIND_TOPICS, body=request.get_api_input()) return BatchBindTopicsResponse(response) def unbind_topic_processor(self, request: UnbindTopicProcessorRequest) -> UnbindTopicProcessorResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=UNBIND_TOPIC_PROCESSOR, body=request.get_api_input()) return UnbindTopicProcessorResponse(response) def describe_processor_by_topic(self, request: DescribeProcessorByTopicRequest) -> DescribeProcessorResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROCESSOR_BY_TOPIC, params=request.get_api_input()) return DescribeProcessorResponse(response) def describe_processor_bindings(self, request: DescribeProcessorBindingsRequest) -> DescribeProcessorBindingsResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROCESSOR_BINDINGS, params=request.get_api_input()) return DescribeProcessorBindingsResponse(response) def describe_processor_functions(self, request: DescribeProcessorFunctionsRequest) -> DescribeProcessorFunctionsResponse: if request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_PROCESSOR_FUNCTIONS, params=request.get_api_input()) return DescribeProcessorFunctionsResponse(response) def put_logs(self, put_logs_request: PutLogsRequest) -> PutLogsResponse: if put_logs_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") api_input = put_logs_request.get_api_input() response = self.__request(api=PUT_LOGS, params=api_input[PARAMS], body=api_input[BODY], request_headers=api_input[REQUEST_HEADERS]) return PutLogsResponse(response) def put_logs_v2(self, request: PutLogsV2Request) -> PutLogsResponse: log_group_list = LogGroupList() log_group = log_group_list.log_groups.add() # pylint: disable=no-member if request.logs.source is not None: log_group.source = request.logs.source if request.logs.filename is not None: log_group.filename = request.logs.filename # 添加日志组标签 if request.logs.log_tags: for key, value in request.logs.log_tags.items(): log_tag = log_group.log_tags.add() log_tag.key = str(key) log_tag.value = str(value) for v in request.logs.logs: new_log = log_group.logs.add() new_log.time = v.time # 设置纳秒级时间戳(如果提供) if v.time_ns is not None and hasattr(new_log, "TimeNs"): new_log.TimeNs = v.time_ns for key in v.log_dict.keys(): log_content = new_log.contents.add() log_content.key = str(key) log_content.value = str(v.log_dict[key]) put_logs_request = PutLogsRequest(request.topic_id, log_group_list, request.hash_key, request.compression, request.content_md5, enable_nanosecond=request.enable_nanosecond) return self.put_logs(put_logs_request) def describe_cursor(self, describe_cursor_request: DescribeCursorRequest) -> DescribeCursorResponse: if describe_cursor_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") api_input = describe_cursor_request.get_api_input() response = self.__request(api=DESCRIBE_CURSOR, params=api_input[PARAMS], body=api_input[BODY]) return DescribeCursorResponse(response) def consume_logs(self, consume_logs_request: ConsumeLogsRequest) -> ConsumeLogsResponse: if consume_logs_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") api_input = consume_logs_request.get_api_input() response = self.__request(api=CONSUME_LOGS, params=api_input[PARAMS], body=api_input[BODY], request_headers=api_input[REQUEST_HEADERS]) return ConsumeLogsResponse(response, compression=consume_logs_request.compression) def search_logs(self, search_logs_request: SearchLogsRequest) -> SearchLogsResponse: if search_logs_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") headers = {HEADER_API_VERSION: API_VERSION_V_0_2_0} response = self.__request(api=SEARCH_LOGS, body=search_logs_request.get_api_input(), request_headers=headers) return SearchLogsResponse(response) def search_logs_v2(self, search_logs_request: SearchLogsRequest) -> SearchLogsResponse: """ :param search_logs_request:搜索日志,按照api-version 0.3.0进行 :type search_logs_request: :return: SearchLogsResponse:搜索日志 :rtype: SearchLogsResponse """ if search_logs_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") headers = {HEADER_API_VERSION: API_VERSION_V_0_3_0} response = self.__request(api=SEARCH_LOGS, body=search_logs_request.get_api_input(), request_headers=headers) return SearchLogsResponse(response) def describe_log_context(self, describe_log_context_request: DescribeLogContextRequest) \ -> DescribeLogContextResponse: if describe_log_context_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_LOG_CONTEXT, body=describe_log_context_request.get_api_input()) return DescribeLogContextResponse(response) def web_tracks(self, web_tracks_request: WebTracksRequest) -> WebTracksResponse: if web_tracks_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") api_input = web_tracks_request.get_api_input() response = self.__request(api=WEB_TRACKS, params=api_input[PARAMS], body=api_input[BODY], request_headers=api_input[REQUEST_HEADERS]) return WebTracksResponse(response) def describe_histogram(self, describe_histogram_request: DescribeHistogramRequest) -> DescribeHistogramResponse: """ Deprecated, use describe_histogram_v1 instead. """ if describe_histogram_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HISTOGRAM, body=describe_histogram_request.get_api_input()) return DescribeHistogramResponse(response) def describe_histogram_v1(self, describe_histogram_v1_request: DescribeHistogramV1Request) -> DescribeHistogramV1Response: if describe_histogram_v1_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HISTOGRAM_V1, body=describe_histogram_v1_request.get_api_input()) return DescribeHistogramV1Response(response) def create_download_task(self, create_download_task_request: CreateDownloadTaskRequest) \ -> CreateDownloadTaskResponse: if create_download_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_DOWNLOAD_TASK, body=create_download_task_request.get_api_input()) return CreateDownloadTaskResponse(response) def describe_download_tasks(self, describe_download_tasks_request: DescribeDownloadTasksRequest) \ -> DescribeDownloadTasksResponse: if describe_download_tasks_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_DOWNLOAD_TASKS, params=describe_download_tasks_request.get_api_input()) return DescribeDownloadTasksResponse(response) def describe_download_url(self, describe_download_url_request: DescribeDownloadUrlRequest) \ -> DescribeDownloadUrlResponse: if describe_download_url_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_DOWNLOAD_URL, params=describe_download_url_request.get_api_input()) return DescribeDownloadUrlResponse(response) def describe_shards(self, describe_shards_request: DescribeShardsRequest) -> DescribeShardsResponse: if describe_shards_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_SHARDS, params=describe_shards_request.get_api_input()) return DescribeShardsResponse(response) def manual_shard_split(self, manual_shard_split_request: ManualShardSplitRequest) -> ManualShardSplitResponse: if manual_shard_split_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MANUAL_SHARD_SPLIT, body=manual_shard_split_request.get_api_input()) return ManualShardSplitResponse(response) def create_host_group(self, create_host_group_request: CreateHostGroupRequest) -> CreateHostGroupResponse: if create_host_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_HOST_GROUP, body=create_host_group_request.get_api_input()) return CreateHostGroupResponse(response) def delete_host_group(self, delete_host_group_request: DeleteHostGroupRequest) -> DeleteHostGroupResponse: if delete_host_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_HOST_GROUP, body=delete_host_group_request.get_api_input()) return DeleteHostGroupResponse(response) def modify_host_group(self, modify_host_group_request: ModifyHostGroupRequest) -> ModifyHostGroupResponse: if modify_host_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_HOST_GROUP, body=modify_host_group_request.get_api_input()) return ModifyHostGroupResponse(response) def describe_host_group(self, describe_host_group_request: DescribeHostGroupRequest) -> DescribeHostGroupResponse: if describe_host_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HOST_GROUP, params=describe_host_group_request.get_api_input()) return DescribeHostGroupResponse(response) def describe_host_groups(self, describe_host_groups_request: DescribeHostGroupsRequest) \ -> DescribeHostGroupsResponse: if describe_host_groups_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HOST_GROUPS, params=describe_host_groups_request.get_api_input()) return DescribeHostGroupsResponse(response) def describe_hosts(self, describe_hosts_request: DescribeHostsRequest) -> DescribeHostsResponse: if describe_hosts_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HOSTS, params=describe_hosts_request.get_api_input()) return DescribeHostsResponse(response) def delete_host(self, delete_host_request: DeleteHostRequest) -> DeleteHostResponse: if delete_host_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_HOST, body=delete_host_request.get_api_input()) return DeleteHostResponse(response) def describe_host_group_rules(self, describe_host_group_rules_request: DescribeHostGroupRulesRequest) \ -> DescribeHostGroupRulesResponse: if describe_host_group_rules_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_HOST_GROUP_RULES, params=describe_host_group_rules_request.get_api_input()) return DescribeHostGroupRulesResponse(response) def modify_host_groups_auto_update(self, modify_host_groups_auto_update_request: ModifyHostGroupsAutoUpdateRequest) \ -> ModifyHostGroupsAutoUpdateResponse: if modify_host_groups_auto_update_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_HOST_GROUPS_AUTO_UPDATE, body=modify_host_groups_auto_update_request.get_api_input()) return ModifyHostGroupsAutoUpdateResponse(response) def delete_abnormal_hosts(self, delete_abnormal_hosts_request: DeleteAbnormalHostsRequest) \ -> DeleteAbnormalHostsResponse: if not delete_abnormal_hosts_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ABNORMAL_HOSTS, body=delete_abnormal_hosts_request.get_api_input()) return DeleteAbnormalHostsResponse(response) def create_rule(self, create_rule_request: CreateRuleRequest) -> CreateRuleResponse: if create_rule_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_RULE, body=create_rule_request.get_api_input()) return CreateRuleResponse(response) def delete_rule(self, delete_rule_request: DeleteRuleRequest) -> DeleteRuleResponse: if delete_rule_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_RULE, body=delete_rule_request.get_api_input()) return DeleteRuleResponse(response) def modify_rule(self, modify_rule_request: ModifyRuleRequest) -> ModifyRuleResponse: if modify_rule_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_RULE, body=modify_rule_request.get_api_input()) return ModifyRuleResponse(response) def describe_rule(self, describe_rule_request: DescribeRuleRequest) -> DescribeRuleResponse: if describe_rule_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_RULE, params=describe_rule_request.get_api_input()) return DescribeRuleResponse(response) def describe_rules(self, describe_rules_request: DescribeRulesRequest) -> DescribeRulesResponse: if describe_rules_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_RULES, params=describe_rules_request.get_api_input()) return DescribeRulesResponse(response) def apply_rule_to_host_groups(self, apply_rule_to_host_groups_request: ApplyRuleToHostGroupsRequest) \ -> ApplyRuleToHostGroupsResponse: if apply_rule_to_host_groups_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=APPLY_RULE_TO_HOST_GROUPS, body=apply_rule_to_host_groups_request.get_api_input()) return ApplyRuleToHostGroupsResponse(response) def delete_rule_from_host_groups(self, delete_rule_from_host_groups_request: DeleteRuleFromHostGroupsRequest) \ -> DeleteRuleFromHostGroupsResponse: if delete_rule_from_host_groups_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_RULE_FROM_HOST_GROUPS, body=delete_rule_from_host_groups_request.get_api_input()) return DeleteRuleFromHostGroupsResponse(response) def create_alarm_notify_group(self, create_alarm_notify_group_request: CreateAlarmNotifyGroupRequest) \ -> CreateAlarmNotifyGroupResponse: if create_alarm_notify_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_ALARM_NOTIFY_GROUP, body=create_alarm_notify_group_request.get_api_input()) return CreateAlarmNotifyGroupResponse(response) def delete_alarm_notify_group(self, delete_alarm_notify_group_request: DeleteAlarmNotifyGroupRequest) \ -> DeleteAlarmNotifyGroupResponse: if delete_alarm_notify_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ALARM_NOTIFY_GROUP, body=delete_alarm_notify_group_request.get_api_input()) return DeleteAlarmNotifyGroupResponse(response) def modify_alarm_notify_group(self, modify_alarm_notify_group_request: ModifyAlarmNotifyGroupRequest) \ -> ModifyAlarmNotifyGroupResponse: if modify_alarm_notify_group_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ALARM_NOTIFY_GROUP, body=modify_alarm_notify_group_request.get_api_input()) return ModifyAlarmNotifyGroupResponse(response) def describe_alarm_notify_groups(self, describe_alarm_notify_groups_request: DescribeAlarmNotifyGroupsRequest) \ -> DescribeAlarmNotifyGroupsResponse: if describe_alarm_notify_groups_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ALARM_NOTIFY_GROUPS, params=describe_alarm_notify_groups_request.get_api_input()) return DescribeAlarmNotifyGroupsResponse(response) def create_alarm(self, create_alarm_request: CreateAlarmRequest) -> CreateAlarmResponse: if create_alarm_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_ALARM, body=create_alarm_request.get_api_input()) return CreateAlarmResponse(response) def delete_alarm(self, delete_alarm_request: DeleteAlarmRequest) -> DeleteAlarmResponse: if delete_alarm_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ALARM, body=delete_alarm_request.get_api_input()) return DeleteAlarmResponse(response) def delete_alarm_content_template(self, delete_alarm_content_template_request: DeleteAlarmContentTemplateRequest) \ -> DeleteAlarmContentTemplateResponse: if delete_alarm_content_template_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ALARM_CONTENT_TEMPLATE, body=delete_alarm_content_template_request.get_api_input()) return DeleteAlarmContentTemplateResponse(response) def modify_alarm(self, modify_alarm_request: ModifyAlarmRequest) -> ModifyAlarmResponse: if modify_alarm_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ALARM, body=modify_alarm_request.get_api_input()) return ModifyAlarmResponse(response) def describe_alarms(self, describe_alarms_request: DescribeAlarmsRequest) -> DescribeAlarmsResponse: if describe_alarms_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ALARMS, params=describe_alarms_request.get_api_input()) return DescribeAlarmsResponse(response) def modify_alarm_content_template(self, modify_alarm_content_template_request: ModifyAlarmContentTemplateRequest) -> ModifyAlarmContentTemplateResponse: if modify_alarm_content_template_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ALARM_CONTENT_TEMPLATE, body=modify_alarm_content_template_request.get_api_input()) return ModifyAlarmContentTemplateResponse(response) def modify_alarm_webhook_integration(self, modify_alarm_webhook_integration_request: ModifyAlarmWebhookIntegrationRequest) -> ModifyAlarmWebhookIntegrationResponse: if modify_alarm_webhook_integration_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ALARM_WEBHOOK_INTEGRATION, body=modify_alarm_webhook_integration_request.get_api_input()) return ModifyAlarmWebhookIntegrationResponse(response) def open_kafka_consumer(self, open_kafka_consumer_request: OpenKafkaConsumerRequest) -> OpenKafkaConsumerResponse: if open_kafka_consumer_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=OPEN_KAFKA_CONSUMER, body=open_kafka_consumer_request.get_api_input()) return OpenKafkaConsumerResponse(response) def close_kafka_consumer(self, close_kafka_consumer_request: CloseKafkaConsumerRequest) \ -> CloseKafkaConsumerResponse: if close_kafka_consumer_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CLOSE_KAFKA_CONSUMER, body=close_kafka_consumer_request.get_api_input()) return CloseKafkaConsumerResponse(response) def describe_kafka_consumer(self, describe_kafka_consumer_request: DescribeKafkaConsumerRequest) \ -> DescribeKafkaConsumerResponse: if describe_kafka_consumer_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_KAFKA_CONSUMER, params=describe_kafka_consumer_request.get_api_input()) return DescribeKafkaConsumerResponse(response) def create_consumer_group(self, create_consumer_group_request: CreateConsumerGroupRequest) \ -> CreateConsumerGroupResponse: if not create_consumer_group_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_CONSUMER_GROUP, body=create_consumer_group_request.get_api_input()) return CreateConsumerGroupResponse(response) def delete_consumer_group(self, delete_consumer_group_request: DeleteConsumerGroupRequest) \ -> DeleteConsumerGroupResponse: if not delete_consumer_group_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_CONSUMER_GROUP, body=delete_consumer_group_request.get_api_input()) return DeleteConsumerGroupResponse(response) def modify_consumer_group(self, modify_consumer_group_request: ModifyConsumerGroupRequest) \ -> ModifyConsumerGroupResponse: if not modify_consumer_group_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_CONSUMER_GROUP, body=modify_consumer_group_request.get_api_input()) return ModifyConsumerGroupResponse(response) def describe_consumer_groups(self, describe_consumer_groups_request: DescribeConsumerGroupsRequest) \ -> DescribeConsumerGroupsResponse: if not describe_consumer_groups_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_CONSUMER_GROUPS, params=describe_consumer_groups_request.get_api_input()) return DescribeConsumerGroupsResponse(response) def consumer_heartbeat(self, consumer_heartbeat_request: ConsumerHeartbeatRequest) -> ConsumerHeartbeatResponse: if not consumer_heartbeat_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CONSUMER_HEARTBEAT, body=consumer_heartbeat_request.get_api_input()) return ConsumerHeartbeatResponse(response) def modify_checkpoint(self, modify_checkpoint_request: ModifyCheckpointRequest) -> ModifyCheckpointResponse: if not modify_checkpoint_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_CHECKPOINT, body=modify_checkpoint_request.get_api_input()) return ModifyCheckpointResponse(response) def reset_checkpoint(self, reset_checkpoint_request: ResetCheckpointRequest) -> ResetCheckpointResponse: if not reset_checkpoint_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=RESET_CHECKPOINT, body=reset_checkpoint_request.get_api_input()) return ResetCheckpointResponse(response) def describe_checkpoint(self, describe_checkpoint_request: DescribeCheckpointRequest) -> DescribeCheckpointResponse: if not describe_checkpoint_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") api_input = describe_checkpoint_request.get_api_input() response = self.__request(api=DESCRIBE_CHECKPOINT, params=api_input[PARAMS], body=api_input[BODY]) return DescribeCheckpointResponse(response) def add_tags_to_resource(self, add_tags_to_resource_request: AddTagsToResourceRequest) -> AddTagsToResourceResponse: if not add_tags_to_resource_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=ADD_TAGS_TO_RESOURCE, body=add_tags_to_resource_request.get_api_input()) return AddTagsToResourceResponse(response) def remove_tags_from_resource(self, remove_tags_from_resource_request: RemoveTagsFromResourceRequest) \ -> RemoveTagsFromResourceResponse: if not remove_tags_from_resource_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=REMOVE_TAGS_FROM_RESOURCE, body=remove_tags_from_resource_request.get_api_input()) return RemoveTagsFromResourceResponse(response) def tag_resources(self, tag_resources_request: TagResourcesRequest) -> TagResourcesResponse: if not tag_resources_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=TAG_RESOURCES, body=tag_resources_request.get_api_input()) return TagResourcesResponse(response) def untag_resources(self, untag_resources_request: UntagResourcesRequest) -> UntagResourcesResponse: if not untag_resources_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=UNTAG_RESOURCES, body=untag_resources_request.get_api_input()) return UntagResourcesResponse(response) def create_import_task(self, create_import_task_request: CreateImportTaskRequest) -> CreateImportTaskResponse: response = self.__request(api=CREATE_IMPORT_TASK, body=create_import_task_request.get_api_input()) return CreateImportTaskResponse(response) def delete_import_task(self, delete_import_task_request: DeleteImportTaskRequest) -> DeleteImportTaskResponse: if not delete_import_task_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_IMPORT_TASK, body=delete_import_task_request.get_api_input()) return DeleteImportTaskResponse(response) def modify_import_task(self, modify_import_task_request: ModifyImportTaskRequest) -> ModifyImportTaskResponse: response = self.__request(api=MODIFY_IMPORT_TASK, body=modify_import_task_request.get_api_input()) return ModifyImportTaskResponse(response) def modify_schedule_sql_task(self, modify_schedule_sql_task_request: ModifyScheduleSqlTaskRequest) -> ModifyScheduleSqlTaskResponse: if modify_schedule_sql_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_SCHEDULE_SQL_TASK, body=modify_schedule_sql_task_request.get_api_input()) return ModifyScheduleSqlTaskResponse(response) def describe_import_task(self, describe_import_task_request: DescribeImportTaskRequest) -> DescribeImportTaskResponse: if describe_import_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_IMPORT_TASK, params=describe_import_task_request.get_api_input()) return DescribeImportTaskResponse(response) def describe_import_tasks(self, describe_import_tasks_request: DescribeImportTasksRequest) -> DescribeImportTasksResponse: response = self.__request(api=DESCRIBE_IMPORT_TASKS, params=describe_import_tasks_request.get_api_input()) return DescribeImportTasksResponse(response) def create_shipper(self, create_shipper_request: CreateShipperRequest) -> CreateShipperResponse: response = self.__request(api=CREATE_SHIPPER, body=create_shipper_request.get_api_input()) return CreateShipperResponse(response) def delete_shipper(self, delete_shipper_request: DeleteShipperRequest) -> DeleteShipperResponse: if not delete_shipper_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_SHIPPER, body=delete_shipper_request.get_api_input()) return DeleteShipperResponse(response) def delete_etl_task(self, delete_etl_task_request: DeleteETLTaskRequest) -> DeleteETLTaskResponse: if not delete_etl_task_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ETL_TASK, body=delete_etl_task_request.get_api_input()) return DeleteETLTaskResponse(response) def modify_shipper(self, modify_shipper_request: ModifyShipperRequest) -> ModifyShipperResponse: if not modify_shipper_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_SHIPPER, body=modify_shipper_request.get_api_input()) return ModifyShipperResponse(response) def describe_shipper(self, describe_shipper_request: DescribeShipperRequest) -> DescribeShipperResponse: if not describe_shipper_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_SHIPPER, params=describe_shipper_request.get_api_input()) return DescribeShipperResponse(response) def describe_etl_task(self, describe_etl_task_request: DescribeETLTaskRequest) -> DescribeETLTaskResponse: if describe_etl_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ETL_TASK, params=describe_etl_task_request.get_api_input()) return DescribeETLTaskResponse(response) def describe_etl_tasks(self, describe_etl_tasks_request: DescribeETLTasksRequest) -> DescribeETLTasksResponse: """查询 ETL 任务列表,对应服务端 DescribeETLTasks 接口。""" if not describe_etl_tasks_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ETL_TASKS, params=describe_etl_tasks_request.get_api_input()) return DescribeETLTasksResponse(response) def create_trace_instance(self, create_trace_instance_request: CreateTraceInstanceRequest) -> CreateTraceInstanceResponse: if create_trace_instance_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_TRACE_INSTANCE, body=create_trace_instance_request.get_api_input()) return CreateTraceInstanceResponse(response) def delete_trace_instance(self, delete_trace_instance_request: DeleteTraceInstanceRequest) -> DeleteTraceInstanceResponse: if delete_trace_instance_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_TRACE_INSTANCE, body=delete_trace_instance_request.get_api_input()) return DeleteTraceInstanceResponse(response) def describe_trace_instance(self, describe_trace_instance_request: DescribeTraceInstanceRequest) -> DescribeTraceInstanceResponse: if describe_trace_instance_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TRACE_INSTANCE, params=describe_trace_instance_request.get_api_input()) return DescribeTraceInstanceResponse(response) def describe_trace_instances(self, describe_trace_instances_request: DescribeTraceInstancesRequest) -> DescribeTraceInstancesResponse: if describe_trace_instances_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TRACE_INSTANCES, params=describe_trace_instances_request.get_api_input()) return DescribeTraceInstancesResponse(response) def active_tls_account(self) -> ActiveTlsAccountResponse: """\ 激活TLS账户 :return: ActiveTlsAccountResponse :rtype: ActiveTlsAccountResponse """ response = self.__request(api=ACTIVE_TLS_ACCOUNT, body={}) return ActiveTlsAccountResponse(response) def describe_shippers(self, describe_shippers_request: DescribeShippersRequest) -> DescribeShippersResponse: response = self.__request(api=DESCRIBE_SHIPPERS, params=describe_shippers_request.get_api_input()) return DescribeShippersResponse(response) def cancel_download_task(self, cancel_download_task_request) -> 'CancelDownloadTaskResponse': if not cancel_download_task_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CANCEL_DOWNLOAD_TASK, body=cancel_download_task_request.get_api_input()) return CancelDownloadTaskResponse(response) def modify_trace_instance(self, modify_trace_instance_request: ModifyTraceInstanceRequest) -> ModifyTraceInstanceResponse: """修改 Trace 实例 :param modify_trace_instance_request: 修改请求 :type modify_trace_instance_request: ModifyTraceInstanceRequest :return: 修改结果 :rtype: ModifyTraceInstanceResponse """ if not modify_trace_instance_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_TRACE_INSTANCE, body=modify_trace_instance_request.get_api_input()) return ModifyTraceInstanceResponse(response) def search_traces(self, search_traces_request: SearchTracesRequest) -> SearchTracesResponse: """查询 Trace 列表 :param search_traces_request: 查询请求 :type search_traces_request: SearchTracesRequest :return: 查询结果 :rtype: SearchTracesResponse """ if search_traces_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=SEARCH_TRACES, body=search_traces_request.get_api_input()) return SearchTracesResponse(response) def get_account_status(self, get_account_status_request: GetAccountStatusRequest) -> GetAccountStatusResponse: if get_account_status_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=GET_ACCOUNT_STATUS, params=get_account_status_request.get_api_input()) return GetAccountStatusResponse(response) def describe_trace(self, describe_trace_request: DescribeTraceRequest) -> DescribeTraceResponse: """查询Trace详情 :param describe_trace_request: 查询Trace请求 :type describe_trace_request: DescribeTraceRequest :return: Trace详情响应 :rtype: DescribeTraceResponse """ if describe_trace_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_TRACE, body=describe_trace_request.get_api_input()) return DescribeTraceResponse(response) def create_etl_task(self, create_etl_task_request: CreateETLTaskRequest) -> CreateETLTaskResponse: if create_etl_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_ETL_TASK, body=create_etl_task_request.get_api_input()) return CreateETLTaskResponse(response) def modify_etl_task(self, modify_etl_task_request: ModifyETLTaskRequest) -> ModifyETLTaskResponse: if modify_etl_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ETL_TASK, body=modify_etl_task_request.get_api_input()) return ModifyETLTaskResponse(response) def modify_etl_task_status(self, modify_etl_task_status_request: ModifyETLTaskStatusRequest) -> ModifyETLTaskStatusResponse: if modify_etl_task_status_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=MODIFY_ETL_TASK_STATUS, body=modify_etl_task_status_request.get_api_input()) return ModifyETLTaskStatusResponse(response) def create_schedule_sql_task(self, create_schedule_sql_task_request: CreateScheduleSqlTaskRequest) -> CreateScheduleSqlTaskResponse: if create_schedule_sql_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_SCHEDULE_SQL_TASK, body=create_schedule_sql_task_request.get_api_input()) return CreateScheduleSqlTaskResponse(response) def delete_schedule_sql_task(self, delete_schedule_sql_task_request: DeleteScheduleSqlTaskRequest) -> DeleteScheduleSqlTaskResponse: if not delete_schedule_sql_task_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_SCHEDULE_SQL_TASK, body=delete_schedule_sql_task_request.get_api_input()) return DeleteScheduleSqlTaskResponse(response) def describe_schedule_sql_task(self, describe_schedule_sql_task_request: DescribeScheduleSqlTaskRequest) -> DescribeScheduleSqlTaskResponse: if describe_schedule_sql_task_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_SCHEDULE_SQL_TASK, params=describe_schedule_sql_task_request.get_api_input()) return DescribeScheduleSqlTaskResponse(response) def describe_schedule_sql_tasks(self, describe_schedule_sql_tasks_request: DescribeScheduleSqlTasksRequest) -> DescribeScheduleSqlTasksResponse: response = self.__request(api=DESCRIBE_SCHEDULE_SQL_TASKS, params=describe_schedule_sql_tasks_request.get_api_input()) return DescribeScheduleSqlTasksResponse(response) def create_alarm_content_template(self, create_alarm_content_template_request: CreateAlarmContentTemplateRequest) \ -> CreateAlarmContentTemplateResponse: """创建告警通知内容模版 :param create_alarm_content_template_request: 创建告警通知内容模版请求 :type create_alarm_content_template_request: CreateAlarmContentTemplateRequest :return: 创建告警通知内容模版响应 :rtype: CreateAlarmContentTemplateResponse """ if create_alarm_content_template_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_ALARM_CONTENT_TEMPLATE, body=create_alarm_content_template_request.get_api_input()) return CreateAlarmContentTemplateResponse(response) def create_alarm_webhook_integration(self, create_alarm_webhook_integration_request: CreateAlarmWebhookIntegrationRequest) -> CreateAlarmWebhookIntegrationResponse: """创建告警Webhook集成配置 :param create_alarm_webhook_integration_request: 创建告警Webhook集成请求 :type create_alarm_webhook_integration_request: CreateAlarmWebhookIntegrationRequest :return: 创建告警Webhook集成响应 :rtype: CreateAlarmWebhookIntegrationResponse """ if create_alarm_webhook_integration_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=CREATE_ALARM_WEBHOOK_INTEGRATION, body=create_alarm_webhook_integration_request.get_api_input()) return CreateAlarmWebhookIntegrationResponse(response) def delete_alarm_webhook_integration(self, delete_alarm_webhook_integration_request: DeleteAlarmWebhookIntegrationRequest) -> DeleteAlarmWebhookIntegrationResponse: """删除告警 Webhook 集成配置 :param delete_alarm_webhook_integration_request: 删除告警 Webhook 集成配置请求 :type delete_alarm_webhook_integration_request: DeleteAlarmWebhookIntegrationRequest :return: 删除告警 Webhook 集成配置响应 :rtype: DeleteAlarmWebhookIntegrationResponse """ if delete_alarm_webhook_integration_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DELETE_ALARM_WEBHOOK_INTEGRATION, body=delete_alarm_webhook_integration_request.get_api_input()) return DeleteAlarmWebhookIntegrationResponse(response) def describe_alarm_content_templates(self, describe_alarm_content_templates_request: DescribeAlarmContentTemplatesRequest) -> DescribeAlarmContentTemplatesResponse: """查询告警通知内容模版列表 :param describe_alarm_content_templates_request: 查询请求 :type describe_alarm_content_templates_request: DescribeAlarmContentTemplatesRequest :return: 查询结果 :rtype: DescribeAlarmContentTemplatesResponse """ if describe_alarm_content_templates_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ALARM_CONTENT_TEMPLATES, params=describe_alarm_content_templates_request.get_api_input()) return DescribeAlarmContentTemplatesResponse(response) def describe_alarm_webhook_integrations(self, describe_alarm_webhook_integrations_request: DescribeAlarmWebhookIntegrationsRequest) \ -> DescribeAlarmWebhookIntegrationsResponse: """查询告警 Webhook 集成配置列表""" if describe_alarm_webhook_integrations_request.check_validation() is False: raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=DESCRIBE_ALARM_WEBHOOK_INTEGRATIONS, params=describe_alarm_webhook_integrations_request.get_api_input()) return DescribeAlarmWebhookIntegrationsResponse(response) def list_tags_for_resources(self, list_tags_for_resources_request: ListTagsForResourcesRequest) -> ListTagsForResourcesResponse: """查询资源标签 :param list_tags_for_resources_request: 查询请求 :return: 查询结果 """ if not list_tags_for_resources_request.check_validation(): raise TLSException(error_code="InvalidArgument", error_message="Invalid request, please check it") response = self.__request(api=LIST_TAGS_FOR_RESOURCES, body=list_tags_for_resources_request.get_api_input()) return ListTagsForResourcesResponse(response) ================================================ FILE: volcengine/tls/__init__.py ================================================ VERSION = "v3.3.2_20240229" ================================================ FILE: volcengine/tls/const.py ================================================ # coding=utf-8 # HTTP request and response. HTTP_GET = "GET" HTTP_POST = "POST" HTTP_DELETE = "DELETE" HTTP_PUT = "PUT" HTTP_PREFIX = "http://" HTTPS_PREFIX = "https://" CONTENT_TYPE = "Content-Type" APPLICATION_JSON = "application/json" APPLICATION_X_PROTOBUF = "application/x-protobuf" CONTENT_MD5 = "Content-MD5" X_SECURITY_TOKEN = "X-Security-Token" X_TLS_REQUEST_ID = "X-Tls-Requestid" X_TLS_ANONYMOUS_IDENTITY = "x-tls-anonymous-identity" X_TLS_HASHKEY = "x-tls-hashkey" X_TLS_COMPRESSTYPE = "x-tls-compresstype" X_TLS_BODYRAWSIZE = "x-tls-bodyrawsize" X_TLS_CURSOR = "X-Tls-Cursor" X_TLS_COUNT = "X-Tls-Count" LOG_SIZE = "log-size" LOG_COUNT = "log-count" EARLIEST_LOG_TIME = "earliest-log-time" LATEST_LOG_TIME = "latest-log-time" PARAMS = "Params" BODY = "Body" REQUEST_HEADERS = "RequestHeaders" OK_STATUS = 200 # TLS APIs CREATE_PROJECT = "/CreateProject" DELETE_PROJECT = "/DeleteProject" MODIFY_PROJECT = "/ModifyProject" DESCRIBE_PROJECT = "/DescribeProject" DESCRIBE_PROJECTS = "/DescribeProjects" CREATE_TOPIC = "/CreateTopic" DELETE_TOPIC = "/DeleteTopic" MODIFY_TOPIC = "/ModifyTopic" DESCRIBE_TOPIC = "/DescribeTopic" DESCRIBE_TOPICS = "/DescribeTopics" PUT_LOGS = "/PutLogs" DESCRIBE_CURSOR = "/DescribeCursor" CONSUME_LOGS = "/ConsumeLogs" SEARCH_LOGS = "/SearchLogs" DESCRIBE_LOG_CONTEXT = "/DescribeLogContext" WEB_TRACKS = "/WebTracks" DESCRIBE_HISTOGRAM = "/DescribeHistogram" DESCRIBE_HISTOGRAM_V1 = "/DescribeHistogramV1" CREATE_DOWNLOAD_TASK = "/CreateDownloadTask" DESCRIBE_DOWNLOAD_TASKS = "/DescribeDownloadTasks" DESCRIBE_DOWNLOAD_URL = "/DescribeDownloadUrl" CREATE_INDEX = "/CreateIndex" DELETE_INDEX = "/DeleteIndex" MODIFY_INDEX = "/ModifyIndex" DESCRIBE_INDEX = "/DescribeIndex" CREATE_PROCESSOR = "/CreateProcessor" DELETE_PROCESSOR = "/DeleteProcessor" MODIFY_PROCESSOR = "/ModifyProcessor" DESCRIBE_PROCESSOR = "/DescribeProcessor" DESCRIBE_PROCESSORS = "/DescribeProcessors" EXEC_PROCESSOR = "/ExecProcessor" OPERATE_PROCESSOR = "/OperateProcessor" DESCRIBE_TOPICS_BY_PROCESSOR = "/DescribeTopicsByProcessor" BIND_TOPIC_PROCESSOR = "/BindTopicProcessor" BATCH_BIND_TOPICS = "/BatchBindTopics" UNBIND_TOPIC_PROCESSOR = "/UnbindTopicProcessor" DESCRIBE_PROCESSOR_BY_TOPIC = "/DescribeProcessorByTopic" DESCRIBE_PROCESSOR_BINDINGS = "/DescribeProcessorBindings" DESCRIBE_PROCESSOR_FUNCTIONS = "/DescribeProcessorFunctions" DESCRIBE_SHARDS = "/DescribeShards" MANUAL_SHARD_SPLIT = "/ManualShardSplit" CREATE_HOST_GROUP = "/CreateHostGroup" DELETE_HOST_GROUP = "/DeleteHostGroup" MODIFY_HOST_GROUP = "/ModifyHostGroup" DESCRIBE_HOST_GROUP = "/DescribeHostGroup" DESCRIBE_HOST_GROUPS = "/DescribeHostGroups" DESCRIBE_HOSTS = "/DescribeHosts" DELETE_HOST = "/DeleteHost" DESCRIBE_HOST_GROUP_RULES = "/DescribeHostGroupRules" MODIFY_HOST_GROUPS_AUTO_UPDATE = "/ModifyHostGroupsAutoUpdate" CREATE_RULE = "/CreateRule" DELETE_RULE = "/DeleteRule" MODIFY_RULE = "/ModifyRule" DESCRIBE_RULE = "/DescribeRule" DESCRIBE_RULES = "/DescribeRules" APPLY_RULE_TO_HOST_GROUPS = "/ApplyRuleToHostGroups" DELETE_RULE_FROM_HOST_GROUPS = "/DeleteRuleFromHostGroups" DELETE_ABNORMAL_HOSTS = "/DeleteAbnormalHosts" CREATE_ALARM_NOTIFY_GROUP = "/CreateAlarmNotifyGroup" DELETE_ALARM_NOTIFY_GROUP = "/DeleteAlarmNotifyGroup" MODIFY_ALARM_NOTIFY_GROUP = "/ModifyAlarmNotifyGroup" DESCRIBE_ALARM_NOTIFY_GROUPS = "/DescribeAlarmNotifyGroups" CREATE_ALARM = "/CreateAlarm" DELETE_ALARM = "/DeleteAlarm" MODIFY_ALARM = "/ModifyAlarm" DESCRIBE_ALARMS = "/DescribeAlarms" MODIFY_ALARM_CONTENT_TEMPLATE = "/ModifyAlarmContentTemplate" DELETE_ALARM_CONTENT_TEMPLATE = "/DeleteAlarmContentTemplate" DESCRIBE_ALARM_CONTENT_TEMPLATES = "/DescribeAlarmContentTemplates" DESCRIBE_ALARM_WEBHOOK_INTEGRATIONS = "/DescribeAlarmWebhookIntegrations" MODIFY_ALARM_WEBHOOK_INTEGRATION = "/ModifyAlarmWebhookIntegration" OPEN_KAFKA_CONSUMER = "/OpenKafkaConsumer" CLOSE_KAFKA_CONSUMER = "/CloseKafkaConsumer" DESCRIBE_KAFKA_CONSUMER = "/DescribeKafkaConsumer" CREATE_CONSUMER_GROUP = "/CreateConsumerGroup" DELETE_CONSUMER_GROUP = "/DeleteConsumerGroup" MODIFY_CONSUMER_GROUP = "/ModifyConsumerGroup" DESCRIBE_CONSUMER_GROUPS = "/DescribeConsumerGroups" CONSUMER_HEARTBEAT = "/ConsumerHeartbeat" MODIFY_CHECKPOINT = "/ModifyCheckPoint" RESET_CHECKPOINT = "/ResetCheckPoint" DESCRIBE_CHECKPOINT = "/DescribeCheckPoint" ADD_TAGS_TO_RESOURCE = "/AddTagsToResource" REMOVE_TAGS_FROM_RESOURCE = "/RemoveTagsFromResource" LIST_TAGS_FOR_RESOURCES = "/ListTagsForResources" TAG_RESOURCES = "/TagResources" UNTAG_RESOURCES = "/UntagResources" CREATE_IMPORT_TASK = "/CreateImportTask" DELETE_IMPORT_TASK = "/DeleteImportTask" MODIFY_IMPORT_TASK = "/ModifyImportTask" DESCRIBE_IMPORT_TASKS = "/DescribeImportTasks" DESCRIBE_IMPORT_TASK = "/DescribeImportTask" CREATE_SHIPPER = "/CreateShipper" DELETE_SHIPPER = "/DeleteShipper" MODIFY_SHIPPER = "/ModifyShipper" DESCRIBE_SHIPPERS = "/DescribeShippers" DESCRIBE_SHIPPER = "/DescribeShipper" # APIs of ETL tasks. CREATE_ETL_TASK = "/CreateETLTask" DELETE_ETL_TASK = "/DeleteETLTask" MODIFY_ETL_TASK = "/ModifyETLTask" DESCRIBE_ETL_TASK = "/DescribeETLTask" DESCRIBE_ETL_TASKS = "/DescribeETLTasks" # APIs of account. ACTIVE_TLS_ACCOUNT = "/ActiveTlsAccount" # Trace APIs CREATE_TRACE_INSTANCE = "/CreateTraceInstance" DELETE_TRACE_INSTANCE = "/DeleteTraceInstance" MODIFY_TRACE_INSTANCE = "/ModifyTraceInstance" DESCRIBE_TRACE_INSTANCE = "/DescribeTraceInstance" DESCRIBE_TRACE_INSTANCES = "/DescribeTraceInstances" DESCRIBE_TRACE = "/DescribeTrace" SEARCH_TRACES = "/SearchTraces" # Trace related fields TRACE_INSTANCE_ID = "TraceInstanceId" TRACE_INSTANCE_NAME = "TraceInstanceName" TRACE_INSTANCES = "TraceInstances" TRACE_INSTANCE_STATUS = "TraceInstanceStatus" TRACE_TOPIC_ID = "TraceTopicId" TRACE_TOPIC_NAME = "TraceTopicName" DEPENDENCY_TOPIC_ID = "DependencyTopicId" DEPENDENCY_TOPIC_TOPIC_NAME = "DependencyTopicTopicName" # Trace data fields TRACE_ID = "TraceId" TRACE = "Trace" SPANS = "Spans" SPAN_ID = "SpanId" KIND = "Kind" RESOURCE = "Resource" ATTRIBUTES = "Attributes" LINKS = "Links" EVENTS = "Events" INSTRUMENTATION_LIBRARY = "InstrumentationLibrary" # SearchTraces fields TRACE_INFOS = "TraceInfos" CANCEL_DOWNLOAD_TASK = "/CancelDownloadTask" # Schedule SQL task APIs CREATE_SCHEDULE_SQL_TASK = "/CreateScheduleSqlTask" DELETE_SCHEDULE_SQL_TASK = "/DeleteScheduleSqlTask" DESCRIBE_SCHEDULE_SQL_TASK = "/DescribeScheduleSqlTask" DESCRIBE_SCHEDULE_SQL_TASKS = "/DescribeScheduleSqlTasks" MODIFY_SCHEDULE_SQL_TASK = "/ModifyScheduleSqlTask" # TLS API fields DATA = "Data" REQUEST_ID = "RequestId" DESCRIPTION = "Description" NAME = "Name" PAGE_NUMBER = "PageNumber" PAGE_SIZE = "PageSize" TOTAL = "Total" ITEMS = "Items" CREATE_TIME = "CreateTime" MODIFY_TIME = "ModifyTime" PROJECT_ID = "ProjectId" PROJECT_NAME = "ProjectName" REGION = "Region" IS_FULL_NAME = "IsFullName" PROJECTS = "Projects" TOPIC_ID = "TopicId" TOPIC_NAME = "TopicName" TTL = "Ttl" SHARD_COUNT = "ShardCount" TOPICS = "Topics" AUTO_SPLIT = "AutoSplit" MAX_SPLIT_SHARD = "MaxSplitShard" ENABLE_TRACKING = "EnableTracking" TAGS = "Tags" LOG_PUBLIC_IP = "LogPublicIP" ENABLE_HOT_TTL = "EnableHotTtl" HOT_TTL = "HotTtl" COLD_TTL = "ColdTtl" ARCHIVE_TTL = "ArchiveTtl" ENCRYPT_CONF = "EncryptConf" BIND_PROCESSOR = "BindProcessor" PROCESSOR_ID = "ProcessorID" PROCESSOR_NAME = "ProcessorName" METERING_MODE = "MeteringMode" TLS_VERSION = "TLSVersion" REGIONS = "Regions" FUZZY_SEARCH_KEY = "FuzzySearchKey" ORDER_BY_PROJECT = "OrderByProject" FULL_TEXT = "FullText" KEY_VALUE = "KeyValue" USER_INNER_KEY_VALUE = "UserInnerKeyValue" KEY = "Key" VALUE = "Value" CASE_SENSITIVE = "CaseSensitive" DELIMITER = "Delimiter" INCLUDE_CHINESE = "IncludeChinese" VALUE_TYPE = "ValueType" SQL_FLAG = "SqlFlag" INDEX_ALL = "IndexAll" JSON_KEYS = "JsonKeys" AUTO_INDEX_FLAG = "AutoIndexFlag" ENABLE_AUTO_INDEX = "EnableAutoIndex" ENABLE_PHRASE_INDEX = "EnablePhraseIndex" MAX_TEXT_LEN = "MaxTextLen" PROCESSOR_ID_HUMP = "ProcessorId" PROCESSOR_IDS = "ProcessorIds" PROCESSOR_TYPE = "ProcessorType" PROCESSOR_DSL_TYPE = "ProcessorDSLType" PROCESSOR_STATUS = "ProcessorStatus" DSL_CONTENT = "DSLContent" FAIL_STRATEGY = "FailStrategy" TIMEOUT_MS = "TimeoutMs" MAX_QPS = "MaxQps" EXEC_ACTION = "ExecAction" OPERATE_ACTION = "OperateAction" LOG_SAMPLE = "LogSample" PROCESSED_LOG = "ProcessedLog" EXEC_STATUS = "ExecStatus" ERROR = "Error" TOPIC_IDS = "TopicIds" FUNCTIONS = "Functions" SHARD_ID = "ShardId" SHARDS = "Shards" LZ4 = "lz4" ZLIB = "zlib" FROM = "From" CURSOR = "Cursor" END_CURSOR = "EndCursor" LOG_GROUP_COUNT = "LogGroupCount" COMPRESSION = "Compression" DATA_FORMAT = "DataFormat" START_TIME = "StartTime" END_TIME = "EndTime" QUERY = "Query" LIMIT = "Limit" CONTEXT = "Context" SORT = "Sort" DESC = "desc" ASC = "asc" SCHEMA = "Schema" TYPE = "Type" RESULT_STATUS = "ResultStatus" TASK_STATUS = "TaskStatus" HIT_COUNT = "HitCount" LIST_OVER = "ListOver" ANALYSIS = "Analysis" COUNT = "Count" LOGS = "Logs" ANALYSIS_RESULT = "AnalysisResult" LOG_CONTEXT_INFOS = "LogContextInfos" PREV_OVER = "PrevOver" NEXT_OVER = "NextOver" SOURCE = "Source" CONTEXT_FLOW = "ContextFlow" PACKAGE_OFFSET = "PackageOffset" INTERVAL = "Interval" TOTAL_COUNT = "TotalCount" HISTOGRAM = "Histogram" TASK_ID = "TaskId" TASKS = "Tasks" ALLOW_INCOMPLETE = "AllowIncomplete" DOWNLOAD_URL = "DownloadUrl" HOST_GROUP_ID = "HostGroupId" HOST_GROUP_IDS = "HostGroupIds" HOST_GROUP_NAME = "HostGroupName" HOST_GROUP_TYPE = "HostGroupType" IP = "Ip" IP_TYPE = "IP" LABEL = "Label" HOST_IP_LIST = "HostIpList" HOST_IDENTIFIER = "HostIdentifier" HOST_GROUP_INFO = "HostGroupInfo" HOST_GROUP_INFOS = "HostGroupInfos" HOST_INFOS = "HostInfos" HEARTBEAT_STATUS = "HeartbeatStatus" RULE_ID = "RuleId" PAUSE = "Pause" RULE_NAME = "RuleName" PATHS = "Paths" LOG_TYPE = "LogType" INPUT_TYPE = "InputType" EXTRACT_RULE = "ExtractRule" EXCLUDE_PATHS = "ExcludePaths" USER_DEFINE_RULE = "UserDefineRule" LOG_SAMPLE = "LogSample" CONTAINER_RULE = "ContainerRule" RULE_INFO = "RuleInfo" RULE_INFOS = "RuleInfos" HOST_GROUP_HOSTS_RULES_INFO = "HostGroupHostsRulesInfo" HOST_GROUP_HOSTS_RULES_INFOS = "HostGroupHostsRulesInfos" ENV_TAG = "EnvTag" KUBERNETES_RULE = "KubernetesRule" PARSE_PATH_RULE = "ParsePathRule" PATH_SAMPLE = "PathSample" BEGIN_REGEX = "BeginRegex" LOG_REGEX = "LogRegex" KEYS = "Keys" TIME_KEY = "TimeKey" TIME_FORMAT = "TimeFormat" FILTER_KEY_REGEX = "FilterKeyRegex" UN_MATCH_UP_LOAD_SWITCH = "UnMatchUpLoadSwitch" UN_MATCH_LOG_KEY = "UnMatchLogKey" REGEX = "Regex" STREAM = "Stream" CONTAINER_NAME_REGEX = "ContainerNameRegex" INCLUDE_CONTAINER_LABEL_REGEX = "IncludeContainerLabelRegex" EXCLUDE_CONTAINER_LABEL_REGEX = "ExcludeContainerLabelRegex" INCLUDE_CONTAINER_ENV_REGEX = "IncludeContainerEnvRegex" EXCLUDE_CONTAINER_ENV_REGEX = "ExcludeContainerEnvRegex" LOG_TEMPLATE = "LogTemplate" FORMAT = "Format" HASH_KEY = "HashKey" SHARD_HASH_KEY = "ShardHashKey" ENABLE_RAW_LOG = "EnableRawLog" FIELDS = "Fields" PLUGIN = "Plugin" PROCESSORS = "processors" ADVANCED = "Advanced" CLOSE_INACTIVE = "CloseInactive" CLOSE_TIMEOUT = "CloseTimeout" CLOSE_REMOVED = "CloseRemoved" CLOSE_RENAMED = "CloseRenamed" CLOSE_EOF = "CloseEOF" NO_LINE_TERMINATOR_EOF_MAX_TIME = "NoLineTerminatorEOFMaxTime" ALARM_NOTIFY_GROUP_ID = "AlarmNotifyGroupId" ALARM_NOTIFY_GROUP_NAME = "AlarmNotifyGroupName" NOTIFY_TYPE = "NotifyType" TRIGGER = "Trigger" RECOVERY = "Recovery" RECEIVERS = "Receivers" RECEIVER_NAME = "ReceiverName" IAM_PROJECT_NAME = "IamProjectName" ALARM_NOTIFY_GROUPS = "AlarmNotifyGroups" ALARM_ID = "AlarmId" ALARM_NAME = "AlarmName" QUERY_REQUEST = "QueryRequest" REQUEST_CYCLE = "RequestCycle" CONDITION = "Condition" ALARM_PERIOD = "AlarmPeriod" ALARM_NOTIFY_GROUP = "AlarmNotifyGroup" STATUS = "Status" TRIGGER_PERIOD = "TriggerPeriod" USER_DEFINE_MSG = "UserDefineMsg" JOIN_CONFIGURATIONS = "JoinConfigurations" TRIGGER_CONDITIONS = "TriggerConditions" SEND_RESOLVED = "SendResolved" ALARMS = "Alarms" TIME = "Time" CRON_TAB = "CronTab" NUMBER = "Number" START_TIME_OFFSET = "StartTimeOffset" END_TIME_OFFSET = "EndTimeOffset" TIME_SPAN_TYPE = "TimeSpanType" TRUNCATED_TIME = "TruncatedTime" END_TIME_OFFSET_UNIT = "EndTimeOffsetUnit" START_TIME_OFFSET_UNIT = "StartTimeOffsetUnit" NO_DATA = "NoData" RECEIVER_TYPE = "ReceiverType" RECEIVER_NAMES = "ReceiverNames" RECEIVER_CHANNELS = "ReceiverChannels" WEBHOOK = "Webhook" ALARM_PERIOD_DETAIL = "AlarmPeriodDetail" SMS = "SMS" PHONE = "Phone" EMAIL = "Email" GENERAL_WEBHOOK = "GeneralWebhook" GENERAL_WEBHOOK_URL = "GeneralWebhookUrl" GENERAL_WEBHOOK_BODY = "GeneralWebhookBody" GENERAL_WEBHOOK_METHOD = "GeneralWebhookMethod" GENERAL_WEBHOOK_HEADERS = "GeneralWebhookHeaders" ALARM_WEBHOOK_AT_USERS = "AlarmWebhookAtUsers" ALARM_WEBHOOK_IS_AT_ALL = "AlarmWebhookIsAtAll" ALARM_WEBHOOK_AT_GROUPS = "AlarmWebhookAtGroups" ALARM_WEBHOOK_INTEGRATION_NAME = "AlarmWebhookIntegrationName" NOTICE_RULES = "NoticeRules" RULE_NODE = "RuleNode" HAS_NEXT = "HasNext" HAS_END_NODE = "HasEndNode" RECEIVER_INFOS = "ReceiverInfos" CHILDREN = "Children" ALLOW_CONSUME = "AllowConsume" CONSUME_TOPIC = "ConsumeTopic" PROJECT_ID_UPPERCASE = "ProjectID" CONSUMER_GROUP_NAME = "ConsumerGroupName" TOPIC_ID_LIST = "TopicIDList" HEARTBEAT_TTL = "HeartbeatTTL" ORDERED_CONSUME = "OrderedConsume" CONSUMER_GROUPS = "ConsumerGroups" CONSUMER_NAME = "ConsumerName" TOPIC_ID_UPPERCASE = "TopicID" SHARD_ID_UPPERCASE = "ShardID" CHECKPOINT = "Checkpoint" UPDATE_TIME = "UpdateTime" CONSUMER = "Consumer" CONSUME_FROM = "ConsumeFrom" POSITION = "Position" HEARTBEAT_INTERVAL_IN_SECOND = "HeartbeatIntervalInSecond" DATA_FETCH_INTERVAL_IN_MILLISECOND = "DataFetchIntervalInMillisecond" FLUSH_CHECKPOINT_INTERVAL_IN_SECOND = "FlushCheckpointIntervalInSecond" MAX_FETCH_LOG_GROUP_COUNT = "MaxFetchLogGroupCount" ERROR_CONSUMER_GROUP_ALREADY_EXISTS = "ConsumerGroupAlreadyExists" ERROR_CONSUMER_HEARTBEAT_EXPIRED = "ConsumerHeartbeatExpired" STOP_TIMEOUT = "StopTimeout" RESOURCE_TYPE = "ResourceType" RESOURCES_LIST = "ResourcesList" RESOURCES_IDS = "ResourcesIds" TAG_KEY_LIST = "TagKeyList" TOS_SOURCE_INFO = "TosSourceInfo" KAFKA_SOURCE_INFO = "KafkaSourceInfo" IMPORT_SOURCE_INFO = "ImportSourceInfo" TARGET_INFO = "TargetInfo" TASK_INFO = "TaskInfo" TASK_STATISTICS = "TaskStatistics" SHIPPER_ID = "ShipperId" SHIPPER_NAME = "ShipperName" SHIPPER_TYPE = "ShipperType" SHIPPER_START_TIME = "ShipperStartTime" SHIPPER_END_TIME = "ShipperEndTime" DASHBOARD_ID = "DashboardId" ROLE_TRN = "RoleTrn" SHIPPERS = "Shippers" CONTENT_INFO = "ContentInfo" TOS_SHIPPER_INFO = "TosShipperInfo" KAFKA_SHIPPER_INFO = "KafkaShipperInfo" JSON_INFO = "JsonInfo" CSV_INFO = "CsvInfo" TRN = "trn" FROM_TLS = "from_tls" ENABLE_ENCRYPT_CONF = "enable" ENCRYPT_TYPE = "encrypt_type" REGION_ID = "region_id" USER_CMK_ID = "user_cmk_id" USER_CMK_INFO = "user_cmk_info" # ETL Task fields DSL_TYPE = "DSLType" ETL_STATUS = "ETLStatus" ETL_LAST_ENABLE_TIME = "LastEnableTime" ETL_TASK_ID = "TaskId" ETL_TASK_TYPE = "TaskType" ETL_SCRIPT = "Script" ETL_SOURCE_TOPIC_ID = "SourceTopicId" ETL_TARGET_RESOURCES = "TargetResources" ETL_ENABLE = "Enable" ETL_FROM_TIME = "FromTime" ETL_TO_TIME = "ToTime" ETL_TASK_DESCRIPTION = "Description" # Target resource fields TARGET_ALIAS = "Alias" TARGET_TOPIC_ID = "TopicId" TARGET_REGION = "Region" TARGET_ROLE_TRN = "RoleTrn" # GetAccountStatus API GET_ACCOUNT_STATUS = "/GetAccountStatus" ARCH_VERSION = "ArchVersion" # ETL APIs MODIFY_ETL_TASK_STATUS = "/ModifyETLTaskStatus" # Schedule SQL task fields TASK_NAME = "TaskName" SOURCE_TOPIC_NAME = "SourceTopicName" DEST_REGION = "DestRegion" DEST_PROJECT_ID = "DestProjectID" DEST_TOPIC_ID = "DestTopicID" DEST_TOPIC_NAME = "DestTopicName" PROCESS_START_TIME = "ProcessStartTime" PROCESS_END_TIME = "ProcessEndTime" PROCESS_SQL_DELAY = "ProcessSqlDelay" PROCESS_TIME_WINDOW = "ProcessTimeWindow" CREATE_TIME_STAMP = "CreateTimeStamp" MODIFY_TIME_STAMP = "ModifyTimeStamp" CRON_TIME_ZONE = "CronTimeZone" # Alarm Content Template APIs CREATE_ALARM_CONTENT_TEMPLATE = "/CreateAlarmContentTemplate" # Alarm Content Template fields ALARM_CONTENT_TEMPLATE_NAME = "AlarmContentTemplateName" ALARM_CONTENT_TEMPLATE_ID = "AlarmContentTemplateId" ALARM_CONTENT_TEMPLATES = "AlarmContentTemplates" IS_DEFAULT = "IsDefault" NEED_VALID_CONTENT = "NeedValidContent" DING_TALK = "DingTalk" LARK = "Lark" VMS = "Vms" WE_CHAT = "WeChat" DING_TALK_CONTENT_TEMPLATE = "DingTalkContentTemplate" EMAIL_CONTENT_TEMPLATE = "EmailContentTemplate" LARK_CONTENT_TEMPLATE = "LarkContentTemplate" SMS_CONTENT_TEMPLATE = "SmsContentTemplate" VMS_CONTENT_TEMPLATE = "VmsContentTemplate" WE_CHAT_CONTENT_TEMPLATE = "WeChatContentTemplate" WEBHOOK_CONTENT_TEMPLATE = "WebhookContentTemplate" TITLE = "Title" LOCALE = "Locale" CONTENT = "Content" SUBJECT = "Subject" # Alarm Webhook Integration APIs CREATE_ALARM_WEBHOOK_INTEGRATION = "/CreateAlarmWebhookIntegration" DELETE_ALARM_WEBHOOK_INTEGRATION = "/DeleteAlarmWebhookIntegration" # Alarm Webhook Integration fields WEBHOOK_HEADERS = "WebhookHeaders" ALARM_WEBHOOK_INTEGRATION_ID = "AlarmWebhookIntegrationId" WEBHOOK_ID = "WebhookID" WEBHOOK_INTEGRATIONS = "WebhookIntegrations" ================================================ FILE: volcengine/tls/consumer/__init__.py ================================================ ================================================ FILE: volcengine/tls/consumer/checkpoint_manager.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from readerwriterlock import rwlock from volcengine.tls.consumer.consumer_model import CheckpointInfo from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import ModifyCheckpointRequest class CheckpointManager: def __init__(self, consumer): self.consumer_config = consumer.consumer_config self.tls_service = consumer.tls_service self.checkpoint_info_map = {} self.map_lock = rwlock.RWLockFairD() self.working_flag = True self.logger = consumer.logger def run(self): self.logger.info("CheckpointManager for {} starts to work.".format(self.consumer_config.consumer_name)) while self.working_flag: try: last_upload_time = time.time() self.upload_checkpoint() sleep_time = self.consumer_config.flush_checkpoint_interval_in_second - (time.time() - last_upload_time) while sleep_time > 0 and self.working_flag: time.sleep(min(sleep_time, 1)) sleep_time = self.consumer_config.flush_checkpoint_interval_in_second - (time.time() - last_upload_time) except Exception as e: self.logger.error(e) while len(self.checkpoint_info_map) > 0: try: self.upload_checkpoint() except Exception as e: self.logger.error(e) self.logger.info("CheckpointManager for {} stops.".format(self.consumer_config.consumer_name)) def add_checkpoint(self, checkpoint_info: CheckpointInfo): with self.map_lock.gen_wlock(): shard_info = checkpoint_info.shard_info topic_id = shard_info.topic_id shard_id = shard_info.shard_id self.checkpoint_info_map[topic_id + str(shard_id)] = checkpoint_info def upload_checkpoint(self): with self.map_lock.gen_wlock(): checkpoint_snapshot = self.checkpoint_info_map.copy() project_id = self.consumer_config.project_id consumer_group_name = self.consumer_config.consumer_group_name uploaded_checkpoint_map = {} try: for key, value in checkpoint_snapshot.items(): shard_info = value.shard_info topic_id = shard_info.topic_id shard_id = shard_info.shard_id checkpoint = value.checkpoint req = ModifyCheckpointRequest(project_id, topic_id, shard_id, consumer_group_name, checkpoint) self.tls_service.modify_checkpoint(req) uploaded_checkpoint_map[key] = value except TLSException as e: self.logger.error("Uploading checkpoint failed.") raise e finally: with self.map_lock.gen_wlock(): for key, value in uploaded_checkpoint_map.items(): if value.checkpoint == self.checkpoint_info_map[key].checkpoint: del self.checkpoint_info_map[key] ================================================ FILE: volcengine/tls/consumer/consumer.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import threading import time from typing import List from volcengine.tls.TLSService import TLSService from volcengine.tls.const import ERROR_CONSUMER_GROUP_ALREADY_EXISTS from volcengine.tls.consumer.checkpoint_manager import CheckpointManager from volcengine.tls.consumer.consumer_model import ConsumerConfig, ConsumerStatus from volcengine.tls.consumer.heartbeat_runner import HeartbeatRunner from volcengine.tls.consumer.log_consumer import LogConsumer from volcengine.tls.data import ConsumeShard from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import CreateConsumerGroupRequest, DescribeConsumerGroupsRequest from volcengine.tls.util import get_logger class LogProcessor: @abc.abstractmethod def process(self, topic_id: str, shard_id: int, log_group_list: LogGroupList): raise NotImplementedError("Please implement the process method.") class TLSConsumer: def __init__(self, consumer_config: ConsumerConfig, tls_service: TLSService, log_processor: LogProcessor): consumer_config.validate() self.logger = get_logger("tls-python-sdk-consumer-logger") self.consumer_config = consumer_config self.tls_service = tls_service self.log_processor = log_processor self.working_flag = True self.heartbeat_runner = HeartbeatRunner(self) self.checkpoint_manager = CheckpointManager(self) self.worker_map = {} self.run_thread = None self.heartbeat_thread = None self.checkpoint_thread = None self.logger.info("TLS consumer {} is initialized.".format(self.consumer_config.consumer_name)) def start(self): self.working_flag = True self.heartbeat_runner.working_flag = True self.checkpoint_manager.working_flag = True self.init() thread_name_prefix = self.consumer_config.consumer_name self.heartbeat_thread = threading.Thread(target=self.heartbeat_runner.run, name=thread_name_prefix + "-HeartbeatRunner") self.checkpoint_thread = threading.Thread(target=self.checkpoint_manager.run, name=thread_name_prefix + "-CheckpointManager") self.run_thread = threading.Thread(target=self.run, name=thread_name_prefix) self.heartbeat_thread.start() self.checkpoint_thread.start() self.run_thread.start() def stop(self): stop_timeout = self.consumer_config.stop_timeout self.working_flag = False self.run_thread.join(timeout=stop_timeout) current_time = time.time() for worker in self.worker_map.values(): while True: if not worker.thread_running_status: break elapsed_time = time.time() - current_time if elapsed_time >= stop_timeout: self.logger.error("Stopping the thread timeouts and has already wait for {} seconds.".format(elapsed_time)) break time.sleep(1) self.worker_map.clear() self.checkpoint_manager.working_flag = False self.checkpoint_thread.join(timeout=stop_timeout) self.heartbeat_runner.working_flag = False self.heartbeat_thread.join(timeout=stop_timeout) self.logger.info("TLS consumer {} is stopped.".format(self.consumer_config.consumer_name)) def reset_access_key_token(self, access_key_id: str, access_key_secret: str, security_token: str = None): self.tls_service.reset_access_key_token(access_key_id, access_key_secret, security_token) def init(self): req = DescribeConsumerGroupsRequest(project_id=self.consumer_config.project_id, consumer_group_name=self.consumer_config.consumer_group_name) res = self.tls_service.describe_consumer_groups(req) for consumer_group in res.consumer_groups: if consumer_group.consumer_group_name == self.consumer_config.consumer_group_name: return req = CreateConsumerGroupRequest(project_id=self.consumer_config.project_id, consumer_group_name=self.consumer_config.consumer_group_name, topic_id_list=self.consumer_config.topic_id_list, heartbeat_ttl=3*self.consumer_config.heartbeat_interval_in_second, ordered_consume=self.consumer_config.ordered_consume) try: self.tls_service.create_consumer_group(req) except TLSException as e: if ERROR_CONSUMER_GROUP_ALREADY_EXISTS not in e.error_code: self.logger.error(e.__str__()) raise e def run(self): self.logger.info("Consumer {} starts to work.".format(self.consumer_config.consumer_name)) while self.working_flag: time.sleep(self.consumer_config.data_fetch_interval_in_millisecond / 1000) if not self.working_flag: break for worker in self.worker_map.values(): if worker.load_status() == ConsumerStatus.WAIT_FOR_RESTART: try: self.heartbeat_runner.upload_heartbeat() self.checkpoint_manager.upload_checkpoint() break except Exception as e: self.logger.error(e) shards = self.heartbeat_runner.get_shards() self.handle_shards(shards) def handle_shards(self, shards: List[ConsumeShard]): if shards is None: return shard_map = {} for shard in shards: shard_map[shard.topic_id + str(shard.shard_id)] = shard invalid_shards = [] for shard_name in self.worker_map.keys(): if shard_name not in shard_map: invalid_shards.append(shard_name) for shard_name in invalid_shards: del self.worker_map[shard_name] for key in shard_map.keys(): if key not in self.worker_map or self.worker_map[key].load_status() == ConsumerStatus.WAIT_FOR_RESTART: self.worker_map[key] = LogConsumer(self, shard_map[key]) for worker in self.worker_map.values(): worker.run() ================================================ FILE: volcengine/tls/consumer/consumer_model.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from enum import Enum from typing import List from volcengine.tls.const import * from volcengine.tls.data import ConsumeShard from volcengine.tls.tls_exception import TLSException def check_empty_string(value: str, field: str): if value is None or len(value) == 0: raise TLSException(error_code="InvalidArgument", error_message="{} should not be empty.".format(field)) def check_int_value_range(value: int, lower: int, upper: int, field: str): if value < lower or value > upper: raise TLSException(error_code="InvalidArgument", error_message="{} value should between {} and {}.".format(field, lower, upper)) class ConsumerConfig: def __init__(self, project_id: str, consumer_group_name: str, topic_id_list: List[str], consumer_name: str, consume_from: str = "begin", heartbeat_interval_in_second: int = 20, data_fetch_interval_in_millisecond: int = 200, flush_checkpoint_interval_in_second: int = 5, max_fetch_log_group_count: int = 100, ordered_consume: bool = False, stop_timeout: int = 15, compression: str = LZ4): self.project_id = project_id self.consumer_group_name = consumer_group_name self.topic_id_list = topic_id_list self.consumer_name = consumer_name self.consume_from = consume_from self.heartbeat_interval_in_second = heartbeat_interval_in_second self.data_fetch_interval_in_millisecond = data_fetch_interval_in_millisecond self.flush_checkpoint_interval_in_second = flush_checkpoint_interval_in_second self.max_fetch_log_group_count = max_fetch_log_group_count self.ordered_consume = ordered_consume self.stop_timeout = stop_timeout self.compression = compression def validate(self): check_empty_string(self.project_id, PROJECT_ID_UPPERCASE) check_empty_string(self.consumer_group_name, CONSUMER_GROUP_NAME) check_empty_string(self.consumer_name, CONSUMER_NAME) if self.topic_id_list is None or len(self.topic_id_list) == 0: raise TLSException(error_code="InvalidArgument", error_message="TopicIDList should not be empty.") for topic_id in self.topic_id_list: check_empty_string(topic_id, TOPIC_ID_UPPERCASE) check_empty_string(self.consumer_name, CONSUME_FROM) check_int_value_range(self.heartbeat_interval_in_second, 1, 300, HEARTBEAT_INTERVAL_IN_SECOND) check_int_value_range(self.data_fetch_interval_in_millisecond, 1, 300000, DATA_FETCH_INTERVAL_IN_MILLISECOND) check_int_value_range(self.flush_checkpoint_interval_in_second, 1, 300, FLUSH_CHECKPOINT_INTERVAL_IN_SECOND) check_int_value_range(self.max_fetch_log_group_count, 1, 1000, MAX_FETCH_LOG_GROUP_COUNT) check_int_value_range(self.stop_timeout, 1, 300, STOP_TIMEOUT) class CheckpointInfo: def __init__(self, checkpoint: str, shard_info: ConsumeShard): self.checkpoint = checkpoint self.shard_info = shard_info class ConsumerStatus(Enum): PENDING = "pending" INITIALIZING = "Initializing" READY_TO_FETCH = "ready_to_fetch" FETCHING = "fetching" READY_TO_CONSUME = "ready_to_consume" CONSUMING = "consuming" BACKOFF = "backoff" WAIT_FOR_RESTART = "wait_for_restart" ================================================ FILE: volcengine/tls/consumer/heartbeat_runner.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from typing import List from readerwriterlock import rwlock from volcengine.tls.data import ConsumeShard from volcengine.tls.tls_requests import ConsumerHeartbeatRequest class HeartbeatRunner: def __init__(self, consumer): self.consumer_config = consumer.consumer_config self.tls_service = consumer.tls_service self.shards = [] self.lock = rwlock.RWLockFairD() self.working_flag = True self.logger = consumer.logger def run(self): self.logger.info("HeartbeatRunner for {} starts to work.".format(self.consumer_config.consumer_name)) while self.working_flag: try: last_heartbeat_time = time.time() self.upload_heartbeat() sleep_time = self.consumer_config.heartbeat_interval_in_second - (time.time() - last_heartbeat_time) while sleep_time > 0 and self.working_flag: time.sleep(min(sleep_time, 1)) sleep_time = self.consumer_config.heartbeat_interval_in_second - (time.time() - last_heartbeat_time) except Exception as e: self.logger.error(e) self.logger.info("HeartbeatRunner for {} stops.".format(self.consumer_config.consumer_name)) def get_shards(self): with self.lock.gen_rlock(): shards = self.shards return shards def set_shards(self, shards: List[ConsumeShard]): with self.lock.gen_wlock(): self.shards = shards def upload_heartbeat(self): req = ConsumerHeartbeatRequest(project_id=self.consumer_config.project_id, consumer_group_name=self.consumer_config.consumer_group_name, consumer_name=self.consumer_config.consumer_name) resp = self.tls_service.consumer_heartbeat(req) self.set_shards(resp.shards) ================================================ FILE: volcengine/tls/consumer/log_consumer.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import time from readerwriterlock import rwlock from volcengine.tls.const import LZ4, ERROR_CONSUMER_HEARTBEAT_EXPIRED from volcengine.tls.consumer.consumer_model import ConsumerStatus, CheckpointInfo from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import DescribeCheckpointRequest, DescribeCursorRequest, ConsumeLogsRequest class LogConsumer: def __init__(self, consumer, consume_shard): self.consumer_config = consumer.consumer_config self.tls_service = consumer.tls_service self.log_processor = consumer.log_processor self.checkpoint_manager = consumer.checkpoint_manager self.status = ConsumerStatus.PENDING self.shard = consume_shard self.next_checkpoint = None self.curr_log_group_list = None self.last_backoff_time = time.time() self.status_lock = rwlock.RWLockFairD() self.thread_running_status = False self.logger = consumer.logger def run(self): status = self.load_status() if status == ConsumerStatus.PENDING: self.set_status(ConsumerStatus.INITIALIZING) self.thread_running_status = True threading.Thread(target=self.run_with_status, args=(self.init, ConsumerStatus.READY_TO_FETCH, ConsumerStatus.PENDING)).start() elif status == ConsumerStatus.READY_TO_FETCH: self.set_status(ConsumerStatus.FETCHING) self.thread_running_status = True threading.Thread(target=self.run_with_status, args=(self.fetch_data, ConsumerStatus.READY_TO_CONSUME, ConsumerStatus.READY_TO_FETCH)).start() elif status == ConsumerStatus.READY_TO_CONSUME: self.set_status(ConsumerStatus.CONSUMING) self.thread_running_status = True threading.Thread(target=self.run_with_status, args=(self.consume, ConsumerStatus.READY_TO_FETCH, ConsumerStatus.READY_TO_CONSUME)).start() elif status == ConsumerStatus.BACKOFF: if self.backoff(): self.set_status(ConsumerStatus.BACKOFF) else: self.set_status(ConsumerStatus.READY_TO_FETCH) def run_with_status(self, func, done_status, err_status): try: func() self.set_status(done_status) except TLSException as e: if ERROR_CONSUMER_HEARTBEAT_EXPIRED in e.error_code: self.set_status(ConsumerStatus.WAIT_FOR_RESTART) elif e.http_code == 429: self.set_status(ConsumerStatus.BACKOFF) else: self.logger.error(e) self.set_status(err_status) except Exception as e: self.logger.error(e) self.set_status(err_status) finally: self.thread_running_status = False def set_status(self, status): with self.status_lock.gen_wlock(): self.status = status def load_status(self): with self.status_lock.gen_rlock(): status = self.status return status def init(self): project_id = self.consumer_config.project_id topic_id = self.shard.topic_id shard_id = self.shard.shard_id consumer_group_name = self.consumer_config.consumer_group_name req = DescribeCheckpointRequest(project_id, topic_id, shard_id, consumer_group_name) resp = self.tls_service.describe_checkpoint(req) if resp.checkpoint is not None and len(resp.checkpoint) > 0: self.next_checkpoint = resp.checkpoint return req = DescribeCursorRequest(topic_id, shard_id, from_time=self.consumer_config.consume_from) resp = self.tls_service.describe_cursor(req) self.next_checkpoint = resp.cursor def fetch_data(self): self.last_backoff_time = time.time() req = ConsumeLogsRequest(topic_id=self.shard.topic_id, shard_id=self.shard.shard_id, cursor=self.next_checkpoint, log_group_count=self.consumer_config.max_fetch_log_group_count, compression=self.consumer_config.compression, consumer_group_name=self.consumer_config.consumer_group_name, consumer_name=self.consumer_config.consumer_name) resp = self.tls_service.consume_logs(req) self.curr_log_group_list = resp.get_pb_message() self.next_checkpoint = resp.get_x_tls_cursor() def consume(self): if self.curr_log_group_list is None or len(self.curr_log_group_list.log_groups) == 0: return self.log_processor.process(topic_id=self.shard.topic_id, shard_id=self.shard.shard_id, log_group_list=self.curr_log_group_list) self.checkpoint_manager.add_checkpoint(CheckpointInfo(self.next_checkpoint, self.shard)) def backoff(self): return time.time() - self.last_backoff_time < 5 ================================================ FILE: volcengine/tls/data.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import re from typing import List, Dict from volcengine.tls.const import * def pascal_to_snake(pascal: str) -> str: # 先在小写/数字与大写字母之间插入下划线,再在连续大写后接小写的边界插入下划线, # 以便正确处理诸如 ID、DSL 等缩略词。 s1 = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", pascal) s2 = re.sub(r"([A-Z]+)([A-Z][a-z0-9])", r"\1_\2", s1) return s2.lower().strip('_') def snake_to_pascal(snake: str) -> str: return ''.join(word.title() for word in snake.split('_')) class TLSData: @classmethod def set_attributes(cls, data: dict): if data is None or len(data) == 0: return None tls_data_dict = {} for key in data.keys(): tls_data_dict[pascal_to_snake(key)] = data[key] tls_data = cls() for key in tls_data.__dict__.keys(): tls_data.__dict__[key] = None tls_data.__dict__.update(tls_data_dict) return tls_data def json(self): json_data = {} for key in self.__dict__.keys(): if self.__dict__[key] is not None: json_data[snake_to_pascal(key)] = self.__dict__[key] return json_data class TagInfo(TLSData): def __init__(self, key: str, value: str = None): """ :param key: 标签Key的值 :param value: 标签Value的值 """ self.key = key self.value = value class ProjectInfo(TLSData): def __init__(self, project_name: str = None, project_id: str = None, description: str = None, create_time: str = None, inner_net_domain: str = None, topic_count: int = None, iam_project_name: str = None, tags: List[TagInfo] = None): self.project_name = project_name self.project_id = project_id self.description = description self.create_time = create_time self.inner_net_domain = inner_net_domain self.topic_count = topic_count self.iam_project_name = iam_project_name self.tags = tags @classmethod def set_attributes(cls, data: dict): project_info = super(ProjectInfo, cls).set_attributes(data) if TAGS in data: tags = data[TAGS] project_info.tags = [] for i in range(len(tags)): project_info.tags.append( # pylint: disable=no-member TagInfo(tags[i].get(KEY), tags[i].get(VALUE))) return project_info def get_inner_net_domain(self): """ :return:内网连接域名 :rtype:str """ return self.inner_net_domain def get_create_time(self): """ :return: 创建时间 :rtype: str """ return self.create_time def get_project_id(self): """ :return: 日志项目 ID :rtype: str """ return self.project_id def get_description(self): """ :return:日志项目描述 :rtype: str """ return self.description def get_project_name(self): """ :return:日志项目名称 :rtype:str """ return self.project_name def get_topic_count(self): """ :return:日志项目下的日志主题数量 :rtype:int """ return self.topic_count def get_iam_project_name(self): """ :return: 日志项目所属的IAM项目 :rtype: str """ return self.iam_project_name def get_tags(self): """ :return: 日志项目标签信息 :rtype: List[TagInfo] """ return self.tags class EncryptUserCmkConf(TLSData): def __init__(self, user_cmk_id: str, trn: str, region_id: str, from_tls: bool = None): self.user_cmk_id = user_cmk_id self.trn = trn self.region_id = region_id self.from_tls = from_tls @classmethod def set_attributes(cls, data): user_cmk_id = data.get(USER_CMK_ID) trn = data.get(TRN) region_id = data.get(REGION_ID) from_tls = data.get(FROM_TLS) return cls(user_cmk_id, trn, region_id, from_tls) def json(self): res = { USER_CMK_ID: self.user_cmk_id, TRN: self.trn, REGION_ID: self.region_id, } if self.from_tls is not None: res[FROM_TLS] = self.from_tls return res class EncryptConf(TLSData): def __init__(self, enable: bool = False, encrypt_type: str = "default", user_cmk_info: EncryptUserCmkConf = None): self.enable = enable self.encrypt_type = encrypt_type self.user_cmk_info = user_cmk_info @classmethod def set_attributes(cls, data): enable = data.get(ENABLE_ENCRYPT_CONF) encrypt_type = data.get(ENCRYPT_TYPE) user_cmk_info = None user_cmk_info_data = data.get(USER_CMK_INFO) if user_cmk_info_data is not None and isinstance(user_cmk_info_data, dict): user_cmk_info = EncryptUserCmkConf.set_attributes(data=user_cmk_info_data) return cls(enable, encrypt_type, user_cmk_info) def json(self): return { ENABLE_ENCRYPT_CONF: self.enable, ENCRYPT_TYPE: self.encrypt_type, USER_CMK_INFO: self.user_cmk_info.json() if self.user_cmk_info is not None else None, } class BindProcessor(TLSData): def __init__(self, processor_id: str = None, processor_name: str = None): self.processor_id = processor_id self.processor_name = processor_name @classmethod def set_attributes(cls, data: dict): processor_id = data.get(PROCESSOR_ID) processor_name = data.get(PROCESSOR_NAME) return cls(processor_id, processor_name) def json(self): return { PROCESSOR_ID: self.processor_id, PROCESSOR_NAME: self.processor_name, } class ProcessorInfo(TLSData): def __init__(self, project_name: str = None, processor_id: str = None, project_id: str = None, account_id: str = None, processor_name: str = None, description: str = None, dsl_content: str = None, processor_type: str = None, processor_dsl_type: str = None, processor_status: str = None, fail_strategy: str = None, timeout_ms: int = None, max_qps: int = None, create_time: str = None, update_time: str = None): self.project_name = project_name self.processor_id = processor_id self.project_id = project_id self.account_id = account_id self.processor_name = processor_name self.description = description self.dsl_content = dsl_content self.processor_type = processor_type self.processor_dsl_type = processor_dsl_type self.processor_status = processor_status self.fail_strategy = fail_strategy self.timeout_ms = timeout_ms self.max_qps = max_qps self.create_time = create_time self.update_time = update_time class ProcessorTopicInfo(TLSData): def __init__(self, topic_id: str = None, topic_name: str = None): self.topic_id = topic_id self.topic_name = topic_name class ProcessorBinding(TLSData): def __init__(self, topic_id: str = None, processor_id: str = None): self.topic_id = topic_id self.processor_id = processor_id class ProcessorFunctionArgument(TLSData): def __init__(self, index: int = None, name: str = None, argument_type: str = None, description: str = None, is_necessary: bool = None, default_value: str = None): self.index = index self.name = name self.argument_type = argument_type self.description = description self.is_necessary = is_necessary self.default_value = default_value class ProcessorFunctionSample(TLSData): def __init__(self, index: int = None, log: List[Dict] = None, script: str = None, result: List[Dict] = None, description: str = None): self.index = index self.log = log self.script = script self.result = result self.description = description class ProcessorFunctionInfo(TLSData): def __init__(self, name: str = None, function_type: str = None, method_signature: str = None, description: str = None, samples: List[ProcessorFunctionSample] = None, arguments: List[ProcessorFunctionArgument] = None): self.name = name self.function_type = function_type self.method_signature = method_signature self.description = description self.samples = samples self.arguments = arguments @classmethod def set_attributes(cls, data: dict): info = super(ProcessorFunctionInfo, cls).set_attributes(data) if info is None: return None info.samples = [ ProcessorFunctionSample.set_attributes(sample) for sample in (info.samples or []) # pylint: disable=no-member ] info.arguments = [ ProcessorFunctionArgument.set_attributes(argument) for argument in (info.arguments or []) # pylint: disable=no-member ] return info class TopicInfo(TLSData): def __init__(self, topic_name: str = None, topic_id: str = None, project_id: str = None, ttl: int = None, create_time: str = None, modify_time: str = None, shard_count: int = None, description: str = None, auto_split: bool = None, max_split_shard: int = None, enable_tracking: bool = None, time_key: str = None, time_format: str = None, tags: List[TagInfo] = None, log_public_ip: bool = None, enable_hot_ttl: bool = None, hot_ttl: int = None, cold_ttl: int = None, archive_ttl: int = None, encrypt_conf: EncryptConf = None, bind_processor=None, metering_mode: str = None, project_name: str = None, region: str = None, tls_version: str = None): self.topic_name = topic_name self.topic_id = topic_id self.project_id = project_id self.ttl = ttl self.create_time = create_time self.modify_time = modify_time self.shard_count = shard_count self.description = description self.auto_split = auto_split self.max_split_shard = max_split_shard self.enable_tracking = enable_tracking self.time_key = time_key self.time_format = time_format self.tags = tags self.log_public_ip = log_public_ip self.enable_hot_ttl = enable_hot_ttl self.hot_ttl = hot_ttl self.cold_ttl = cold_ttl self.archive_ttl = archive_ttl self.encrypt_conf = encrypt_conf self.bind_processor = bind_processor self.metering_mode = metering_mode self.project_name = project_name self.region = region self.tls_version = tls_version @classmethod def set_attributes(cls, data: dict): bind_processor = None bind_processor_data = data.get(BIND_PROCESSOR) if bind_processor_data is not None and isinstance(bind_processor_data, dict): bind_processor = BindProcessor.set_attributes(data=bind_processor_data) metering_mode = data.get(METERING_MODE) topic_name = data.get(TOPIC_NAME) topic_id = data.get(TOPIC_ID) project_id = data.get(PROJECT_ID) project_name = data.get(PROJECT_NAME) region = data.get(REGION) tls_version = data.get(TLS_VERSION) ttl = data.get(TTL) create_time = data.get(CREATE_TIME) modify_time = data.get(MODIFY_TIME) shard_count = data.get(SHARD_COUNT) description = data.get(DESCRIPTION) auto_split = data.get(AUTO_SPLIT) max_split_shard = data.get(MAX_SPLIT_SHARD) enable_tracking = data.get(ENABLE_TRACKING) time_key = data.get(TIME_KEY) time_format = data.get(TIME_FORMAT) topic_tags = None log_public_ip = data.get(LOG_PUBLIC_IP) enable_hot_ttl = data.get(ENABLE_HOT_TTL) hot_ttl = data.get(HOT_TTL) cold_ttl = data.get(COLD_TTL) archive_ttl = data.get(ARCHIVE_TTL) encrypt_conf = None encrypt_conf_data = data.get(ENCRYPT_CONF) if encrypt_conf_data is not None and isinstance(encrypt_conf_data, dict): encrypt_conf = EncryptConf.set_attributes(data=encrypt_conf_data) tags = data.get(TAGS) if tags is not None: topic_tags = [] for i in range(len(tags)): topic_tags.append( TagInfo(tags[i].get(KEY), tags[i].get(VALUE))) return cls(topic_name, topic_id, project_id, ttl, create_time, modify_time, shard_count, description, auto_split, max_split_shard, enable_tracking, time_key, time_format, topic_tags, log_public_ip, enable_hot_ttl, hot_ttl, cold_ttl, archive_ttl, encrypt_conf, bind_processor, metering_mode, project_name, region, tls_version) def get_create_time(self): """ :return: 创建时间 :rtype: str """ return self.create_time def get_project_id(self): """ :return: 日志项目 ID :rtype: str """ return self.project_id def get_modify_time(self): """ :return:修改时间 :rtype: str """ return self.modify_time def get_shard_count(self): """ :return:日志分区的数量 :rtype: int """ return self.shard_count def get_topic_name(self): """ :return: 日志主题名称 :rtype: str """ return self.topic_name def get_description(self): """ :return:日志主题描述 :rtype: str """ return self.description def get_topic_id(self): """ :return: 日志主题 ID :rtype: str """ return self.topic_id def get_ttl(self): """ :return: 日志在日志服务中的保存时间, 单位天 :rtype: int """ return self.ttl def is_auto_split(self): """ :return: 是否开启分区的自动分裂功能 :rtype: bool """ return self.auto_split def get_max_split_shard(self): """ :return: 分区的最大分裂数 :rtype: int """ return self.max_split_shard def is_enable_tracking(self): """ :return: 是否开启了WebTracking功能 :rtype: bool """ return self.enable_tracking def get_time_key(self): """ :return: 日志时间字段的字段名称 :rtype: str """ return self.time_key def get_time_format(self): """ :return: 时间字段的解析格式 :rtype: str """ return self.time_format def get_tags(self): """ :return: 日志主题标签信息 :rtype: List[TagInfo] """ return self.tags def get_log_public_ip(self): """ :return: 是否开启了记录外网IP功能 :rtype: bool """ return self.log_public_ip class FullTextInfo(TLSData): def __init__(self, case_sensitive: bool = None, delimiter: str = None, include_chinese: bool = False): """ :param case_sensitive: 是否大小写敏感 :type case_sensitive:bool :param delimiter:全文索引的分词符 :type delimiter:string :param include_chinese:是否包含中文 :type include_chinese:bool """ self.case_sensitive = case_sensitive self.delimiter = delimiter self.include_chinese = include_chinese def get_delimiter(self): """ :return: 全文索引的分词符 :rtype: string """ return self.delimiter def get_case_sensitive(self): """ :return: 是否大小写敏感 :rtype: bool """ return self.case_sensitive def get_include_chinese(self): """ :return:是否包含中文 :rtype: bool """ return self.include_chinese @classmethod def set_attributes(cls, data: dict): case_sensitive = data.get(CASE_SENSITIVE) delimiter = data.get(DELIMITER) include_chinese = data.get(INCLUDE_CHINESE) return cls(case_sensitive, delimiter, include_chinese) class ValueInfo(TLSData): def __init__(self, value_type: str, delimiter: str = None, case_sensitive: bool = False, include_chinese: bool = False, sql_flag: bool = False, index_all: bool = False, json_keys=None, auto_index_flag: bool = False): self.value_type = value_type self.delimiter = delimiter self.case_sensitive = case_sensitive self.include_chinese = include_chinese self.sql_flag = sql_flag self.index_all = index_all self.auto_index_flag = auto_index_flag if value_type == "json": self.json_keys = json_keys else: self.json_keys = None @classmethod def set_attributes(cls, data: dict): value_type = data.get(VALUE_TYPE) delimiter = data.get(DELIMITER) case_sensitive = data.get(CASE_SENSITIVE) include_chinese = data.get(INCLUDE_CHINESE) sql_flag = data.get(SQL_FLAG) index_all = data.get(INDEX_ALL) json_keys = data.get(JSON_KEYS) auto_index_flag = data.get(AUTO_INDEX_FLAG, False) return cls(value_type, delimiter, case_sensitive, include_chinese, sql_flag, index_all, json_keys, auto_index_flag) def get_auto_index_flag(self): """ :return: 该索引是否是自动索引添加 :rtype: bool """ return self.auto_index_flag class KeyValueInfo(TLSData): def __init__(self, key: str, value: ValueInfo): """ :param key:需要配置键值索引的字段名称 :type key:string :param value:需要配置键值索引的字段描述信息 :type value:string """ self.key = key self.value = value def json(self): return {KEY: self.key, VALUE: self.value.json()} @classmethod def set_attributes(cls, data: dict): key = data.get(KEY) value = data.get(VALUE) # 索引场景下 Value 是 ValueInfo,Trace 场景下 Value 为普通字符串 if isinstance(value, dict): value = ValueInfo.set_attributes(data=value) return cls(key=key, value=value) class AnalysisResult(TLSData): def __init__(self, analysis_schema: List[str] = None, analysis_type: dict = None, analysis_data: List[dict] = None): self.analysis_schema = analysis_schema self.analysis_type = analysis_type self.analysis_data = analysis_data def get_analysis_schema(self): """ :return:日志分析列的名称 :rtype:List[str] """ return self.analysis_schema def get_analysis_type(self): """ :return:日志分析列对应的属性 :rtype:dict """ return self.analysis_type def get_analysis_data(self): """ :return:分析结果返回的键值对 :rtype:List[dict] """ return self.analysis_data @classmethod def set_attributes(cls, data: dict): analysis_schema = data.get(SCHEMA) analysis_type = data.get(TYPE) analysis_data = data.get(DATA) return cls(analysis_schema, analysis_type, analysis_data) class SearchResult(TLSData): def __init__(self, result_status: str = None, hit_count: int = None, list_over: bool = None, analysis: bool = None, count: int = None, limit: int = None, context: str = None, logs: List[dict] = None, analysis_result: AnalysisResult = None, highlight: List[dict] = None, elapsed_millisecond: int = None): self.result_status = result_status self.hit_count = hit_count self.list_over = list_over self.analysis = analysis self.count = count self.limit = limit self.context = context self.logs = logs self.analysis_result = analysis_result self.highlight = highlight self.elapsed_millisecond = elapsed_millisecond def get_list_over(self): """ :return: 是否已返回全部结果 :rtype:bool """ return self.list_over def get_analysis_result(self): """ :return: 分析结果 :rtype: AnalysisResult """ return self.analysis_result def get_result_status(self): """ :return: 查询的状态 :rtype:str """ return self.result_status def get_count(self): """ :return: 分析请求命中的条目数 :rtype: int """ return self.count def get_limit(self): """ :return:请求中指定返回的 Limit 条目数 :rtype: int """ return self.limit def get_context(self): """ :return:仅检索日志时,翻页上下文 :rtype: str """ return self.context def get_hit_count(self): """ :return:搜索匹配的总条目数 :rtype: int """ return self.hit_count def get_analysis(self): """ :return:是否分析请求 :rtype:bool """ return self.analysis def get_logs(self): """ :return:检索日志结果 :rtype: List[dict] """ return self.logs def get_highlight(self): """ :return:高亮显示的关键字 :rtype: List[dict] """ return self.highlight def get_elapsed_millisecond(self): """ :return:本次检索所使用的时间,单位为毫秒 :rtype: int """ return self.elapsed_millisecond @classmethod def set_attributes(cls, data: dict): search_result = super(SearchResult, cls).set_attributes(data) if ANALYSIS_RESULT in data: search_result.analysis_result = AnalysisResult.set_attributes( data=data[ANALYSIS_RESULT]) # HighLight 字段在后端使用不规则大小写,pascal_to_snake 会将其转换为 "high_light", # 导致默认映射不到 SearchResult.highlight 属性,这里显式修正映射关系。 if "HighLight" in data: search_result.highlight = data["HighLight"] # ElapsedMillisecond 字段按常规 PascalCase -> snake_case 映射为 elapsed_millisecond, # 但为了避免未来结构调整遗漏,这里也显式同步一次。 if "ElapsedMillisecond" in data: search_result.elapsed_millisecond = data["ElapsedMillisecond"] return search_result class QueryResp(TLSData): def __init__(self, topic_id: str = None, shard_id: int = None, inclusive_begin_key: str = None, exclusive_end_key: str = None, status: str = None, modify_time: str = None, stop_write_time: str = None): """查询分区信息 :param topic_id: 日志主题 ID :type topic_id: str :param shard_id: 分区 ID :type shard_id: int :param inclusive_begin_key: 分区起始的 key 值(包含) :type inclusive_begin_key: str :param exclusive_end_key: 分区结束的 key 值(不包含) :type exclusive_end_key: str :param status: 分区状态,readwrite:读写,readonly:只读 :type status: str :param modify_time: 分区修改时间 :type modify_time: str :param stop_write_time: 分区停止写入的时间 :type stop_write_time: str """ self.topic_id = topic_id self.shard_id = shard_id self.inclusive_begin_key = inclusive_begin_key self.exclusive_end_key = exclusive_end_key self.status = status self.modify_time = modify_time self.stop_write_time = stop_write_time def get_exclusive_end_key(self): """返回分区结束的 key 值""" return self.exclusive_end_key def get_inclusive_begin_key(self): """返回分区起始的 key 值""" return self.inclusive_begin_key def get_shard_id(self): """返回日志主题的分区 ID""" return self.shard_id def get_modify_time(self): """返回分区修改时间""" return self.modify_time def get_topic_id(self): """返回日志主题的 ID""" return self.topic_id def get_status(self): """返回分区状态(readwrite:读写,readonly:只读)""" return self.status def get_stop_write_time(self): """返回分区停止写入的时间""" return self.stop_write_time class HistogramInfo(TLSData): def __init__(self, time: int = None, count: int = None): self.time = time self.count = count def get_count(self): """ :return:子区间中对应搜索结果的数量 :rtype:int """ return self.count def get_time(self): """ :return:子区间的起始时间点,单位为毫秒 :rtype:long """ return self.time class HistogramInfoV1(TLSData): def __init__(self, count: int = None, start_time: int = None, end_time: int = None, result_status: str = None): self.count = count self.start_time = start_time self.end_time = end_time self.result_status = result_status def get_count(self): """ :return:子区间中对应搜索结果的数量,即该时段内符合条件的日志条数 :rtype:int """ return self.count def get_start_time(self): """ :return:查询的开始时间点,单位为毫秒 :rtype:long """ return self.start_time def get_end_time(self): """ :return:查询的开始时间点,单位为毫秒 :rtype:long """ return self.end_time def get_result_status(self): """ :return:查询的状态 :rtype:str """ return self.result_status class LogContextInfos(TLSData): def __init__(self, source: str = None, context_flow: str = None, package_offset: int = None): """下载上下文查询所需的日志信息 :param source: 日志来源的主机 :type source: str :param context_flow: 指定日志所在的 LogGroup 的 ID :type context_flow: str :param package_offset: 指定日志在 LogGroup 中的序号 :type package_offset: int """ self.source = source self.context_flow = context_flow self.package_offset = package_offset @classmethod def set_attributes(cls, data: dict): if data is None: return None source = data.get(SOURCE) context_flow = data.get(CONTEXT_FLOW) package_offset = data.get(PACKAGE_OFFSET) return cls(source, context_flow, package_offset) def get_source(self): """ :return: 日志来源的主机 :rtype: str """ return self.source def get_context_flow(self): """ :return: 日志所在的 LogGroup 的 ID :rtype: str """ return self.context_flow def get_package_offset(self): """ :return: 日志在 LogGroup 中的序号 :rtype: int """ return self.package_offset class TaskInfo(TLSData): def __init__(self, task_id: str = None, task_name: str = None, topic_id: str = None, query: str = None, start_time: str = None, end_time: str = None, data_format: str = None, task_status: str = None, compression: str = None, create_time: str = None, log_size: int = None, log_count: int = None, task_type: int = None, allow_incomplete: bool = None, log_context_infos: LogContextInfos = None): self.task_id = task_id self.task_name = task_name self.topic_id = topic_id self.query = query self.start_time = start_time self.end_time = end_time self.data_format = data_format self.task_status = task_status self.compression = compression self.create_time = create_time self.log_size = log_size self.log_count = log_count self.task_type = task_type self.allow_incomplete = allow_incomplete self.log_context_infos = log_context_infos def get_task_name(self): """ :return:下载任务的名称 :rtype: str """ return self.task_name def get_start_time(self): """ :return:起始时间。格式为 yyyy-MM-dd HH:mm:ss :rtype: str """ return self.start_time def get_data_format(self): """ :return:导出的文件格式,支持 CSV 文件格式或 JSON 格式 :rtype: str """ return self.data_format def get_task_status(self): """ :return:下载任务状态 :rtype:str """ return self.task_status def get_log_count(self): """ :return:下载的日志条数 :rtype: int """ return self.log_count def get_create_time(self): """ :return:下载任务的创建时间 :rtype: str """ return self.create_time def get_query(self): """ :return:日志检索分析语句 :rtype:str """ return self.query def get_end_time(self): """ :return:结束时间。格式为 yyyy-MM-dd HH:mm:ss :rtype: str """ return self.end_time def get_task_id(self): """ :return:下载任务的 ID :rtype:str """ return self.task_id def get_log_size(self): """ :return:下载的日志量,单位为字节(Byte) :rtype:long """ return self.log_size def get_topic_id(self): """ :return:日志主题名称 :rtype:str """ return self.topic_id def get_compression(self): """ :return:导出文件的压缩格式 :rtype:str """ return self.compression def get_task_type(self): """ :return:下载的日志类型 :rtype: int """ return self.task_type def get_allow_incomplete(self): """ :return:是否允许下载查询不精确结果日志 :rtype: bool """ return self.allow_incomplete def get_log_context_infos(self): """ :return:下载上下文查询所需的日志信息 :rtype: LogContextInfos """ return self.log_context_infos @classmethod def set_attributes(cls, data: dict): if data is None: return None task_id = data.get(TASK_ID) task_name = data.get(TASK_NAME) topic_id = data.get(TOPIC_ID) query = data.get(QUERY) start_time = data.get(START_TIME) end_time = data.get(END_TIME) data_format = data.get(DATA_FORMAT) task_status = data.get(TASK_STATUS) compression = data.get(COMPRESSION) create_time = data.get(CREATE_TIME) log_size = data.get(LOG_SIZE) log_count = data.get(LOG_COUNT) task_type = data.get(ETL_TASK_TYPE) allow_incomplete = data.get(ALLOW_INCOMPLETE) log_context_infos_data = data.get(LOG_CONTEXT_INFOS) log_context_infos = None if log_context_infos_data is not None: log_context_infos = LogContextInfos.set_attributes(data=log_context_infos_data) return cls(task_id, task_name, topic_id, query, start_time, end_time, data_format, task_status, compression, create_time, log_size, log_count, task_type, allow_incomplete, log_context_infos) class HostInfo(TLSData): def __init__(self, ip: str = None, log_collector_version: str = None, heartbeat_status: int = None): self.ip = ip self.log_collector_version = log_collector_version self.heartbeat_status = heartbeat_status def get_ip(self): """ :return:机器的 IP 地址 :rtype: str """ return self.ip def get_log_collector_version(self): """ :return:机器安装的 LogCollector 的版本 :rtype:str """ return self.log_collector_version def get_heartbeat_status(self): """ :return:Agent 的心跳状态。0:心跳正常 1:心跳异常。 :rtype:int """ return self.heartbeat_status class HostGroupInfo(TLSData): def __init__(self, host_group_id: str = None, host_group_name: str = None, host_group_type: str = None, host_identifier: str = None, host_count: int = None, normal_heartbeat_status_count: int = None, abnormal_heartbeat_status_count: int = None, rule_count: int = None, create_time: str = None, modify_time: str = None, auto_update: bool = False, update_start_time: str = None, update_end_time: str = None, agent_latest_version: str = None, service_logging: bool = None, iam_project_name: str = None): self.host_group_id = host_group_id self.host_group_name = host_group_name self.host_group_type = host_group_type self.host_identifier = host_identifier self.host_count = host_count self.normal_heartbeat_status_count = normal_heartbeat_status_count self.abnormal_heartbeat_status_count = abnormal_heartbeat_status_count self.rule_count = rule_count self.create_time = create_time self.modify_time = modify_time self.auto_update = auto_update self.update_start_time = update_start_time self.update_end_time = update_end_time self.agent_latest_version = agent_latest_version self.service_logging = service_logging self.iam_project_name = iam_project_name def get_update_end_time(self): """ :return: 自动升级的结束时间 :rtype: str """ return self.update_end_time def get_update_start_time(self): """ :return: 自动升级的开始时间 :rtype: str """ return self.update_start_time def get_create_time(self): """ :return: 机器组创建时间 :rtype: str """ return self.create_time def get_host_count(self): """ :return: 机器数量 :rtype: int """ return self.host_count def get_modify_time(self): """ :return: 机器组修改时间 :rtype: str """ return self.modify_time def get_host_group_type(self): """ :return: 机器组类型 :rtype: str """ return self.host_group_type def get_host_group_id(self): """ :return: 机器组ID :rtype: str """ return self.host_group_id def get_host_identifier(self): """ :return: 机器标识符 :rtype: str """ return self.host_identifier def get_abnormal_heartbeat_status_count(self): """ :return: 心跳异常的机器数量 :rtype: int """ return self.abnormal_heartbeat_status_count def get_auto_update(self): """ :return: 是否开启自动升级功能 :rtype: bool """ return self.auto_update def get_host_group_name(self): """ :return: 机器组名称 :rtype: str """ return self.host_group_name def get_agent_latest_version(self): """ :return: 日志服务发布的LogCollector最新版本号 :rtype: str """ return self.agent_latest_version def get_normal_heartbeat_status_count(self): """ :return: 心跳正常的机器数量 :rtype: int """ return self.normal_heartbeat_status_count def get_rule_count(self): """ :return: 绑定的采集配置的数量 :rtype: int """ return self.rule_count def get_service_logging(self): """ :return: 是否开启Logcollector服务日志功能 :rtype: bool """ return self.service_logging def get_iam_project_name(self): """ :return: 机器组所属的IAM项目 :rtype: str """ return self.iam_project_name class FilterKeyRegex(TLSData): def __init__(self, key: str, regex: str): """ :param key: 过滤字段的名称 :type key:str :param regex:过滤字段的日志内容需要匹配的正则表达式 :type regex:str """ self.key = key self.regex = regex @classmethod def set_attributes(cls, data: dict): key = data.get(KEY) regex = data.get(REGEX) return cls(key, regex) class LogTemplate(TLSData): def __init__(self, log_type: str, log_format: str): """ :param log_type:日志模板的类型:Nginx :type log_type:str :param log_format:日志模板内容 :type log_format:str """ self.log_type = log_type self.log_format = log_format def json(self): return {TYPE: self.log_type, FORMAT: self.log_format} class ExtractRule(TLSData): def __init__(self, delimiter: str = None, begin_regex: str = None, log_regex: str = None, keys: List[str] = None, time_key: str = None, time_format: str = None, time_zone: str = None, filter_key_regex: List[FilterKeyRegex] = None, un_match_up_load_switch: bool = None, un_match_log_key: str = None, log_template: LogTemplate = None, quote: str = None, time_extract_regex: str = None, enable_nanosecond: bool = False, time_sample: str = None): """ :param delimiter: 日志分隔符 :type delimiter: str :param begin_regex: 第一行日志需要匹配的正则表达式 :type begin_regex: str :param log_regex: 整条日志需要匹配的正则表达式 :type log_regex: str :param keys: 日志字段名称 :type keys: List[str] :param time_key: 日志时间字段的字段名称 :type time_key: str :param time_format: 时间字段的解析格式 :type time_format: str :param time_zone: 日志时间字段的时区 :type time_zone: str :param filter_key_regex: 过滤字段的正则表达式 :type filter_key_regex: List[FilterKeyRegex] :param un_match_up_load_switch: 是否上传解析失败的日志 :type un_match_up_load_switch: bool :param un_match_log_key: 当上传解析失败的日志时,解析失败的日志的key名称 :type un_match_log_key: str :param log_template: 根据指定的日志模板自动提取日志字段 :type log_template: LogTemplate :param quote: 引用符 :type quote: str :param time_extract_regex: 时间字段的解析正则表达式 :type time_extract_regex: str :param enable_nanosecond: 是否开启解析纳秒级时间 :type enable_nanosecond: bool :param time_sample: 时间字段的样本日志 :type time_sample: str """ assert (time_key is None and time_format is None) or ( time_key is not None and time_format is not None) assert (un_match_up_load_switch is None and un_match_log_key is None) or \ (un_match_up_load_switch is not None and un_match_log_key is not None) self.delimiter = delimiter self.begin_regex = begin_regex self.log_regex = log_regex self.keys = keys self.time_key = time_key self.time_format = time_format self.time_zone = time_zone self.filter_key_regex = filter_key_regex self.un_match_up_load_switch = un_match_up_load_switch self.un_match_log_key = un_match_log_key self.log_template = log_template self.quote = quote self.time_extract_regex = time_extract_regex self.enable_nanosecond = enable_nanosecond self.time_sample = time_sample @classmethod def set_attributes(cls, data: dict): extract_rule = super(ExtractRule, cls).set_attributes(data) if FILTER_KEY_REGEX in data: extract_rule.filter_key_regex = [] for one_filter_key_regex in data[FILTER_KEY_REGEX]: extract_rule.filter_key_regex.append( # pylint: disable=no-member FilterKeyRegex.set_attributes(data=one_filter_key_regex)) if LOG_TEMPLATE in data: extract_rule.log_template = LogTemplate(log_type=data[LOG_TEMPLATE].get(TYPE), log_format=data[LOG_TEMPLATE].get(FORMAT)) # pylint: disable=no-member return extract_rule def json(self): json_data = super(ExtractRule, self).json() if self.filter_key_regex is not None: json_data[FILTER_KEY_REGEX] = [] for regex in self.filter_key_regex: json_data[FILTER_KEY_REGEX].append(regex.json()) if self.log_template is not None: json_data[LOG_TEMPLATE] = self.log_template.json() return json_data class ExcludePath(TLSData): def __init__(self, path_type: str, value: str): """ :param path_type:采集路径类型,File或Path :type path_type:str :param value:采集绝对路径 :type value:str """ assert path_type == "File" or path_type == "Path" self.path_type = path_type self.value = value def get_path_type(self): """ :return: 采集路径类型,File或Path :rtype: str """ return self.path_type def get_value(self): """ :return: 采集绝对路径 :rtype: str """ return self.value @classmethod def set_attributes(cls, data: dict): path_type = data.get(TYPE) value = data.get(VALUE) return cls(path_type, value) def json(self): return {TYPE: self.path_type, VALUE: self.value} class ParsePathRule(TLSData): def __init__(self, path_sample: str, regex: str, keys: List[str]): """ :param path_sample:实际场景的采集路径样例 :type path_sample:str :param regex: 用于提取路径字段的正则表达式 :type regex:str :param keys:字段名称列表 :type keys: List[str] """ self.path_sample = path_sample self.regex = regex self.keys = keys def get_path_sample(self): """ :return: 实际场景的采集路径样例 :rtype: str """ return self.path_sample def get_regex(self): """ :return: 用于提取路径字段的正则表达式 :rtype: str """ return self.regex def get_keys(self): """ :return: 字段名称列表 :rtype: List[str] """ return self.keys @classmethod def set_attributes(cls, data: dict): path_sample = data.get(PATH_SAMPLE) regex = data.get(REGEX) keys = data.get(KEYS) return cls(path_sample, regex, keys) class ShardHashKey(TLSData): def __init__(self, hash_key: str): """ :param hash_key:日志组的 HashKey :type hash_key: str """ self.hash_key = hash_key def get_hash_key(self): """ :return:日志组的 HashKey :rtype: str """ return self.hash_key class Plugin(TLSData): def __init__(self, processors: List[Dict]): """ :param processors: LogCollector插件 :type processors: List[Dict] """ self.processors = processors def get_processors(self): """ :return: LogCollector插件 :rtype: List[Dict] """ return self.processors def json(self): return {PROCESSORS: self.processors} class Advanced(TLSData): def __init__(self, close_inactive: int = 60, close_timeout: int = 0, no_line_terminator_eof_max_time: int = 5, close_removed: bool = False, close_renamed: bool = False, close_eof: bool = False): """ :param close_inactive: 释放日志文件句柄的等待时间 :type close_inactive: int :param close_timeout: LogCollector监控日志文件的最大时长 :type close_timeout: int :param no_line_terminator_eof_max_time: 日志文件无行终止符时,最大等待时间 :type no_line_terminator_eof_max_time: int :param close_removed: 日志文件被移除之后,是否释放该日志文件的句柄 :type close_removed: bool :param close_renamed: 日志文件被重命名之后,是否释放该日志文件的句柄 :type close_renamed: bool :param close_eof: 读取至日志文件的末尾之后,是否释放该日志文件的句柄 :type close_eof: bool """ self.no_line_terminator_eof_max_time = no_line_terminator_eof_max_time self.close_inactive = close_inactive self.close_timeout = close_timeout self.close_removed = close_removed self.close_renamed = close_renamed self.close_eof = close_eof def get_close_inactive(self): """ :return: 释放日志文件句柄的等待时间 :rtype: int """ return self.close_inactive def get_close_timeout(self): """ :return: LogCollector监控日志文件的最大时长 :rtype: int """ return self.close_timeout def get_no_line_terminator_eof_max_time(self): """ :return: 日志文件无行终止符时,最大等待时间 :rtype: int """ return self.no_line_terminator_eof_max_time def get_close_removed(self): """ :return: 日志文件被移除之后,是否释放该日志文件的句柄 :rtype: bool """ return self.close_removed def get_close_renamed(self): """ :return: 日志文件被重命名之后,是否释放该日志文件的句柄 :rtype: bool """ return self.close_renamed def get_close_eof(self): """ :return: 读取至日志文件的末尾之后,是否释放该日志文件的句柄 :rtype: bool """ return self.close_eof def json(self): return {CLOSE_INACTIVE: self.close_inactive, CLOSE_TIMEOUT: self.close_timeout, CLOSE_REMOVED: self.close_removed, CLOSE_RENAMED: self.close_renamed, CLOSE_EOF: self.close_eof, NO_LINE_TERMINATOR_EOF_MAX_TIME: self.no_line_terminator_eof_max_time} class UserDefineRule(TLSData): def __init__(self, parse_path_rule: ParsePathRule = None, shard_hash_key: ShardHashKey = None, enable_raw_log: bool = False, fields: dict = None, plugin: Plugin = None, advanced: Advanced = None, tail_files: bool = False, raw_log_key: str = None, enable_hostname: bool = False, hostname_key: str = None, host_group_label_key: str = None, enable_host_group_label: bool = False, tail_size_kb: int = None, ignore_older: int = None, multi_collects_type: str = None): """ :param parse_path_rule: 解析采集路径的规则 :type parse_path_rule: ParsePathRule :param shard_hash_key: 路由日志分区的规则 :type shard_hash_key: ShardHashKey :param enable_raw_log: 是否上传原始日志 :type enable_raw_log: bool :param fields: 为日志添加常量字段 :type fields: dict :param plugin: LogCollector插件配置 :type plugin: Plugin :param advanced: LogCollector扩展配置 :type advanced: Advanced :param tail_files: LogCollector采集策略,即指定LogCollector采集增量日志还是全量日志 :type tail_files: bool :param raw_log_key: 原始日志的键名 :type raw_log_key: str :param enable_hostname: 是否添加主机名字段 :type enable_hostname: bool :param hostname_key: 主机名字段的键名 :type hostname_key: str :param host_group_label_key: 主机分组标签字段的键名 :type host_group_label_key: str :param enable_host_group_label: 是否添加主机分组标签字段 :type enable_host_group_label: bool :param tail_size_kb: 增量采集的回溯阈值。 :type tail_size_kb: int :param ignore_older: 忽略多久没有更新的日志文件, 单位为小时。 :type ignore_older: int :param multi_collects_type: 允许多次采集日志文件。空、RuleID、TopicIDRuleName :type multi_collects_type: str """ self.parse_path_rule = parse_path_rule self.shard_hash_key = shard_hash_key self.enable_raw_log = enable_raw_log self.fields = fields self.plugin = plugin self.advanced = advanced self.tail_files = tail_files self.raw_log_key = raw_log_key self.enable_hostname = enable_hostname self.hostname_key = hostname_key self.host_group_label_key = host_group_label_key self.enable_host_group_label = enable_host_group_label self.tail_size_kb = tail_size_kb self.ignore_older = ignore_older self.multi_collects_type = multi_collects_type def get_enable_raw_log(self): """ :return:是否上传原始日志 :rtype:bool """ return self.enable_raw_log def get_shard_hash_key(self): """ :return:路由日志分区的规则 :rtype: ShardHashKey """ return self.shard_hash_key def get_fields(self): """ :return: 为日志添加常量字段 :rtype: dict """ return self.fields def get_parse_path_rule(self): """ :return: 解析采集路径的规则 :rtype: ParsePathRule """ return self.parse_path_rule def get_plugin(self): """ :return: LogCollector插件配置 :rtype: Plugin """ return self.plugin def get_advanced(self): """ :return: LogCollector扩展配置 :rtype: Advanced """ return self.advanced def get_tail_files(self): """ :return: LogCollector采集策略,即指定LogCollector采集增量日志还是全量日志 :rtype: bool """ return self.tail_files def get_raw_log_key(self): """ :return: 原始日志的键名 :rtype: str """ return self.raw_log_key def get_enable_hostname(self): """ :return: 是否添加主机名字段 :rtype: bool """ return self.enable_hostname def get_hostname_key(self): """ :return: 主机名字段的键名 :rtype: str """ return self.hostname_key def get_host_group_label_key(self): """ :return: 主机分组标签字段的键名 :rtype: str """ return self.host_group_label_key def get_enable_host_group_label(self): """ :return: 是否添加主机分组标签字段 :rtype: bool """ return self.enable_host_group_label def get_tail_size_kb(self): """ :return: 增量采集的回溯阈值。 :rtype: int """ return self.tail_size_kb def get_ignore_older(self): """ :return: 忽略多久没有更新的日志文件, 单位为小时。 :rtype: int """ return self.ignore_older def get_multi_collects_type(self): """ :return: 允许多次采集日志文件。空、RuleID、TopicIDRuleName :rtype: str """ return self.multi_collects_type @classmethod def set_attributes(cls, data: dict): user_define_rule = super(UserDefineRule, cls).set_attributes(data) if SHARD_HASH_KEY in data: user_define_rule.shard_hash_key = ShardHashKey( hash_key=data[SHARD_HASH_KEY].get(HASH_KEY)) if PARSE_PATH_RULE in data: user_define_rule.parse_path_rule = ParsePathRule.set_attributes( data[PARSE_PATH_RULE]) if PLUGIN in data: user_define_rule.plugin = Plugin( processors=data[PLUGIN].get(PROCESSORS)) if ADVANCED in data: user_define_rule.advanced = Advanced(close_inactive=data[ADVANCED].get(CLOSE_INACTIVE), close_timeout=data[ADVANCED].get( CLOSE_TIMEOUT), close_removed=data[ADVANCED].get( CLOSE_REMOVED), close_renamed=data[ADVANCED].get( CLOSE_RENAMED), no_line_terminator_eof_max_time=data[ADVANCED].get(NO_LINE_TERMINATOR_EOF_MAX_TIME), close_eof=data[ADVANCED].get(CLOSE_EOF)) return user_define_rule def json(self): json_data = super(UserDefineRule, self).json() if self.shard_hash_key is not None: json_data[SHARD_HASH_KEY] = self.shard_hash_key.json() if self.parse_path_rule is not None: json_data[PARSE_PATH_RULE] = self.parse_path_rule.json() if self.plugin is not None: json_data[PLUGIN] = self.plugin.json() if self.advanced is not None: json_data[ADVANCED] = self.advanced.json() return json_data class KubernetesRule(TLSData): def __init__(self, namespace_name_regex: str = None, workload_type: str = None, workload_name_regex: str = None, include_pod_label_regex: Dict[str, str] = None, exclude_pod_label_regex: Dict[str, str] = None, pod_name_regex: str = None, label_tag: Dict[str, str] = None, annotation_tag: Dict[str, str] = None, enable_all_label_tag: bool = False, exclude_pod_annotation_regex: Dict[str, str] = None, include_pod_annotation_regex: Dict[str, str] = None,): """ :param namespace_name_regex: 待采集的Kubernetes Namespace名称,不指定Namespace名称时表示采集全部容器 :type namespace_name_regex: str :param workload_type: 通过工作负载的类型指定采集的容器,仅支持选择一种类型 :type workload_type: str :param workload_name_regex: 通过工作负载的名称指定待采集的容器 :type workload_name_regex: str :param include_pod_label_regex: Pod Label白名单用于指定待采集的容器 :type include_pod_label_regex: Dict[str, str] :param exclude_pod_label_regex: 通过Pod Label黑名单指定不采集的容器,不启用表示采集全部容器 :type exclude_pod_label_regex: Dict[str, str] :param pod_name_regex: Pod名称用于指定待采集的容器 :type pod_name_regex: str :param label_tag: 是否将Kubernetes Label作为日志标签,添加到原始日志数据中 :type label_tag: Dict[str, str] :param annotation_tag: 是否将Kubernetes Annotation作为日志标签,添加到原始日志数据中 :type annotation_tag: Dict[str, str] :param enable_all_label_tag: 是否将所有 Kubernetes Label 作为日志标签,添加到原始日志数据中 :type enable_all_label_tag: bool :param exclude_pod_annotation_regex: 通过 Pod Annotation 黑名单指定不采集的容器,不启用表示采集全部容器 :type exclude_pod_annotation_regex: Dict[str, str] :param include_pod_annotation_regex: Pod Annotation 白名单用于指定待采集的容器 :type include_pod_annotation_regex: Dict[str, str] """ self.namespace_name_regex = namespace_name_regex self.workload_type = workload_type self.workload_name_regex = workload_name_regex self.include_pod_label_regex = include_pod_label_regex self.exclude_pod_label_regex = exclude_pod_label_regex self.pod_name_regex = pod_name_regex self.label_tag = label_tag self.annotation_tag = annotation_tag self.enable_all_label_tag = enable_all_label_tag self.exclude_pod_annotation_regex = exclude_pod_annotation_regex self.include_pod_annotation_regex = include_pod_annotation_regex def get_include_pod_label_regex(self): """ :return: Pod Label 白名单用于指定待采集的容器 :rtype:Dict[str, str] """ return self.include_pod_label_regex def get_workload_name_regex(self): """ :return: 通过工作负载的名称指定待采集的容器 :rtype:str """ return self.workload_name_regex def get_pod_name_regex(self): """ :return: Pod名称用于指定待采集的容器 :rtype: str """ return self.pod_name_regex def get_exclude_pod_label_regex(self): """ :return: 通过 Pod Label 黑名单指定不采集的容器,不启用表示采集全部容器 :rtype: ict[str, str] """ return self.exclude_pod_label_regex def get_label_tag(self): """ :return: 是否将 Kubernetes Label 作为日志标签,添加到原始日志数据中 :rtype: Dict[str, str] """ return self.label_tag def get_namespace_name_regex(self): """ :return: 待采集的 Kubernetes Namespace 名称,不指定 Namespace 名称时表示采集全部容器 :rtype: str """ return self.namespace_name_regex def get_workload_type(self): """ :return:通过工作负载的类型指定采集的容器,仅支持选择一种类型 :rtype: str """ return self.workload_type def get_annotation_tag(self): """ :return: 是否将Kubernetes Annotation作为日志标签,添加到原始日志数据中 :rtype: Dict[str, str] """ return self.annotation_tag def get_enable_all_label_tag(self): """ :return: 是否将所有 Kubernetes Label 作为日志标签,添加到原始日志数据中 :rtype: bool """ return self.enable_all_label_tag def get_exclude_pod_annotation_regex(self): """ :return: 通过 Pod Annotation 黑名单指定不采集的容器,不启用表示采集全部容器 :rtype: Dict[str, str] """ return self.exclude_pod_annotation_regex def get_include_pod_annotation_regex(self): """ :return: Pod Annotation 白名单用于指定待采集的容器 :rtype: Dict[str, str] """ return self.include_pod_annotation_regex class ContainerRule(TLSData): def __init__(self, stream: str = None, container_name_regex: str = None, include_container_label_regex: Dict[str, str] = None, exclude_container_label_regex: Dict[str, str] = None, include_container_env_regex: Dict[str, str] = None, exclude_container_env_regex: Dict[str, str] = None, env_tag: Dict[str, str] = None, kubernetes_rule: KubernetesRule = None): """ :param stream:采集模式 :type stream:str :param container_name_regex:待采集的容器名称 :type container_name_regex:str :param include_container_label_regex:指定待采集的容器,不启用白名单时指定采集全部容器 :type include_container_label_regex:Dict[str, str] :param exclude_container_label_regex:黑名单用于指定不采集的容器范围,不启用黑名单时表示采集全部容器 :type exclude_container_label_regex:Dict[str, str] :param include_container_env_regex:容器环境变量白名单通过容器环境变量指定待采集的容器,不启用白名单时表示指定采集全部容器 :type include_container_env_regex:Dict[str, str] :param exclude_container_env_regex:容器环境变量黑名单用于指定不采集的容器范围,不启用黑名单时表示采集全部容器 :type exclude_container_env_regex:Dict[str, str] :param env_tag:是否将环境变量作为日志标签,添加到原始日志数据中 :type env_tag:Dict[str, str] :param kubernetes_rule:Kubernetes 容器的采集规则 :type kubernetes_rule:KubernetesRule """ self.stream = stream self.container_name_regex = container_name_regex self.include_container_label_regex = include_container_label_regex self.exclude_container_label_regex = exclude_container_label_regex self.include_container_env_regex = include_container_env_regex self.exclude_container_env_regex = exclude_container_env_regex self.env_tag = env_tag self.kubernetes_rule = kubernetes_rule def get_stream(self): """ :return 采集模式 :rtype str """ return self.stream def get_exclude_container_env_regex(self): """ :return: 容器环境变量黑名单用于指定不采集的容器范围,不启用黑名单时表示采集全部容器 :rtype:Dict[str, str] """ return self.exclude_container_env_regex def get_kubernetes_rule(self): """ :return: Kubernetes 容器的采集规则 :rtype: KubernetesRule """ return self.kubernetes_rule def get_include_container_label_regex(self): """ :return: 指定待采集的容器,不启用白名单时指定采集全部容器 :rtype: Dict[str, str] """ return self.include_container_label_regex def get_include_container_env_regex(self): """ :return: 容器环境变量白名单通过容器环境变量指定待采集的容器,不启用白名单时表示指定采集全部容器 :rtype: Dict[str, str] """ return self.include_container_env_regex def get_exclude_container_label_regex(self): """ :return: 黑名单用于指定不采集的容器范围,不启用黑名单时表示采集全部容器 :rtype: Dict[str, str] """ return self.exclude_container_label_regex def get_env_tag(self): """ :return: 是否将环境变量作为日志标签,添加到原始日志数据中 :rtype: Dict[str, str] """ return self.env_tag def get_container_name_regex(self): """ :return:待采集的容器名称 :rtype: str """ return self.container_name_regex @classmethod def set_attributes(cls, data: dict): container_rule = super(ContainerRule, cls).set_attributes(data) if KUBERNETES_RULE in data: container_rule.kubernetes_rule = KubernetesRule.set_attributes( data=data[KUBERNETES_RULE]) return container_rule def json(self): json_data = super(ContainerRule, self).json() if self.kubernetes_rule is not None: json_data[KUBERNETES_RULE] = self.kubernetes_rule.json() return json_data class RuleInfo(TLSData): def __init__(self, topic_id: str = None, topic_name: str = None, rule_id: str = None, rule_name: str = None, paths: List[str] = None, log_type: str = None, extract_rule: ExtractRule = None, exclude_paths: List[ExcludePath] = None, log_sample: str = None, user_define_rule: UserDefineRule = None, create_time: str = None, modify_time: str = None, input_type: int = None, container_rule: ContainerRule = None, pause: int = None): self.topic_id = topic_id self.topic_name = topic_name self.rule_id = rule_id self.rule_name = rule_name self.paths = paths self.log_type = log_type self.extract_rule = extract_rule self.exclude_paths = exclude_paths self.log_sample = log_sample self.user_define_rule = user_define_rule self.create_time = create_time self.modify_time = modify_time self.input_type = input_type self.container_rule = container_rule self.pause = pause def get_exclude_paths(self): """ :return:采集黑名单列表 :rtype:List[ExcludePath] """ return self.exclude_paths def get_create_time(self): """ :return:采集配置创建的时间 :rtype:str """ return self.create_time def get_rule_name(self): """ :return:采集配置的名称 :rtype:str """ return self.rule_name def get_container_rule(self): """ :return:容器采集规则。详细说明请查看 :rtype:ContainerRule """ return self.container_rule def get_modify_time(self): return self.modify_time def get_input_type(self): return self.input_type def get_user_define_rule(self): return self.user_define_rule def get_rule_id(self): return self.rule_id def get_log_type(self): return self.log_type def get_extract_rule(self): return self.extract_rule def get_paths(self): return self.paths def get_topic_name(self): return self.topic_name def get_topic_id(self): return self.topic_id def get_pause(self): """ :return: 采集配置的运行状态。0:运行中,1:已暂停 :rtype: int """ return self.pause def get_log_sample(self): return self.log_sample @classmethod def set_attributes(cls, data: dict): rule_info = super(RuleInfo, cls).set_attributes(data) if EXTRACT_RULE in data: rule_info.extract_rule = ExtractRule.set_attributes( data=data[EXTRACT_RULE]) if EXCLUDE_PATHS in data: rule_info.exclude_paths = [] for exclude_path in data[EXCLUDE_PATHS]: rule_info.exclude_paths.append( # pylint: disable=no-member ExcludePath.set_attributes(data=exclude_path)) if USER_DEFINE_RULE in data: rule_info.user_define_rule = UserDefineRule.set_attributes( data=data[USER_DEFINE_RULE]) if CONTAINER_RULE in data: rule_info.container_rule = ContainerRule.set_attributes( data=data[CONTAINER_RULE]) return rule_info class HostGroupHostsRulesInfo(TLSData): def __init__(self, host_group_info: HostGroupInfo, host_infos: List[HostInfo], rule_infos: List[RuleInfo]): self.host_group_info = host_group_info self.host_infos = host_infos self.rule_infos = rule_infos def get_rule_infos(self): """ :return:所绑定的采集配置信息列表 :rtype: List[RuleInfo] """ return self.rule_infos def get_host_group_info(self): """ :return: 机器组信息 :rtype:HostGroupInfo """ return self.host_group_info def get_host_infos(self): """ :return: :rtype:List[HostInfo] """ return self.host_infos class Receiver(TLSData): def __init__(self, receiver_type: str, receiver_names: List[str], receiver_channels: List[str], start_time: str, end_time: str, webhook: str = None, general_webhook_url: str = None, general_webhook_body: str = None, alarm_webhook_at_users: List[str] = None, alarm_webhook_is_at_all: bool = None, alarm_webhook_at_groups: List[str] = None, general_webhook_method: str = None, general_webhook_headers: List['GeneralWebhookHeaderKV'] = None, alarm_content_template_id: str = None, alarm_webhook_integration_id: str = None, alarm_webhook_integration_name: str = None): """ :param receiver_type:接受者类型 :type receiver_type:str :param receiver_names:接收者的名字 :type receiver_names:List[str] :param receiver_channels:通知接收渠道,支持Email、Sms、Phone :type receiver_channels:List[str] :param start_time:可接收信息的时段中,开始的时间 :type start_time:str :param end_time:可接收信息的时段中 :type end_time:str :param webhook:飞书Webhook请求地址 :type webhook:str :param general_webhook_url:自定义接口回调地址 :type general_webhook_url:str :param general_webhook_body:自定义 WebHook 请求体 :type general_webhook_body:str :param alarm_webhook_at_users:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,需要提醒的用户名 :type alarm_webhook_at_users:List[str] :param alarm_webhook_is_at_all:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,是否提醒所有人 :type alarm_webhook_is_at_all:bool :param alarm_webhook_at_groups:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,需要提醒的用户组名称 :type alarm_webhook_at_groups:List[str] :param general_webhook_method:自定义接口回调方法,仅支持设置为 POST 或 PUT :type general_webhook_method:str :param general_webhook_headers:自定义接口回调请求头 :type general_webhook_headers:List[GeneralWebhookHeaderKV] :param alarm_content_template_id:告警内容模版 ID :type alarm_content_template_id:str :param alarm_webhook_integration_id:告警 Webhook 集成配置的 ID :type alarm_webhook_integration_id:str :param alarm_webhook_integration_name:告警 Webhook 集成配置的名称 :type alarm_webhook_integration_name:str :type alarm_webhook_integration_name:str """ self.receiver_type = receiver_type self.receiver_names = receiver_names self.receiver_channels = receiver_channels self.start_time = start_time self.end_time = end_time self.webhook = webhook self.general_webhook_url = general_webhook_url self.general_webhook_body = general_webhook_body self.alarm_webhook_at_users = alarm_webhook_at_users self.alarm_webhook_is_at_all = alarm_webhook_is_at_all self.alarm_webhook_at_groups = alarm_webhook_at_groups self.general_webhook_method = general_webhook_method self.general_webhook_headers = general_webhook_headers self.alarm_content_template_id = alarm_content_template_id self.alarm_webhook_integration_id = alarm_webhook_integration_id self.alarm_webhook_integration_name = alarm_webhook_integration_name def get_start_time(self): """ :return:可接收信息的时段中,开始的时间 :rtype: str """ return self.start_time def get_webhook(self): """ :return: 飞书Webhook请求地址 :rtype: str """ return self.webhook def get_receiver_channels(self): """ :return:通知接收渠道,支持Email、Sms、Phone :rtype: List[str] """ return self.receiver_channels def get_end_time(self): """ :return: 可接收信息的时段中 :rtype:str """ return self.end_time def get_receiver_names(self): """ :return: 接收者的名字 :rtype: List[str] """ return self.receiver_names def get_receiver_type(self): """ :return:接受者类型 :rtype: str """ return self.receiver_type def get_general_webhook_url(self): """ :return:自定义接口回调地址 :rtype: str """ return self.general_webhook_url def get_general_webhook_body(self): """ :return:自定义 WebHook 请求体 :rtype: str """ return self.general_webhook_body def get_alarm_webhook_at_users(self): """ :return:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,需要提醒的用户名 :rtype: List[str] """ return self.alarm_webhook_at_users def get_alarm_webhook_is_at_all(self): """ :return:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,是否提醒所有人 :rtype: bool """ return self.alarm_webhook_is_at_all def get_alarm_webhook_at_groups(self): """ :return:通过 Webhook 集成配置发送通知到飞书、钉钉或企业微信时,需要提醒的用户组名称 :rtype: List[str] """ return self.alarm_webhook_at_groups def get_general_webhook_method(self): """ :return:自定义接口回调方法,仅支持设置为 POST 或 PUT :rtype: str """ return self.general_webhook_method def get_general_webhook_headers(self): """ :return:自定义接口回调请求头 :rtype: List[GeneralWebhookHeaderKV] """ return self.general_webhook_headers def get_alarm_content_template_id(self): """ :return:告警内容模版 ID :rtype: str """ return self.alarm_content_template_id def get_alarm_webhook_integration_id(self): """ :return:告警 Webhook 集成配置的 ID :rtype: str """ return self.alarm_webhook_integration_id def get_alarm_webhook_integration_name(self): """ :return:告警 Webhook 集成配置的名称 :rtype: str """ return self.alarm_webhook_integration_name @classmethod def set_attributes(cls, data: dict): receiver_type = data.get(RECEIVER_TYPE) receiver_names = data.get(RECEIVER_NAMES) receiver_channels = data.get(RECEIVER_CHANNELS) start_time = data.get(START_TIME) end_time = data.get(END_TIME) webhook = data.get(WEBHOOK) general_webhook_url = data.get(GENERAL_WEBHOOK_URL) general_webhook_body = data.get(GENERAL_WEBHOOK_BODY) alarm_webhook_at_users = data.get(ALARM_WEBHOOK_AT_USERS) alarm_webhook_is_at_all = data.get(ALARM_WEBHOOK_IS_AT_ALL) alarm_webhook_at_groups = data.get(ALARM_WEBHOOK_AT_GROUPS) general_webhook_method = data.get(GENERAL_WEBHOOK_METHOD) alarm_content_template_id = data.get(ALARM_CONTENT_TEMPLATE_ID) alarm_webhook_integration_id = data.get(ALARM_WEBHOOK_INTEGRATION_ID) alarm_webhook_integration_name = data.get(ALARM_WEBHOOK_INTEGRATION_NAME) general_webhook_headers = None if GENERAL_WEBHOOK_HEADERS in data and data[GENERAL_WEBHOOK_HEADERS] is not None: general_webhook_headers = [] for header in data[GENERAL_WEBHOOK_HEADERS]: general_webhook_headers.append( # pylint: disable=no-member GeneralWebhookHeaderKV.set_attributes(data=header)) receiver = cls(receiver_type, receiver_names, receiver_channels, start_time, end_time, webhook, general_webhook_url, general_webhook_body, alarm_webhook_at_users, alarm_webhook_is_at_all, alarm_webhook_at_groups, general_webhook_method, general_webhook_headers, alarm_content_template_id, alarm_webhook_integration_id, alarm_webhook_integration_name) return receiver def json(self): json_data = super(Receiver, self).json() if self.general_webhook_url is not None: json_data[GENERAL_WEBHOOK_URL] = self.general_webhook_url if self.general_webhook_body is not None: json_data[GENERAL_WEBHOOK_BODY] = self.general_webhook_body if self.alarm_webhook_at_users is not None: json_data[ALARM_WEBHOOK_AT_USERS] = self.alarm_webhook_at_users if self.alarm_webhook_is_at_all is not None: json_data[ALARM_WEBHOOK_IS_AT_ALL] = self.alarm_webhook_is_at_all if self.alarm_webhook_at_groups is not None: json_data[ALARM_WEBHOOK_AT_GROUPS] = self.alarm_webhook_at_groups if self.general_webhook_method is not None: json_data[GENERAL_WEBHOOK_METHOD] = self.general_webhook_method if self.general_webhook_headers is not None: json_data[GENERAL_WEBHOOK_HEADERS] = [] for header in self.general_webhook_headers: json_data[GENERAL_WEBHOOK_HEADERS].append(header.json()) if self.alarm_content_template_id is not None: json_data[ALARM_CONTENT_TEMPLATE_ID] = self.alarm_content_template_id if self.alarm_webhook_integration_id is not None: json_data[ALARM_WEBHOOK_INTEGRATION_ID] = self.alarm_webhook_integration_id if self.alarm_webhook_integration_name is not None: json_data[ALARM_WEBHOOK_INTEGRATION_NAME] = self.alarm_webhook_integration_name return json_data class QueryRequest(TLSData): def __init__(self, topic_id: str, query: str, number: int, start_time_offset: int, end_time_offset: int, topic_name: str = None, time_span_type: str = None, truncated_time: str = None, end_time_offset_unit: str = None, start_time_offset_unit: str = None): """ :param topic_id: 日志主题ID :type topic_id: str :param query: 查询语句,支持的最大长度为1024 :type query: str :param number: 告警对象序号(从1开始递增) :type number: int :param start_time_offset: 查询范围起始时间相对当前的历史时间,单位为分钟,取值为非正,最大值为0,最小值为-1440 :type start_time_offset: int :param end_time_offset: 查询范围终止时间相对当前的历史时间,单位为分钟,取值为非正,须大于StartTimeOffset,最大值为0,最小值为-1440 :type end_time_offset: int :param topic_name: 告警策略执行的日志主题名称 :type topic_name: str :param time_span_type: 查询是否是整点时间, 新增整点时间,非必填,空白时默认为Relative :type time_span_type: str :param truncated_time: 对时间取整,对分钟/小时取整 :type truncated_time: str :param end_time_offset_unit: 查询结束时间范围单位, 默认值为分钟,支持秒/分钟/小时(Second,Minute,Hour) :type end_time_offset_unit: str :param start_time_offset_unit: 查询开始时间范围单位, 默认值为分钟,支持秒/分钟/小时(Second,Minute,Hour) :type start_time_offset_unit: str """ self.topic_id = topic_id self.query = query self.number = number self.start_time_offset = start_time_offset self.end_time_offset = end_time_offset self.topic_name = topic_name self.time_span_type = time_span_type self.truncated_time = truncated_time self.end_time_offset_unit = end_time_offset_unit self.start_time_offset_unit = start_time_offset_unit def get_number(self): """ :return:告警对象序号;从 1 开始递增 :rtype: int """ return self.number def get_start_time_offset(self): """ :return: 查询范围起始时间相对当前的历史时间,单位为分钟,取值为非正,最大值为 0,最小值为 -1440 :rtype: int """ return self.start_time_offset def get_query(self): """ :return:查询语句,支持的最大长度为 1024 :rtype: str """ return self.query def get_topic_name(self): """ :return: 告警策略执行的日志主题名称 :rtype: str """ return self.topic_name def get_topic_id(self): """ :return: 日志主题 ID :rtype: str """ return self.topic_id def get_end_time_offset(self): """ :return: 查询范围终止时间相对当前的历史时间,单位为分钟 :rtype: int """ return self.end_time_offset def get_time_span_type(self): """ :return: 查询是否是整点时间, 新增整点时间,非必填,空白时默认为Relative :rtype: str """ return self.time_span_type def get_truncated_time(self): """ :return: 对时间取整,对分钟/小时取整 :rtype: str """ return self.truncated_time @classmethod def set_attributes(cls, data: dict): topic_id = data.get(TOPIC_ID) topic_name = data.get(TOPIC_NAME) query = data.get(QUERY) number = data.get(NUMBER) start_time_offset = data.get(START_TIME_OFFSET) end_time_offset = data.get(END_TIME_OFFSET) time_span_type = data.get(TIME_SPAN_TYPE) truncated_time = data.get(TRUNCATED_TIME) return cls(topic_id, query, number, start_time_offset, end_time_offset, topic_name, time_span_type, truncated_time) class RequestCycle(TLSData): def __init__(self, cycle_type: str, time: int, cron_tab: str = None, cron_time_zone: str = None): """ :param cycle_type: 执行周期类型,Period:周期执行,Fixed:定期执行,Cron:使用Cron表达式 :type cycle_type:str :param time:告警任务执行的周期,或者定期执行的时间点。单位为分钟,取值范围为 1~1440 :type time:int :param cron_tab:Cron表达式,日志服务通过 Cron 表达式指定告警任务定时执行。Cron 表达式的最小粒度为分钟,24 小时制 :type cron_tab:str :param cron_time_zone:设置 Type 为 Cron 时,还需设置时区 :type cron_time_zone:str """ self.cycle_type = cycle_type self.time = time self.cron_tab = cron_tab self.cron_time_zone = cron_time_zone def get_time(self): """ :return:告警任务执行的周期,或者定期执行的时间点。单位为分钟 :rtype: int """ return self.time def get_cycle_type(self): """ :return:执行周期类型,Period:周期执行,Fixed:定期执行 :rtype: str """ return self.cycle_type def get_cron_tab(self): """ :return:Cron表达式,日志服务通过 Cron 表达式指定告警任务定时执行 :rtype: str """ return self.cron_tab def get_cron_time_zone(self): """返回设置 Type 为 Cron 时的时区 :return: 时区信息 :rtype: str """ return self.cron_time_zone @classmethod def set_attributes(cls, data: dict): cycle_type = data.get(TYPE) time = data.get(TIME) cron_tab = data.get(CRON_TAB) cron_time_zone = data.get(CRON_TIME_ZONE) return cls(cycle_type, time, cron_tab, cron_time_zone) def json(self): result = {TYPE: self.cycle_type, TIME: self.time} if self.cron_tab is not None: result[CRON_TAB] = self.cron_tab if self.cron_time_zone is not None: result[CRON_TIME_ZONE] = self.cron_time_zone return result class AlarmNotifyGroupInfo(TLSData): def __init__(self, alarm_notify_group_name: str = None, alarm_notify_group_id: str = None, notify_type: List[str] = None, receivers: List[Receiver] = None, create_time: str = None, modify_time: str = None, iam_project_name: str = None, notice_rules: List["NoticeRule"] = None): self.alarm_notify_group_name = alarm_notify_group_name self.alarm_notify_group_id = alarm_notify_group_id self.notify_type = notify_type self.receivers = receivers self.create_time = create_time self.modify_time = modify_time self.iam_project_name = iam_project_name self.notice_rules = notice_rules def get_alarm_notify_group_name(self): """ :return:告警通知组名称 :rtype: str """ return self.alarm_notify_group_name def get_notify_type(self): """ :return:告警通知的类型:Trigger - 告警触发,Recovery - 告警恢复 :rtype: List[str] """ return self.notify_type def get_create_time(self): """ :return:告警通知组创建的时间 :rtype:str """ return self.create_time def get_receivers(self): """ :return:接收告警的 IAM 用户列表 :rtype:List[Receiver] """ return self.receivers def get_modify_time(self): """ :return:告警通知组修改的时间 :rtype:str """ return self.modify_time def get_alarm_notify_group_id(self): """ :return:告警通知组 ID :rtype:str """ return self.alarm_notify_group_id def get_iam_project_name(self): """ :return: 告警组所属的IAM项目 :rtype: str """ return self.iam_project_name def get_notice_rules(self): """ :return: 通知组规则 :rtype: List[NoticeRule] """ return self.notice_rules @classmethod def set_attributes(cls, data: dict): alarm_notify_group_info = super( AlarmNotifyGroupInfo, cls).set_attributes(data) if RECEIVERS in data: alarm_notify_group_info.receivers = [] for receiver in data[RECEIVERS]: alarm_notify_group_info.receivers.append( # pylint: disable=no-member Receiver.set_attributes(data=receiver)) if NOTICE_RULES in data and data[NOTICE_RULES] is not None: alarm_notify_group_info.notice_rules = [] for notice_rule in data[NOTICE_RULES]: alarm_notify_group_info.notice_rules.append( # pylint: disable=no-member NoticeRule.set_attributes(data=notice_rule)) return alarm_notify_group_info class AlarmPeriodSetting(TLSData): def __init__(self, sms: int, phone: int, email: int, general_webhook: int): self.sms = sms self.phone = phone self.email = email self.general_webhook = general_webhook def json(self): return {SMS: self.sms, PHONE: self.phone, EMAIL: self.email, GENERAL_WEBHOOK: self.general_webhook} class JoinConfig(TLSData): def __init__(self, set_operation_type: str = None, condition: str = None): self.condition = condition self.set_operation_type = set_operation_type class TriggerCondition(TLSData): def __init__(self, severity: str = "notice", condition: str = None, count_condition: str = None, no_data: bool = None): self.severity = severity self.condition = condition self.count_condition = count_condition self.no_data = no_data class AlarmInfo(TLSData): def __init__(self, alarm_name: str = None, alarm_id: str = None, project_id: str = None, status: bool = None, query_request: List[QueryRequest] = None, request_cycle: RequestCycle = None, condition: str = None, trigger_period: int = None, alarm_period: int = None, alarm_notify_group: List[AlarmNotifyGroupInfo] = None, user_define_msg: str = None, create_time: str = None, modify_time: str = None, severity: str = None, alarm_period_detail: AlarmPeriodSetting = None, join_configurations: List[JoinConfig] = None, trigger_conditions: List[TriggerCondition] = None, send_resolved: bool = None): self.alarm_name = alarm_name self.alarm_id = alarm_id self.project_id = project_id self.status = status self.query_request = query_request self.request_cycle = request_cycle self.condition = condition self.trigger_period = trigger_period self.alarm_period = alarm_period self.alarm_notify_group = alarm_notify_group self.user_define_msg = user_define_msg self.create_time = create_time self.modify_time = modify_time self.severity = severity self.alarm_period_detail = alarm_period_detail self.join_configurations = join_configurations self.trigger_conditions = trigger_conditions self.send_resolved = send_resolved def get_alarm_name(self): """ :return:告警策略名称 :rtype: str """ return self.alarm_name def get_alarm_notify_group(self): """ :return:告警对应的通知列表 :rtype:List[AlarmNotifyGroupInfo] """ return self.alarm_notify_group def get_request_cycle(self): """ :return:告警任务的执行周期 :rtype:RequestCycle """ return self.request_cycle def get_alarm_period(self): """ :return:告警重复的周期 :rtype: int """ return self.alarm_period def get_create_time(self): """ :return:创建告警策略的时间 :rtype:str """ return self.create_time def get_modify_time(self): """ :return:告警策略最近修改的时间 :rtype:str """ return self.modify_time def get_user_define_msg(self): """ :return:告警通知的内容 :rtype:str """ return self.user_define_msg def get_condition(self): """ :return:告警触发条件 :rtype:str """ return self.condition def get_query_request(self): """ :return:检索分析语句,可配置 1~3 条 :rtype:List[QueryRequest] """ return self.query_request def get_project_id(self): """ :return:日志项目 ID :rtype: str """ return self.project_id def get_trigger_period(self): """ :return:持续周期 :rtype:int """ return self.trigger_period def get_alarm_id(self): """ :return:告警策略的 ID :rtype: str """ return self.alarm_id def get_status(self): """ :return:是否开启告警策略 :rtype:bool """ return self.status def get_severity(self): """ :return: 告警通知的级别,即告警的严重程度 :rtype: str """ return self.severity def get_alarm_period_detail(self): """ :return: 告警通知发送的周期 :rtype: AlarmPeriodSetting """ return self.alarm_period_detail def get_join_configurations(self): """ :return: 告警策略的 Join 配置 :rtype: List[JoinConfig] """ return self.join_configurations def get_trigger_conditions(self): """ :return: 告警策略的触发条件 :rtype: List[TriggerCondition] """ return self.trigger_conditions def get_send_resolved(self): """ :return: 是否发送恢复通知 :rtype: bool """ return self.send_resolved @classmethod def set_attributes(cls, data: dict): alarm_info = super(AlarmInfo, cls).set_attributes(data) if REQUEST_CYCLE in data: alarm_info.request_cycle = RequestCycle.set_attributes( data=data[REQUEST_CYCLE]) if QUERY_REQUEST in data: alarm_info.query_request = [] for one_query_request in data[QUERY_REQUEST]: alarm_info.query_request.append( # pylint: disable=no-member QueryRequest.set_attributes(data=one_query_request)) if ALARM_NOTIFY_GROUP in data: alarm_info.alarm_notify_group = [] for alarm_notify_group in data[ALARM_NOTIFY_GROUP]: alarm_info.alarm_notify_group.append( # pylint: disable=no-member AlarmNotifyGroupInfo.set_attributes(data=alarm_notify_group)) if ALARM_PERIOD_DETAIL in data: if len(data[ALARM_PERIOD_DETAIL]) == 0: alarm_info.alarm_period_detail = None else: sms = data[ALARM_PERIOD_DETAIL].get(SMS) phone = data[ALARM_PERIOD_DETAIL].get(PHONE) email = data[ALARM_PERIOD_DETAIL].get(EMAIL) general_webhook = data[ALARM_PERIOD_DETAIL].get( GENERAL_WEBHOOK) alarm_info.alarm_period_detail = AlarmPeriodSetting( sms, phone, email, general_webhook) if JOIN_CONFIGURATIONS in data and data[JOIN_CONFIGURATIONS] is not None: alarm_info.join_configurations = [] for join_configuration in data[JOIN_CONFIGURATIONS]: alarm_info.join_configurations.append( # pylint: disable=no-member JoinConfig.set_attributes(data=join_configuration)) if TRIGGER_CONDITIONS in data and data[TRIGGER_CONDITIONS] is not None: alarm_info.trigger_conditions = [] for trigger_condition in data[TRIGGER_CONDITIONS]: alarm_info.trigger_conditions.append( # pylint: disable=no-member TriggerCondition.set_attributes(data=trigger_condition)) if SEND_RESOLVED in data: alarm_info.send_resolved = data[SEND_RESOLVED] return alarm_info class ConsumerGroup(TLSData): def __init__(self, project_id: str = None, consumer_group_name: str = None, heartbeat_ttl: int = None, ordered_consume: bool = None, topic_id_list: List[str] = None, project_name: str = None): self.project_id = project_id self.consumer_group_name = consumer_group_name self.heartbeat_ttl = heartbeat_ttl self.ordered_consume = ordered_consume self.topic_id_list = topic_id_list self.project_name = project_name @classmethod def set_attributes(cls, data: dict): project_id = data.get(PROJECT_ID_UPPERCASE) consumer_group_name = data.get(CONSUMER_GROUP_NAME) heartbeat_ttl = data.get(HEARTBEAT_TTL) ordered_consume = data.get(ORDERED_CONSUME) topic_id_list = data.get(TOPIC_ID_LIST) project_name = data.get(PROJECT_NAME) return cls(project_id, consumer_group_name, heartbeat_ttl, ordered_consume, topic_id_list, project_name) class ConsumeShard(TLSData): def __init__(self, topic_id: str = None, shard_id: int = None): self.topic_id = topic_id self.shard_id = shard_id @classmethod def set_attributes(cls, data: dict): topic_id = data.get(TOPIC_ID_UPPERCASE) shard_id = data.get(SHARD_ID_UPPERCASE) return cls(topic_id, shard_id) class TosSourceInfo(TLSData): def __init__(self, bucket: str = None, region: str = None, compress_type: str = None, prefix: str = None): """ :param bucket: TOS 存储桶名称 :type bucket: str :param region: TOS 存储桶所在区域 :type region: str :param compress_type: 日志压缩类型,可选值为 "none"、"gzip"、"lz4"、"snappy" :type compress_type: str :param prefix: 日志文件前缀,例如 "log/" :type prefix: str, optional """ self.bucket = bucket self.region = region self.compress_type = compress_type self.prefix = prefix def json(self): return { "bucket": self.bucket, "region": self.region, "compress_type": self.compress_type, "prefix": self.prefix, } class KafkaSourceInfo(TLSData): def __init__(self, host: str = None, topic: str = None, encode: str = None, protocol: str = None, is_need_auth: bool = None, initial_offset: int = None, time_source_default: int = None, group: str = None, username: str = None, password: str = None, mechanism: str = None, instance_id: str = None): """ :param host: Kafka 集群地址,多个服务地址之间需使用半角逗号(,)分隔。 :type host: str :param topic: Kafka Topic 名称。 多个 Kafka Topic 之间应使用半角逗号(,)分隔。 :type topic: str :param encode: 数据的编码格式。可选值包括 UTF-8、GBK。 :type encode: str :param protocol: Kafka 协议,可选值为 "plaintext"、"ssl" :type protocol: str :param is_need_auth: 是否开启鉴权。如果您使用的是公网服务地址,建议开启鉴权。 :type is_need_auth: bool :param initial_offset: 数据导入的起始位置。0:最早时间,即从指定的 Kafka Topic 中的第一条数据开始导入;1:最近时间,即从指定的 Kafka Topic 中最新生成的数据开始导入。 :type initial_offset: int, optional :param time_source_default: 指定日志时间。0:使用 Kafka 消息时间戳;1:使用系统当前时间。 :type time_source_default: int, optional :param group: 消费者组 ID,可选值为 None :type group: str, optional :param username: 用于身份认证的 Kafka SASL 用户名。 :type username: str, optional :param password: 用于身份认证的 Kafka SASL 用户密码。 :type password: str, optional :param mechanism: 密码认证机制,可选值包括 PLAIN、SCRAM-SHA-256 和 SCRAM-SHA-512。 :type mechanism: str, optional :param instance_id: 当您使用的是火山引擎消息队列 Kafka 版时,应设置为 Kafka 实例 ID。 :type instance_id: str, optional """ self.host = host self.topic = topic self.encode = encode self.protocol = protocol self.is_need_auth = is_need_auth self.initial_offset = initial_offset self.time_source_default = time_source_default self.group = group self.username = username self.password = password self.mechanism = mechanism self.instance_id = instance_id def json(self): return { "host": self.host, "topic": self.topic, "encode": self.encode, "protocol": self.protocol, "is_need_auth": self.is_need_auth, "initial_offset": self.initial_offset, "time_source_default": self.time_source_default, "group": self.group, "username": self.username, "password": self.password, "mechanism": self.mechanism, "instance_id": self.instance_id, } class EsSourceInfo(TLSData): def __init__(self, endpoint: str = None, import_mode: str = None, index: str = None, log_time_config: dict = None, max_import_time_delay_second: int = None, password: str = None, query_string: str = None, username: str = None): """Elasticsearch 导入源配置 :param endpoint: Elasticsearch 访问地址 :type endpoint: str, optional :param import_mode: 导入模式 :type import_mode: str, optional :param index: Elasticsearch 索引名称 :type index: str, optional :param log_time_config: 日志时间字段配置,对应后端的 LogTimeConfig :type log_time_config: dict, optional :param max_import_time_delay_second: 最大导入时间延迟(秒) :type max_import_time_delay_second: int, optional :param password: Elasticsearch 访问密码 :type password: str, optional :param query_string: 查询语句 :type query_string: str, optional :param username: Elasticsearch 访问用户名 :type username: str, optional """ self.endpoint = endpoint self.import_mode = import_mode self.index = index self.log_time_config = log_time_config self.max_import_time_delay_second = max_import_time_delay_second self.password = password self.query_string = query_string self.username = username @classmethod def set_attributes(cls, data: dict): return super(EsSourceInfo, cls).set_attributes(data) def json(self): return { "endpoint": self.endpoint, "import_mode": self.import_mode, "index": self.index, "log_time_config": self.log_time_config, "max_import_time_delay_second": self.max_import_time_delay_second, "password": self.password, "query_string": self.query_string, "username": self.username, } class ImportSourceInfo(TLSData): def __init__(self, tos_source_info: TosSourceInfo = None, kafka_source_info: KafkaSourceInfo = None, es_source_info: EsSourceInfo = None): self.tos_source_info = tos_source_info self.kafka_source_info = kafka_source_info self.es_source_info = es_source_info @classmethod def set_attributes(cls, data: dict): tos_source_info = None kafka_source_info = None es_source_info = None if TOS_SOURCE_INFO in data: tos_source_info = TosSourceInfo.set_attributes(data=data[TOS_SOURCE_INFO]) if KAFKA_SOURCE_INFO in data: kafka_source_info = KafkaSourceInfo.set_attributes(data=data[KAFKA_SOURCE_INFO]) if "EsSourceInfo" in data: es_source_info = EsSourceInfo.set_attributes(data=data["EsSourceInfo"]) return cls(tos_source_info, kafka_source_info, es_source_info) def json(self): source_info = {} if self.tos_source_info is not None: source_info[TOS_SOURCE_INFO] = self.tos_source_info.json() if self.kafka_source_info is not None: source_info[KAFKA_SOURCE_INFO] = self.kafka_source_info.json() if self.es_source_info is not None: source_info["EsSourceInfo"] = self.es_source_info.json() return source_info class ImportExtractRule(TLSData): def __init__(self, delimiter: str = None, begin_regex: str = None, keys: List[str] = None, time_key: str = None, time_format: str = None, time_zone: str = None, un_match_up_load_switch: bool = None, un_match_log_key: str = None, quote: str = None, time_extract_regex: str = None, skip_line_count: int = None, time_sample: str = None): assert (time_key is None and time_format is None) or (time_key is not None and time_format is not None) assert (un_match_up_load_switch is None and un_match_log_key is None) or \ (un_match_up_load_switch is not None and un_match_log_key is not None) self.delimiter = delimiter self.begin_regex = begin_regex self.keys = keys self.time_key = time_key self.time_format = time_format self.time_zone = time_zone self.un_match_up_load_switch = un_match_up_load_switch self.un_match_log_key = un_match_log_key self.quote = quote self.time_extract_regex = time_extract_regex self.skip_line_count = skip_line_count self.time_sample = time_sample class TargetInfo(TLSData): def __init__(self, region: str = None, log_type: str = None, extract_rule: ImportExtractRule = None, log_sample: str = None): """ :param region: 日志主题所在区域 :type region: str :param log_type: 日志类型:delimiter_log、multiline_log、minimalist_log、json_log :type log_type: str :param extract_rule: 提取规则 :type extract_rule: ImportExtractRule, optional :param log_sample: 日志样例。设置 log_type 为 multiline_log 时,需要配置日志样例 :type log_sample: str, optional """ self.region = region self.log_type = log_type self.log_sample = log_sample self.extract_rule = extract_rule def json(self): target_info = super(TargetInfo, self).json() if self.extract_rule is not None: target_info[EXTRACT_RULE] = self.extract_rule.json() return target_info @classmethod def set_attributes(cls, data: dict): target_info = super(TargetInfo, cls).set_attributes(data) if EXTRACT_RULE in data: target_info.extract_rule = ImportExtractRule.set_attributes(data=data[EXTRACT_RULE]) return target_info class TaskStatistics(TLSData): def __init__(self, total: int = None, failed: int = None, skipped: int = None, not_exist: int = None, bytes_total: int = None, task_status: str = None, transferred: int = None, bytes_transferred: int = None,): self.total = total self.failed = failed self.skipped = skipped self.not_exist = not_exist self.bytes_total = bytes_total self.task_status = task_status self.transferred = transferred self.bytes_transferred = bytes_transferred class ImportTaskInfo(TLSData): def __init__(self, task_id: str = None, status: int = None, topic_id: str = None, task_name: str = None, project_id: str = None, topic_name: str = None, project_name: str = None, create_time: str = None, source_type: str = None, description: str = None, import_source_info: ImportSourceInfo = None, target_info: TargetInfo = None, task_statistics: TaskStatistics = None): self.task_id = task_id self.status = status self.topic_id = topic_id self.task_name = task_name self.project_id = project_id self.topic_name = topic_name self.project_name = project_name self.create_time = create_time self.source_type = source_type self.description = description self.import_source_info = import_source_info self.target_info = target_info self.task_statistics = task_statistics @classmethod def set_attributes(cls, data: dict): import_task_info = super(ImportTaskInfo, cls).set_attributes(data) if TASK_STATISTICS in data: import_task_info.task_statistics = TaskStatistics.set_attributes(data=data[TASK_STATISTICS]) if IMPORT_SOURCE_INFO in data: import_task_info.import_source_info = ImportSourceInfo.set_attributes(data=data[IMPORT_SOURCE_INFO]) if TARGET_INFO in data: import_task_info.target_info = TargetInfo.set_attributes(data=data[TARGET_INFO]) return import_task_info class JsonInfo(TLSData): def __init__(self, enable: bool = None, keys: List[str] = None, escape: bool = None): """ :param enable: 启用标志 :type enable: bool, optional :param keys: 需要投递的字段列表 :type keys: List[str], optional :param escape: 是否转义 :type escape: bool, optional """ self.enable = enable self.keys = keys self.escape = escape class CsvInfo(TLSData): def __init__(self, keys: List[str] = None, delimiter: str = None, escape_char: str = None, print_header: bool = None, non_field_content: str = None): """ :param keys: 需要投递的字段列表 :type keys: List[str], optional :param delimiter: 分隔符 :type delimiter: str, optional :param escape_char: 转义符 :type escape_char: str, optional :param print_header: 首行是否打印Key :type print_header: bool, optional :param non_field_content: 无效字段填充内容 :type non_field_content: str, optional """ self.keys = keys self.delimiter = delimiter self.escape_char = escape_char self.print_header = print_header self.non_field_content = non_field_content class ContentInfo(TLSData): def __init__(self, format: str = None, json_info: JsonInfo = None, csv_info: CsvInfo = None): """ :param format: 日志内容解析格式,投递到 TOS 时,支持配置为 json、csv。投递到 Kafka 时,支持配置为 original、json。 :type format: str, optional :param json_info: JSON格式日志内容配置 :type json_info: JsonInfo, optional :param csv_info: CSV格式日志内容配置 :type csv_info: CsvInfo, optional """ self.format = format self.json_info = json_info self.csv_info = csv_info def json(self): content_info = super(ContentInfo, self).json() if self.json_info: content_info[JSON_INFO] = self.json_info.json() if self.csv_info: content_info[CSV_INFO] = self.csv_info.json() return content_info @classmethod def set_attributes(cls, data: dict): content_info = super(ContentInfo, cls).set_attributes(data) if JSON_INFO in data: content_info.json_info = JsonInfo.set_attributes(data=data[JSON_INFO]) if CSV_INFO in data: content_info.csv_info = CsvInfo.set_attributes(data=data[CSV_INFO]) return content_info class TosShipperInfo(TLSData): def __init__(self, bucket: str = None, prefix: str = None, max_size: int = None, compress: str = None, interval: int = None, partition_format: str = None): """ :param bucket: TOS存储桶名称 :type bucket: str, optional :param prefix: 存储桶的顶级目录名称 :type prefix: str, optional :param max_size: 每个分区最大可投递的原始文件大小,单位为MiB :type max_size: int, optional :param compress: 压缩格式 :type compress: str, optional :param interval: 投递时间间隔,单位为秒 :type interval: int, optional :param partition_format: 投递日志的分区规则 :type partition_format: str, optional """ self.bucket = bucket self.prefix = prefix self.max_size = max_size self.compress = compress self.interval = interval self.partition_format = partition_format class KafkaShipperInfo(TLSData): def __init__(self, instance: str = None, kafka_topic: str = None, compress: str = None, start_time: int = None, end_time: int = None): """ :param instance: Kafka实例 :type instance: str, optional :param kafka_topic: Kafka Topic名称 :type kafka_topic: str, optional :param compress: 压缩格式 :type compress: str, optional :param start_time: 投递开始时间,毫秒时间戳 :type start_time: int, optional :param end_time: 投递结束时间,毫秒时间戳 :type end_time: int, optional """ self.instance = instance self.kafka_topic = kafka_topic self.compress = compress self.start_time = start_time self.end_time = end_time class ShipperInfo(TLSData): def __init__(self, shipper_id: str = None, shipper_name: str = None, project_id: str = None, project_name: str = None, topic_id: str = None, topic_name: str = None, shipper_type: str = None, status: bool = None, create_time: str = None, modify_time: str = None, shipper_start_time: int = None, shipper_end_time: int = None, content_info: ContentInfo = None, tos_shipper_info: TosShipperInfo = None, kafka_shipper_info: KafkaShipperInfo = None, dashboard_id: str = None, role_trn: str = None): """ :param shipper_id: 投递配置ID :type shipper_id: str, optional :param shipper_name: 投递配置名称 :type shipper_name: str, optional :param project_id: 日志项目ID :type project_id: str, optional :param project_name: 日志项目名称 :type project_name: str, optional :param topic_id: 日志主题ID :type topic_id: str, optional :param topic_name: 日志主题名称 :type topic_name: str, optional :param shipper_type: 投递类型 :type shipper_type: str, optional :param status: 是否开启投递配置 :type status: bool, optional :param create_time: 创建时间 :type create_time: str, optional :param modify_time: 修改时间 :type modify_time: str, optional :param shipper_start_time: 投递开始时间 :type shipper_start_time: int, optional :param shipper_end_time: 投递结束时间 :type shipper_end_time: int, optional :param content_info: 日志内容的投递格式配置 :type content_info: ContentInfo, optional :param tos_shipper_info: 投递到TOS的相关信息 :type tos_shipper_info: TosShipperInfo, optional :param kafka_shipper_info: 投递到Kafka的相关信息 :type kafka_shipper_info: KafkaShipperInfo, optional :param dashboard_id: 投递的默认内置仪表盘ID :type dashboard_id: str, optional :param role_trn: 自定义角色的Trn :type role_trn: str, optional """ self.shipper_id = shipper_id self.shipper_name = shipper_name self.project_id = project_id self.project_name = project_name self.topic_id = topic_id self.topic_name = topic_name self.shipper_type = shipper_type self.status = status self.create_time = create_time self.modify_time = modify_time self.shipper_start_time = shipper_start_time self.shipper_end_time = shipper_end_time self.content_info = content_info self.tos_shipper_info = tos_shipper_info self.kafka_shipper_info = kafka_shipper_info self.dashboard_id = dashboard_id self.role_trn = role_trn @classmethod def set_attributes(cls, data: dict): shipper_info = super(ShipperInfo, cls).set_attributes(data) if CONTENT_INFO in data: shipper_info.content_info = ContentInfo.set_attributes(data=data[CONTENT_INFO]) if TOS_SHIPPER_INFO in data: shipper_info.tos_shipper_info = TosShipperInfo.set_attributes(data=data[TOS_SHIPPER_INFO]) if KAFKA_SHIPPER_INFO in data: shipper_info.kafka_shipper_info = KafkaShipperInfo.set_attributes(data=data[KAFKA_SHIPPER_INFO]) return shipper_info class TargetResource(TLSData): def __init__(self, alias: str, topic_id: str, region: str, role_trn: str = None): """ :param alias: 自定义输出目标的名称,在数据加工规则中需要使用此名称指代输出目标 :type alias: str :param topic_id: 用于存储加工后日志的日志主题 :type topic_id: str :param region: 用于存储加工后日志的日志主题的地域 :type region: str :param role_trn: 跨账号授权角色名 :type role_trn: str, optional """ self.alias = alias self.topic_id = topic_id self.region = region self.role_trn = role_trn class TraceInstanceInfo(TLSData): def __init__(self, trace_instance_id: str = None, trace_instance_name: str = None, project_id: str = None, project_name: str = None, trace_topic_id: str = None, trace_topic_name: str = None, dependency_topic_id: str = None, dependency_topic_topic_name: str = None, trace_instance_status: str = None, description: str = None, create_time: str = None, modify_time: str = None): """ :param trace_instance_id: Trace实例ID :type trace_instance_id: str, optional :param trace_instance_name: Trace实例名称 :type trace_instance_name: str, optional :param project_id: 日志项目ID :type project_id: str, optional :param project_name: 日志项目名称 :type project_name: str, optional :param trace_topic_id: Trace Topic ID :type trace_topic_id: str, optional :param trace_topic_name: Trace Topic名称 :type trace_topic_name: str, optional :param dependency_topic_id: Dependency Topic ID :type dependency_topic_id: str, optional :param dependency_topic_topic_name: Dependency Topic名称 :type dependency_topic_topic_name: str, optional :param trace_instance_status: Trace实例状态 :type trace_instance_status: str, optional :param description: Trace实例描述 :type description: str, optional :param create_time: 创建时间 :type create_time: str, optional :param modify_time: 修改时间 :type modify_time: str, optional """ self.trace_instance_id = trace_instance_id self.trace_instance_name = trace_instance_name self.project_id = project_id self.project_name = project_name self.trace_topic_id = trace_topic_id self.trace_topic_name = trace_topic_name self.dependency_topic_id = dependency_topic_id self.dependency_topic_topic_name = dependency_topic_topic_name self.trace_instance_status = trace_instance_status self.description = description self.create_time = create_time self.modify_time = modify_time def get_trace_instance_id(self): """返回 Trace实例ID""" return self.trace_instance_id def get_trace_instance_name(self): """返回 Trace实例名称""" return self.trace_instance_name def get_trace_instance_status(self): """返回 Trace实例状态""" return self.trace_instance_status def get_project_id(self): """返回 日志项目ID""" return self.project_id def get_project_name(self): """返回 日志项目名称""" return self.project_name def get_description(self): """返回 Trace实例描述""" return self.description def get_create_time(self): """返回 创建时间""" return self.create_time def get_modify_time(self): """返回 修改时间""" return self.modify_time def get_trace_topic_id(self): """返回 Trace Topic ID""" return self.trace_topic_id def get_trace_topic_name(self): """返回 Trace Topic名称""" return self.trace_topic_name def get_dependency_topic_id(self): """返回 Dependency Topic ID""" return self.dependency_topic_id def get_dependency_topic_topic_name(self): """返回 Dependency Topic名称""" return self.dependency_topic_topic_name class TargetResourceInfo(TLSData): def __init__(self, alias: str = None, topic_id: str = None, project_id: str = None, project_name: str = None, region: str = None, topic_name: str = None, role_trn: str = None): """\ :param alias: 自定义输出目标的名称 :type alias: str :param topic_id: 用于存储加工后日志的日志主题 ID :type topic_id: str :param project_id: 用于存储加工后日志的日志项目 ID :type project_id: str :param project_name: 用于存储加工后日志的日志项目名称 :type project_name: str :param region: 用于存储加工后日志的日志项目所属地域 :type region: str :param topic_name: 用于存储加工后日志的日志主题名称 :type topic_name: str :param role_trn: 跨账号授权角色名 :type role_trn: str """ self.alias = alias self.topic_id = topic_id self.project_id = project_id self.project_name = project_name self.region = region self.topic_name = topic_name self.role_trn = role_trn def get_alias(self): """\ :return: 自定义输出目标的名称 :rtype: str """ return self.alias def get_topic_id(self): """\ :return: 用于存储加工后日志的日志主题 ID :rtype: str """ return self.topic_id def get_project_id(self): """\ :return: 用于存储加工后日志的日志项目 ID :rtype: str """ return self.project_id def get_project_name(self): """\ :return: 用于存储加工后日志的日志项目名称 :rtype: str """ return self.project_name def get_region(self): """\ :return: 用于存储加工后日志的日志项目所属地域 :rtype: str """ return self.region def get_topic_name(self): """\ :return: 用于存储加工后日志的日志主题名称 :type topic_name: str """ return self.topic_name def get_role_trn(self): """\ :return: 跨账号授权角色名 :rtype: str """ return self.role_trn class EtlTaskInfo(TLSData): def __init__( self, task_id: str = None, name: str = None, source_topic_id: str = None, source_topic_name: str = None, dsl_type: str = None, script: str = None, task_type: str = None, target_resources: List[TargetResourceInfo] = None, enable: bool = None, description: str = None, etl_status: str = None, from_time: int = None, to_time: int = None, create_time: str = None, modify_time: str = None, last_enable_time: str = None, dashboard_id: str = None, project_id: str = None, project_name: str = None): """ETL 任务信息 对应服务端 DescribeETLTaskResp 结构,用于承载 DescribeETLTasks 返回的单个任务。 """ self.task_id = task_id self.name = name self.source_topic_id = source_topic_id self.source_topic_name = source_topic_name self.dsl_type = dsl_type self.script = script self.task_type = task_type self.target_resources = target_resources self.enable = enable self.description = description self.etl_status = etl_status self.from_time = from_time self.to_time = to_time self.create_time = create_time self.modify_time = modify_time self.last_enable_time = last_enable_time self.dashboard_id = dashboard_id self.project_id = project_id self.project_name = project_name @classmethod def set_attributes(cls, data: dict): etl_task_info = super(EtlTaskInfo, cls).set_attributes(data) if ETL_TARGET_RESOURCES in data and data[ETL_TARGET_RESOURCES] is not None: etl_task_info.target_resources = [] for target_resource in data[ETL_TARGET_RESOURCES]: etl_task_info.target_resources.append( # pylint: disable=no-member TargetResourceInfo.set_attributes(data=target_resource) ) return etl_task_info class RequestCycleInfo(TLSData): def __init__(self, time: int = None, task_type: str = None, cron_tab: str = None, cron_time_zone: str = None): """ :param time: 调度的周期或者定期执行的时间点(距离 00:00 的分钟数),取值范围为 1~1440,单位为分钟 :type time: int, optional :param task_type: 调度周期类型。可选值:Period:按照周期进行调度,即每隔一段时间调度一次。 Fixed:定期调度,即每天固定时间点调度一次。Cron:使用 Cron 表达式 :type task_type: str, optional :param cron_tab: Cron 表达式,日志服务通过 Cron 表达式指定告警任务定时执行。 Cron 表达式的最小粒度为分钟,24 小时制 :type cron_tab: str, optional :param cron_time_zone: 设置 Type 为 Cron 时,还需设置时区 :type cron_time_zone: str, optional """ self.time = time self.type = task_type # 使用 type 字段以匹配 API 响应格式 self.cron_tab = cron_tab self.cron_time_zone = cron_time_zone class ScheduleSqlTaskInfo(TLSData): def __init__(self, task_id: str = None, task_name: str = None, description: str = None, source_project_id: str = None, source_project_name: str = None, source_topic_id: str = None, source_topic_name: str = None, dest_region: str = None, dest_project_id: str = None, dest_topic_id: str = None, dest_topic_name: str = None, status: int = None, process_start_time: int = None, process_end_time: int = None, process_sql_delay: int = None, process_time_window: str = None, query: str = None, request_cycle: RequestCycleInfo = None, create_time_stamp: int = None, modify_time_stamp: int = None): """ :param task_id: 定时 SQL 分析任务 ID :type task_id: str, optional :param task_name: 定时 SQL 分析任务名称 :type task_name: str, optional :param description: 定时 SQL 分析任务的简单描述 :type description: str, optional :param source_project_id: 源日志主题所属的日志项目 ID :type source_project_id: str, optional :param source_project_name: 源日志主题所属的日志项目名称 :type source_project_name: str, optional :param source_topic_id: 进行定时 SQL 分析的原始日志所在的源日志主题 ID :type source_topic_id: str, optional :param source_topic_name: 进行定时 SQL 分析的原始日志所在的源日志主题名称 :type source_topic_name: str, optional :param dest_region: 目标日志项目所属地域 :type dest_region: str, optional :param dest_project_id: 用于存储定时 SQL 分析结果数据的目标日志主题所属日志项目 :type dest_project_id: str, optional :param dest_topic_id: 用于存储定时 SQL 分析结果数据的目标日志主题 ID :type dest_topic_id: str, optional :param dest_topic_name: 用于存储定时 SQL 分析结果数据的目标日志主题名称 :type dest_topic_name: str, optional :param status: 完成任务配置后是否立即启动定时 SQL 分析任务。0:关闭任务,后续需手动启动任务。1:立即启动 :type status: int, optional :param process_start_time: 调度定时 SQL 任务的开始时间,即第一个实例的创建时间。格式为秒级时间戳 :type process_start_time: int, optional :param process_end_time: 调度定时 SQL 任务的结束时间。格式为秒级时间戳 :type process_end_time: int, optional :param process_sql_delay: 每次调度的延迟时间。单位为秒 :type process_sql_delay: int, optional :param process_time_window: SQL 时间窗口 :type process_time_window: str, optional :param query: 定时 SQL 分析任务定期执行的检索与分析语句 :type query: str, optional :param request_cycle: 定时 SQL 分析任务的调度周期 :type request_cycle: RequestCycleInfo, optional :param create_time_stamp: 定时 SQL 分析任务的创建时间 :type create_time_stamp: int, optional :param modify_time_stamp: 定时 SQL 分析任务的最近一次修改时间 :type modify_time_stamp: int, optional """ self.task_id = task_id self.task_name = task_name self.description = description # 规范字段名:source_project_id/source_topic_id/dest_project_id/dest_topic_id self.source_project_id = source_project_id self.source_project_name = source_project_name self.source_topic_id = source_topic_id self.source_topic_name = source_topic_name self.dest_region = dest_region self.dest_project_id = dest_project_id self.dest_topic_id = dest_topic_id self.dest_topic_name = dest_topic_name self.status = status self.process_start_time = process_start_time self.process_end_time = process_end_time self.process_sql_delay = process_sql_delay self.process_time_window = process_time_window self.query = query self.request_cycle = request_cycle self.create_time_stamp = create_time_stamp self.modify_time_stamp = modify_time_stamp @classmethod def set_attributes(cls, data: dict): schedule_sql_task_info = super(ScheduleSqlTaskInfo, cls).set_attributes(data) # 处理嵌套的 RequestCycle 对象 if REQUEST_CYCLE in data and data[REQUEST_CYCLE] is not None: schedule_sql_task_info.request_cycle = RequestCycleInfo.set_attributes(data=data[REQUEST_CYCLE]) return schedule_sql_task_info class DingTalkContentTemplateInfo(TLSData): def __init__(self, title: str = None, locale: str = None, content: str = None): """ :param title: 告警通知内容的主题 :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 """ self.title = title self.locale = locale self.content = content class EmailContentTemplateInfo(TLSData): def __init__(self, locale: str = None, content: str = None, subject: str = None): """ :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 :param subject: 邮件通知的主题 """ self.locale = locale self.content = content self.subject = subject class LarkContentTemplateInfo(TLSData): def __init__(self, title: str = None, locale: str = None, content: str = None): """ :param title: 告警通知内容的主题 :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 """ self.title = title self.locale = locale self.content = content class SmsContentTemplateInfo(TLSData): def __init__(self, locale: str = None, content: str = None): """ :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 """ self.locale = locale self.content = content class VmsContentTemplateInfo(TLSData): def __init__(self, locale: str = None, content: str = None): """ :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 """ self.locale = locale self.content = content class WeChatContentTemplateInfo(TLSData): def __init__(self, title: str = None, locale: str = None, content: str = None): """ :param title: 告警通知内容的主题 :param locale: 告警通知中固定内容的语言,可选值为 zh-CN、en-US :param content: 告警通知内容,支持普通文本格式,支持插入内容变量、内容函数等 """ self.title = title self.locale = locale self.content = content class WebhookContentTemplateInfo(TLSData): def __init__(self, content: str = None): """ :param content: 告警通知内容,通常为 JSON 格式,支持插入内容变量、内容函数等 """ self.content = content class ContentTemplateInfo(TLSData): def __init__(self, sms: SmsContentTemplateInfo = None, vms: VmsContentTemplateInfo = None, lark: LarkContentTemplateInfo = None, email: EmailContentTemplateInfo = None, we_chat: WeChatContentTemplateInfo = None, webhook: WebhookContentTemplateInfo = None, ding_talk: DingTalkContentTemplateInfo = None, is_default: bool = None, create_time: str = None, modify_time: str = None, alarm_content_template_id: str = None, alarm_content_template_name: str = None): """告警内容模板信息 :param sms: 短信通知内容模板相关信息 :type sms: SmsContentTemplateInfo :param vms: 电话通知内容模板相关信息 :type vms: VmsContentTemplateInfo :param lark: 飞书通知内容模板相关信息 :type lark: LarkContentTemplateInfo :param email: 邮件通知内容模板相关信息 :type email: EmailContentTemplateInfo :param we_chat: 企业微信通知内容模板相关信息 :type we_chat: WeChatContentTemplateInfo :param webhook: 自定义 Webhook 通知内容模板相关信息 :type webhook: WebhookContentTemplateInfo :param ding_talk: 钉钉通知内容模板相关信息 :type ding_talk: DingTalkContentTemplateInfo :param is_default: 是否为内置的内容模版 :type is_default: bool :param create_time: 告警通知内容模版的创建时间 :type create_time: str :param modify_time: 告警通知内容模板的修改时间 :type modify_time: str :param alarm_content_template_id: 告警通知内容模板 ID :type alarm_content_template_id: str :param alarm_content_template_name: 告警通知内容模板名称 :type alarm_content_template_name: str """ self.sms = sms self.vms = vms self.lark = lark self.email = email self.we_chat = we_chat self.webhook = webhook self.ding_talk = ding_talk self.is_default = is_default self.create_time = create_time self.modify_time = modify_time self.alarm_content_template_id = alarm_content_template_id self.alarm_content_template_name = alarm_content_template_name @classmethod def set_attributes(cls, data: dict): content_template_info = super(ContentTemplateInfo, cls).set_attributes(data) sms_data = data.get("Sms") if sms_data is None: sms_data = data.get(SMS) if sms_data is not None: content_template_info.sms = SmsContentTemplateInfo.set_attributes(sms_data) if VMS in data and data[VMS] is not None: content_template_info.vms = VmsContentTemplateInfo.set_attributes(data[VMS]) if LARK in data and data[LARK] is not None: content_template_info.lark = LarkContentTemplateInfo.set_attributes(data[LARK]) if EMAIL in data and data[EMAIL] is not None: content_template_info.email = EmailContentTemplateInfo.set_attributes(data[EMAIL]) if WE_CHAT in data and data[WE_CHAT] is not None: content_template_info.we_chat = WeChatContentTemplateInfo.set_attributes(data[WE_CHAT]) if WEBHOOK in data and data[WEBHOOK] is not None: content_template_info.webhook = WebhookContentTemplateInfo.set_attributes(data[WEBHOOK]) if DING_TALK in data and data[DING_TALK] is not None: content_template_info.ding_talk = DingTalkContentTemplateInfo.set_attributes(data[DING_TALK]) return content_template_info class GeneralWebhookHeaderKV(TLSData): def __init__(self, key: str = None, value: str = None): """自定义 Webhook 请求头键值对 :param key: 自定义请求头的 Key :type key: str :param value: 自定义请求头的 Value :type value: str """ self.key = key self.value = value def get_key(self): """返回自定义请求头的 Key :return: 自定义请求头的 Key :rtype: str """ return self.key def get_value(self): """返回自定义请求头的 Value :return: 自定义请求头的 Value :rtype: str """ return self.value @classmethod def set_attributes(cls, data: dict): """从字典构造 GeneralWebhookHeaderKV 对象""" key = data.get(KEY) value = data.get(VALUE) return cls(key, value) class WebhookIntegrationInfo(TLSData): def __init__(self, webhook_id: str = None, create_time: str = None, modify_time: str = None, webhook_url: str = None, webhook_name: str = None, webhook_type: str = None, webhook_method: str = None, webhook_secret: str = None, webhook_headers: List[GeneralWebhookHeaderKV] = None): """告警 Webhook 集成配置信息 :param webhook_id: Webhook 集成配置 ID :type webhook_id: str :param create_time: Webhook 集成配置创建时间 :type create_time: str :param modify_time: Webhook 集成配置最近一次修改时间 :type modify_time: str :param webhook_url: Webhook 请求地址 :type webhook_url: str :param webhook_name: Webhook 集成配置名称 :type webhook_name: str :param webhook_type: Webhook 类型 :type webhook_type: str :param webhook_method: 自定义 Webhook 请求方法 :type webhook_method: str :param webhook_secret: Webhook 加密密钥 :type webhook_secret: str :param webhook_headers: 自定义 Webhook 的请求头 :type webhook_headers: List[GeneralWebhookHeaderKV] """ self.webhook_id = webhook_id self.create_time = create_time self.modify_time = modify_time self.webhook_url = webhook_url self.webhook_name = webhook_name self.webhook_type = webhook_type self.webhook_method = webhook_method self.webhook_secret = webhook_secret self.webhook_headers = webhook_headers @classmethod def set_attributes(cls, data: dict): webhook_integration_info = super(WebhookIntegrationInfo, cls).set_attributes(data) if WEBHOOK_HEADERS in data: webhook_headers = data[WEBHOOK_HEADERS] webhook_integration_info.webhook_headers = [] for header in webhook_headers: webhook_integration_info.webhook_headers.append( # pylint: disable=no-member GeneralWebhookHeaderKV(header.get(KEY), header.get(VALUE))) return webhook_integration_info class ResourceTagInfo(TLSData): def __init__(self, tag_key: str = None, tag_value: str = None, resource_id: str = None, resource_type: str = None): """资源标签信息 :param tag_key: 标签 Key 的值 :param tag_value: 标签 Value 的值 :param resource_id: 资源 ID :param resource_type: 资源类型 """ self.tag_key = tag_key self.tag_value = tag_value self.resource_id = resource_id self.resource_type = resource_type class StatusInfo(TLSData): def __init__(self, code: str = None, message: str = None): """ :param code: 状态码 :type code: str :param message: 错误消息 :type message: str """ self.code = code self.message = message class ResourceInfo(TLSData): def __init__(self, attributes: List[KeyValueInfo] = None): """ :param attributes: 资源属性列表 :type attributes: List[KeyValueInfo] """ self.attributes = attributes @classmethod def set_attributes(cls, data: dict): resource_info = super(ResourceInfo, cls).set_attributes(data) if ATTRIBUTES in data and data[ATTRIBUTES] is not None: resource_info.attributes = [] for attr in data[ATTRIBUTES]: resource_info.attributes.append(KeyValueInfo.set_attributes(data=attr)) # pylint: disable=no-member return resource_info class InstrumentationLibraryInfo(TLSData): def __init__(self, name: str = None, version: str = None): """ :param name: 检测库名称 :type name: str :param version: 检测库版本 :type version: str """ self.name = name self.version = version class SpanLinkInfo(TLSData): def __init__(self, trace_id: str = None, span_id: str = None, trace_state: str = None, attributes: List[KeyValueInfo] = None): """ :param trace_id: Trace ID :type trace_id: str :param span_id: Span ID :type span_id: str :param trace_state: Trace状态 :type trace_state: str :param attributes: 属性列表 :type attributes: List[KeyValueInfo] """ self.trace_id = trace_id self.span_id = span_id self.trace_state = trace_state self.attributes = attributes @classmethod def set_attributes(cls, data: dict): span_link = super(SpanLinkInfo, cls).set_attributes(data) if ATTRIBUTES in data and data[ATTRIBUTES] is not None: span_link.attributes = [] for attr in data[ATTRIBUTES]: span_link.attributes.append(KeyValueInfo.set_attributes(data=attr)) # pylint: disable=no-member return span_link class SpanEventInfo(TLSData): def __init__(self, name: str = None, timestamp: int = None, attributes: List[KeyValueInfo] = None): """ :param name: 事件名称 :type name: str :param timestamp: 时间戳(微秒) :type timestamp: int :param attributes: 属性列表 :type attributes: List[KeyValueInfo] """ self.name = name self.timestamp = timestamp self.attributes = attributes @classmethod def set_attributes(cls, data: dict): span_event = super(SpanEventInfo, cls).set_attributes(data) if ATTRIBUTES in data and data[ATTRIBUTES] is not None: span_event.attributes = [] for attr in data[ATTRIBUTES]: span_event.attributes.append(KeyValueInfo.set_attributes(data=attr)) # pylint: disable=no-member return span_event class SpanInfo(TLSData): def __init__(self, trace_id: str = None, span_id: str = None, kind: str = None, name: str = None, start_time: int = None, end_time: int = None, parent_span_id: str = None, trace_state: str = None, status: StatusInfo = None, resource: ResourceInfo = None, attributes: List[KeyValueInfo] = None, links: List[SpanLinkInfo] = None, events: List[SpanEventInfo] = None, instrumentation_library: InstrumentationLibraryInfo = None): """ :param trace_id: Trace ID :type trace_id: str :param span_id: Span ID :type span_id: str :param kind: Span类型 :type kind: str :param name: Span名称 :type name: str :param start_time: 开始时间(微秒) :type start_time: int :param end_time: 结束时间(微秒) :type end_time: int :param parent_span_id: 父Span ID :type parent_span_id: str :param trace_state: Trace状态 :type trace_state: str :param status: Span状态 :type status: StatusInfo :param resource: 资源信息 :type resource: ResourceInfo :param attributes: 属性列表 :type attributes: List[KeyValueInfo] :param links: 链接列表 :type links: List[SpanLinkInfo] :param events: 事件列表 :type events: List[SpanEventInfo] :param instrumentation_library: 检测库信息 :type instrumentation_library: InstrumentationLibraryInfo """ self.trace_id = trace_id self.span_id = span_id self.kind = kind self.name = name self.start_time = start_time self.end_time = end_time self.parent_span_id = parent_span_id self.trace_state = trace_state self.status = status self.resource = resource self.attributes = attributes self.links = links self.events = events self.instrumentation_library = instrumentation_library @classmethod def set_attributes(cls, data: dict): span_info = super(SpanInfo, cls).set_attributes(data) if STATUS in data and data[STATUS] is not None: span_info.status = StatusInfo.set_attributes(data=data[STATUS]) if RESOURCE in data and data[RESOURCE] is not None: span_info.resource = ResourceInfo.set_attributes(data=data[RESOURCE]) if ATTRIBUTES in data and data[ATTRIBUTES] is not None: span_info.attributes = [] for attr in data[ATTRIBUTES]: span_info.attributes.append(KeyValueInfo.set_attributes(data=attr)) # pylint: disable=no-member if LINKS in data and data[LINKS] is not None: span_info.links = [] for link in data[LINKS]: span_info.links.append(SpanLinkInfo.set_attributes(data=link)) # pylint: disable=no-member if EVENTS in data and data[EVENTS] is not None: span_info.events = [] for event in data[EVENTS]: span_info.events.append(SpanEventInfo.set_attributes(data=event)) # pylint: disable=no-member if INSTRUMENTATION_LIBRARY in data and data[INSTRUMENTATION_LIBRARY] is not None: span_info.instrumentation_library = InstrumentationLibraryInfo.set_attributes( data=data[INSTRUMENTATION_LIBRARY]) # pylint: disable=no-member return span_info class TraceInfo(TLSData): def __init__(self, spans: List[SpanInfo] = None, trace_id: str = None, service_name: str = None, operation_name: str = None, start_time: int = None, end_time: int = None, duration: int = None, status_code: str = None, attributes: dict = None): """综合 Trace 信息结构 - DescribeTrace 场景:通过 spans 字段承载完整的 Span 列表; - SearchTraces 场景:通过 trace_id / service_name / operation_name / start_time / end_time / duration / status_code / attributes 等字段承载 Trace 概要。 """ self.spans = spans self.trace_id = trace_id self.service_name = service_name self.operation_name = operation_name self.start_time = start_time self.end_time = end_time self.duration = duration self.status_code = status_code self.attributes = attributes @classmethod def set_attributes(cls, data: dict): trace_info = super(TraceInfo, cls).set_attributes(data) if SPANS in data and data[SPANS] is not None: trace_info.spans = [] for span in data[SPANS]: trace_info.spans.append(SpanInfo.set_attributes(data=span)) # pylint: disable=no-member return trace_info def get_trace_id(self): """返回 Trace ID""" return getattr(self, "trace_id", None) def get_service_name(self): """返回服务名称""" return getattr(self, "service_name", None) def get_operation_name(self): """返回操作名称""" return getattr(self, "operation_name", None) def get_start_time(self): """返回开始时间(微秒)""" return getattr(self, "start_time", None) def get_end_time(self): """返回结束时间(微秒)""" return getattr(self, "end_time", None) def get_duration(self): """返回持续时间(微秒)""" return getattr(self, "duration", None) def get_status_code(self): """返回状态码""" return getattr(self, "status_code", None) def get_attributes(self): """返回自定义属性""" return getattr(self, "attributes", None) class RuleNode(TLSData): def __init__(self, type: str = None, value: List[str] = None, children: List['RuleNode'] = None): """ :param type: 当前节点类型。可选值:Operation:操作节点。Condition:条件节点 :type type: str :param value: 节点值 :type value: List[str] :param children: 子节点 :type children: List[RuleNode] """ self.type = type self.value = value self.children = children def get_type(self): """ :return: 当前节点类型 :rtype: str """ return self.type def get_value(self): """ :return: 节点值 :rtype: List[str] """ return self.value def get_children(self): """ :return: 子节点 :rtype: List[RuleNode] """ return self.children @classmethod def set_attributes(cls, data: dict): rule_node = super(RuleNode, cls).set_attributes(data) if CHILDREN in data and data[CHILDREN] is not None: rule_node.children = [] for child_data in data[CHILDREN]: rule_node.children.append( # pylint: disable=no-member RuleNode.set_attributes(child_data)) return rule_node def json(self): json_data = super(RuleNode, self).json() if self.children is not None: json_data[CHILDREN] = [] for child in self.children: json_data[CHILDREN].append(child.json()) return json_data class NoticeRule(TLSData): def __init__(self, has_next: bool = None, rule_node: RuleNode = None, has_end_node: bool = None, receiver_infos: List[Receiver] = None): """ :param has_next: 是否继续进入下一层的条件判断 :type has_next: bool :param rule_node: 规则节点 :type rule_node: RuleNode :param has_end_node: 后面是否存在结束节点 :type has_end_node: bool :param receiver_infos: 通知渠道相关信息 :type receiver_infos: List[Receiver] """ self.has_next = has_next self.rule_node = rule_node self.has_end_node = has_end_node self.receiver_infos = receiver_infos def get_has_next(self): """ :return: 是否继续进入下一层的条件判断 :rtype: bool """ return self.has_next def get_rule_node(self): """ :return: 规则节点 :rtype: RuleNode """ return self.rule_node def get_has_end_node(self): """ :return: 后面是否存在结束节点 :rtype: bool """ return self.has_end_node def get_receiver_infos(self): """ :return: 通知渠道相关信息 :rtype: List[Receiver] """ return self.receiver_infos @classmethod def set_attributes(cls, data: dict): notice_rule = super(NoticeRule, cls).set_attributes(data) if RULE_NODE in data and data[RULE_NODE] is not None: notice_rule.rule_node = RuleNode.set_attributes(data[RULE_NODE]) if RECEIVER_INFOS in data and data[RECEIVER_INFOS] is not None: notice_rule.receiver_infos = [] for receiver_data in data[RECEIVER_INFOS]: notice_rule.receiver_infos.append( # pylint: disable=no-member Receiver.set_attributes(receiver_data)) return notice_rule def json(self): json_data = super(NoticeRule, self).json() if self.rule_node is not None: json_data[RULE_NODE] = self.rule_node.json() if self.receiver_infos is not None: json_data[RECEIVER_INFOS] = [] for receiver in self.receiver_infos: json_data[RECEIVER_INFOS].append(receiver.json()) return json_data ================================================ FILE: volcengine/tls/log.proto ================================================ syntax = "proto3"; package pb; message LogContent { string key = 1; string value = 2; } message Log { int64 time = 1; // UNIX Time Format repeated LogContent contents = 2; oneof OptionalTimeNs { fixed32 TimeNs = 3; // 纳秒级时间戳 } } message LogTag { string key = 1; string value = 2; } message LogGroup { repeated Log logs = 1; string source = 2; repeated LogTag log_tags = 3; string filename = 4; string context_flow = 5; // 该字段暂无效用 } message LogGroupList { repeated LogGroup log_groups = 1; } ================================================ FILE: volcengine/tls/log_content_patch.py ================================================ from google.protobuf import message as _message from google.protobuf.internal import decoder as _decoder from google.protobuf.internal import wire_format as _wire_format from volcengine.tls import log_pb2 def ParseLogGroupListFromString(log_group_list, serialized_data): buffer = memoryview(serialized_data) pos = 0 end = len(buffer) log_group_list.Clear() while pos < end: tag_bytes, pos = _decoder.ReadTag(buffer, pos) tag = _decoder._DecodeVarint(tag_bytes, 0)[0] field_num, wire_type = _wire_format.UnpackTag(tag) if field_num == 1 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_log_groups(log_group_list, buffer, pos, end) else: pos = _decoder.SkipField(buffer, pos, end, tag_bytes) # pylint: disable=no-member return pos def _parse_log_groups(log_group_list, buffer, pos, end): size, pos = _decoder._DecodeVarint(buffer, pos) group_end = pos + size if group_end > end: raise _message.DecodeError("Truncated LogGroupList.log_groups") group = log_pb2.LogGroup() ParseLogGroupFromString(group, buffer[pos:group_end].tobytes()) log_group_list.log_groups.append(group) return group_end def ParseLogGroupFromString(log_group, serialized_data): buffer = memoryview(serialized_data) pos = 0 end = len(buffer) log_group.Clear() while pos < end: tag_bytes, pos = _decoder.ReadTag(buffer, pos) tag = _decoder._DecodeVarint(tag_bytes, 0)[0] field_num, wire_type = _wire_format.UnpackTag(tag) if field_num == 1 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_logs(log_group, buffer, pos, end) elif field_num == 2 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_source(log_group, buffer, pos, end) elif field_num == 3 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_log_tags(log_group, buffer, pos, end) # 补充:解析log_tags elif field_num == 4 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_filename(log_group, buffer, pos, end) # 补充:解析filename elif field_num == 5 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_context_flow(log_group, buffer, pos, end) # 补充:解析context_flow else: pos = _decoder.SkipField(buffer, pos, end, tag_bytes) # pylint: disable=no-member return pos def _parse_logs(log_group, buffer, pos, end): """原代码逻辑不变""" size, pos = _decoder._DecodeVarint(buffer, pos) log_end = pos + size if log_end > end: raise _message.DecodeError("Truncated LogGroup.logs") log = log_pb2.Log() ParseLogFromString(log, buffer[pos:log_end].tobytes()) log_group.logs.append(log) return log_end def _parse_source(log_group, buffer, pos, end): """原代码逻辑不变""" size, pos = _decoder._DecodeVarint(buffer, pos) new_pos = pos + size if new_pos > end: raise _message.DecodeError("Truncated LogGroup.source") log_group.source = buffer[pos:new_pos].tobytes().decode('utf-8') return new_pos def _parse_log_tags(log_group, buffer, pos, end): """补充:解析log_tags字段(参考_parse_logs逻辑)""" size, pos = _decoder._DecodeVarint(buffer, pos) tag_end = pos + size if tag_end > end: raise _message.DecodeError("Truncated LogGroup.log_tags") tag = log_pb2.LogTag() ParseLogTagFromString(tag, buffer[pos:tag_end].tobytes()) log_group.log_tags.append(tag) return tag_end def _parse_filename(log_group, buffer, pos, end): """补充:解析filename字段(参考_parse_source逻辑)""" size, pos = _decoder._DecodeVarint(buffer, pos) new_pos = pos + size if new_pos > end: raise _message.DecodeError("Truncated LogGroup.filename") log_group.filename = buffer[pos:new_pos].tobytes().decode('utf-8') return new_pos def _parse_context_flow(log_group, buffer, pos, end): """补充:解析context_flow字段(参考_parse_source逻辑)""" size, pos = _decoder._DecodeVarint(buffer, pos) new_pos = pos + size if new_pos > end: raise _message.DecodeError("Truncated LogGroup.context_flow") log_group.context_flow = buffer[pos:new_pos].tobytes().decode('utf-8') return new_pos def ParseLogTagFromString(log_tag, serialized_data): """反序列化:解析字段1(key)和字段2(value)""" buffer = memoryview(serialized_data) pos = 0 end = len(buffer) log_tag.Clear() while pos < end: tag_bytes, pos = _decoder.ReadTag(buffer, pos) tag = _decoder._DecodeVarint(tag_bytes, 0)[0] field_num, wire_type = _wire_format.UnpackTag(tag) if field_num == 1 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_key(log_tag, buffer, pos, end) elif field_num == 2 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_value(log_tag, buffer, pos, end) else: pos = _decoder.SkipField(buffer, pos, end, tag_bytes) # pylint: disable=no-member return pos def _parse_key(item, buffer, pos, end): size, pos = _decoder._DecodeVarint(buffer, pos) new_pos = pos + size if new_pos > end: raise _message.DecodeError("Truncated LogTag.key") item.key = buffer[pos:new_pos].tobytes().decode('utf-8', errors='replace') return new_pos def _parse_value(item, buffer, pos, end): size, pos = _decoder._DecodeVarint(buffer, pos) new_pos = pos + size if new_pos > end: raise _message.DecodeError("Truncated LogTag.value") raw_bytes = buffer[pos:new_pos].tobytes() item.value = raw_bytes.decode('utf-8', errors='replace') return new_pos def ParseLogFromString(log, serialized_data): buffer = memoryview(serialized_data) pos = 0 end = len(buffer) log.Clear() while pos < end: tag_bytes, pos = _decoder.ReadTag(buffer, pos) tag = _decoder._DecodeVarint(tag_bytes, 0)[0] field_num, wire_type = _wire_format.UnpackTag(tag) if field_num == 1 and wire_type == _wire_format.WIRETYPE_VARINT: pos = _parse_time(log, buffer, pos, end) elif field_num == 2 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_contents(log, buffer, pos, end) else: pos = _decoder.SkipField(buffer, pos, end, tag_bytes) # pylint: disable=no-member return pos def _parse_time(log, buffer, pos, end): value, pos = _decoder._DecodeSignedVarint32(buffer, pos) log.time = value return pos def _parse_contents(log, buffer, pos, end): size, pos = _decoder._DecodeVarint(buffer, pos) content_end = pos + size if content_end > end: raise _message.DecodeError("Truncated Log.contents") content = log_pb2.LogContent() ParseLogContentFromString(content, buffer[pos:content_end].tobytes()) log.contents.append(content) return content_end def ParseLogContentFromString(content, serialized_data): buffer = memoryview(serialized_data) pos = 0 end = len(buffer) content.Clear() while pos < end: tag_bytes, pos = _decoder.ReadTag(buffer, pos) tag = _decoder._DecodeVarint(tag_bytes, 0)[0] field_num, wire_type = _wire_format.UnpackTag(tag) if field_num == 1 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_key(content, buffer, pos, end) elif field_num == 2 and wire_type == _wire_format.WIRETYPE_LENGTH_DELIMITED: pos = _parse_value(content, buffer, pos, end) else: pos = _decoder.SkipField(buffer, pos, end, tag_bytes) # pylint: disable=no-member return pos ================================================ FILE: volcengine/tls/log_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: log.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tlog.proto\x12\x02pb\"(\n\nLogContent\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"5\n\x03Log\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12 \n\x08\x63ontents\x18\x02 \x03(\x0b\x32\x0e.pb.LogContent\"$\n\x06LogTag\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"w\n\x08LogGroup\x12\x15\n\x04logs\x18\x01 \x03(\x0b\x32\x07.pb.Log\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\x1c\n\x08log_tags\x18\x03 \x03(\x0b\x32\n.pb.LogTag\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x14\n\x0c\x63ontext_flow\x18\x05 \x01(\t\"0\n\x0cLogGroupList\x12 \n\nlog_groups\x18\x01 \x03(\x0b\x32\x0c.pb.LogGroupb\x06proto3') _LOGCONTENT = DESCRIPTOR.message_types_by_name['LogContent'] _LOG = DESCRIPTOR.message_types_by_name['Log'] _LOGTAG = DESCRIPTOR.message_types_by_name['LogTag'] _LOGGROUP = DESCRIPTOR.message_types_by_name['LogGroup'] _LOGGROUPLIST = DESCRIPTOR.message_types_by_name['LogGroupList'] LogContent = _reflection.GeneratedProtocolMessageType('LogContent', (_message.Message,), { 'DESCRIPTOR' : _LOGCONTENT, '__module__' : 'log_pb2' # @@protoc_insertion_point(class_scope:pb.LogContent) }) _sym_db.RegisterMessage(LogContent) Log = _reflection.GeneratedProtocolMessageType('Log', (_message.Message,), { 'DESCRIPTOR' : _LOG, '__module__' : 'log_pb2' # @@protoc_insertion_point(class_scope:pb.Log) }) _sym_db.RegisterMessage(Log) LogTag = _reflection.GeneratedProtocolMessageType('LogTag', (_message.Message,), { 'DESCRIPTOR' : _LOGTAG, '__module__' : 'log_pb2' # @@protoc_insertion_point(class_scope:pb.LogTag) }) _sym_db.RegisterMessage(LogTag) LogGroup = _reflection.GeneratedProtocolMessageType('LogGroup', (_message.Message,), { 'DESCRIPTOR' : _LOGGROUP, '__module__' : 'log_pb2' # @@protoc_insertion_point(class_scope:pb.LogGroup) }) _sym_db.RegisterMessage(LogGroup) LogGroupList = _reflection.GeneratedProtocolMessageType('LogGroupList', (_message.Message,), { 'DESCRIPTOR' : _LOGGROUPLIST, '__module__' : 'log_pb2' # @@protoc_insertion_point(class_scope:pb.LogGroupList) }) _sym_db.RegisterMessage(LogGroupList) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None _LOGCONTENT._serialized_start=17 _LOGCONTENT._serialized_end=57 _LOG._serialized_start=59 _LOG._serialized_end=112 _LOGTAG._serialized_start=114 _LOGTAG._serialized_end=150 _LOGGROUP._serialized_start=152 _LOGGROUP._serialized_end=271 _LOGGROUPLIST._serialized_start=273 _LOGGROUPLIST._serialized_end=321 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/tls/producer/__init__.py ================================================ ================================================ FILE: volcengine/tls/producer/batch_manager.py ================================================ import threading from volcengine.tls.producer.producer_model import ProducerConfig, BatchLog from volcengine.tls.producer.send_batch_task import SendBatchTask class BatchManager: """批次管理器,用于管理批次的发送和生命周期""" def __init__(self): self.batch_log = None self.lock = threading.Lock() def full_and_send_batch_request(self) -> bool: if self.batch_log is not None: return self.batch_log.full_and_send_batch_request() return False def add_now(self, config: ProducerConfig, executor_service, client, memory_lock, retry_queue) -> None: if self.batch_log is not None: task = SendBatchTask( self.batch_log, config, memory_lock, client, retry_queue) executor_service.submit(task.run) self.batch_log = None def remove_batch(self, batch_logs: ['BatchLog']) -> None: if self.batch_log is not None: batch_logs.append(self.batch_log) self.batch_log = None ================================================ FILE: volcengine/tls/producer/batch_semaphore.py ================================================ import threading import time class BatchSemaphore: """支持一次性申请多个配额的信号量""" def __init__(self, value=1): if value < 0: raise ValueError("Semaphore initial value must be >= 0") self._value = value self._lock = threading.Condition() def acquire(self, permits=1, blocking=True, timeout=None): """申请一个或多个配额""" if permits < 1: raise ValueError("Permits must be positive") with self._lock: # 非阻塞模式立即返回 if not blocking: if self._value < permits: return False else: self._value -= permits return True # 处理超时 endtime = None if timeout is not None: endtime = time.time() + timeout # 等待直到有足够的配额 while self._value < permits: if timeout is not None: remaining = endtime - time.time() if remaining <= 0.0: return False self._lock.wait(remaining) else: self._lock.wait() # 获取配额 self._value -= permits return True def release(self, permits=1): """释放一个或多个配额""" if permits < 1: raise ValueError("Permits must be positive") with self._lock: self._value += permits self._lock.notify_all() # 通知所有等待的线程 def available_permits(self): """返回当前可用的配额数量""" with self._lock: return self._value def try_acquire(self, permits=1): """尝试获取配额,不阻塞立即返回""" return self.acquire(permits, blocking=False) ================================================ FILE: volcengine/tls/producer/log_dispatcher.py ================================================ import threading import time from concurrent.futures import ThreadPoolExecutor from typing import Dict from volcengine.tls.TLSService import TLSService from volcengine.tls.log_pb2 import LogGroup, LogGroupList from volcengine.tls.producer.batch_manager import BatchManager from volcengine.tls.producer.batch_semaphore import BatchSemaphore from volcengine.tls.producer.producer_model import ProducerConfig, BatchLog, CallBack from volcengine.tls.producer.retry_queue import RetryQueue from volcengine.tls.tls_exception import TLSException from volcengine.tls.util import get_logger class LogDispatcher: TLS_THREAD_POOL_FORMAT = "dispatcher-thread-%d" def __init__(self, producer_config: ProducerConfig, producer_name: str, memory_lock: BatchSemaphore, retry_queue: RetryQueue): self.producer_config = producer_config self.producer_name = producer_name self.memory_lock = memory_lock self.retry_queue = retry_queue self.closed = False # 初始化批次映射(用普通dict配合锁实现线程安全) self.batches: Dict[BatchLog.BatchKey, BatchManager] = {} self.batches_mutex = threading.Lock() # 初始化线程池 self.executor_service = self._create_thread_pool() self.LOG = get_logger(__name__) # 初始化TLS客户端 try: client_config = self.producer_config.client_config self.client = TLSService(client_config.endpoint, client_config.access_key_id, client_config.access_key_secret, client_config.region, client_config.token, api_key=client_config.api_key) except Exception as e: self.LOG.error("Failed to create TLS client", exc_info=e) raise TLSException(error_code="Initialization Error", error_message="Failed to create TLS client") def _create_thread_pool(self) -> ThreadPoolExecutor: """创建线程池""" thread_count = self.producer_config.max_thread_count thread_name_prefix = f"{self.producer_name}-dispatcher-thread-" # 创建线程池 return ThreadPoolExecutor( max_workers=thread_count, thread_name_prefix=thread_name_prefix ) def start(self) -> None: self.closed = False self.LOG.info(f"log dispatcher {self.producer_name} started and client init success") def close(self) -> None: self.LOG.info(f"log dispatcher {self.producer_name} closed") self.closed = True def close_now(self) -> None: self.LOG.info(f"log dispatcher {self.producer_name} close now") self.closed = True self.executor_service.shutdown(False) def get_or_create_batch_manager(self, batch_key: BatchLog.BatchKey) -> BatchManager: """获取或创建批次管理器,线程安全实现""" with self.batches_mutex: # 先检查是否已存在 batch_manager = self.batches.get(batch_key) if batch_manager is not None: return batch_manager # 不存在则创建新的并添加 batch_manager = BatchManager() # 检查是否有其他线程已添加(双重检查) existing = self.batches.get(batch_key) if existing is not None: return existing self.batches[batch_key] = batch_manager return batch_manager def reset_access_key_token(self, access_key: str, secret_key: str, security_token: str) -> None: """重置访问密钥信息""" client_config = self.producer_config.client_config client_config.reset_access_key_token(access_key, secret_key, security_token) self.client.reset_access_key_token(access_key, secret_key, security_token) self.LOG.info(f"log dispatcher {self.producer_name} update client config {client_config} success") def reset_api_key(self, api_key: str) -> None: client_config = self.producer_config.client_config client_config.reset_api_key(api_key) self.client.reset_api_key(api_key) self.LOG.info(f"log dispatcher {self.producer_name} update client config {client_config} success") def add_batch(self, hash_key: str, topic_id: str, source: str, filename: str, log_group: LogGroup, callback: CallBack) -> None: """添加批次日志的公开接口""" try: self.do_add(hash_key, topic_id, source, filename, log_group, callback) except Exception as e: raise TLSException(error_code="AddBatch Error", error_message=str(e)) def do_add(self, hash_key: str, topic_id: str, source: str, filename: str, log_group: LogGroup, callback: CallBack) -> None: """添加批次日志的内部实现""" # 检查是否已关闭 if self.closed: raise TLSException(error_code="AddBatch Error", error_message="closed LogDispatcher cannot receive logs anymore") log_count = 0 earliest_log_time = None latest_log_time = None for log in log_group.logs: if log.time <= 0: now_ns = time.time_ns() log.time = int(now_ns // 1_000_000) if self.producer_config.enable_nanosecond and hasattr(log, "TimeNs"): try: if not log.HasField("TimeNs"): log.TimeNs = int(now_ns % 1_000_000) except ValueError: log.TimeNs = int(now_ns % 1_000_000) log_count += 1 normalized_time = log.time if log.time < 1e10: normalized_time = log.time * 1000 elif log.time < 1e15: normalized_time = log.time else: normalized_time = log.time // int(1e6) if earliest_log_time is None or normalized_time < earliest_log_time: earliest_log_time = normalized_time if latest_log_time is None or normalized_time > latest_log_time: latest_log_time = normalized_time # 计算批次大小 def _varint_len(x: int) -> int: if x < 0: return 10 n = 1 while x >= (1 << 7): n += 1 x >>= 7 return n def _tag_len(field_number: int) -> int: return _varint_len((field_number << 3) | 2) group_size = log_group.ByteSize() log_group_list_groups_field_number = LogGroupList.DESCRIPTOR.fields_by_name["log_groups"].number batch_size = _tag_len(log_group_list_groups_field_number) + _varint_len(group_size) + group_size self.producer_config.check_batch_size(batch_size) # 获取内存锁 max_block_ms = self.producer_config.max_block_ms self.LOG.debug(f"dispatcher {self.producer_name} try acquire memory lock") if max_block_ms == 0: self.memory_lock.acquire(batch_size) else: # 尝试在指定时间内获取锁 acquired = self.memory_lock.acquire( batch_size, timeout=max_block_ms / 1000 # 转换为秒 ) if not acquired: available = self.memory_lock.available_permits() # 获取当前可用许可数 self.LOG.warn( f"Failed to acquire memory within the configured max blocking time {max_block_ms} ms, " f"requiredSizeInBytes={batch_size}, availableSizeInBytes={available}" ) raise TLSException( error_code="AddBatch Error", error_message=f"dispatcher {self.producer_name} try acquire memory lock failed" ) # 添加到批次 try: batch_key = BatchLog.BatchKey(hash_key, topic_id, source, filename) batch_manager = self.get_or_create_batch_manager(batch_key) # 同步操作 with batch_manager.lock: self.add_to_batch_manager(batch_key, log_group, callback, batch_size, batch_manager, log_count, earliest_log_time, latest_log_time) except Exception as e: # 发生异常时释放内存锁 self.memory_lock.release(batch_size) raise TLSException(error_code="Add Batch Error", error_message="dispatcher add batch concurrent error") def add_to_batch_manager(self, batch_key: BatchLog.BatchKey, log_group: LogGroup, callback: CallBack, batch_size: int, batch_manager: BatchManager, log_count: int, earliest_log_time: int, latest_log_time: int) -> None: """将日志添加到批次管理器""" # 尝试添加到现有批次 batch_log = batch_manager.batch_log if batch_log is not None: success = batch_log.try_add(log_group, batch_size, callback, log_count, earliest_log_time, latest_log_time) if success: # 检查是否已满需要发送 if batch_manager.full_and_send_batch_request(): batch_manager.add_now( self.producer_config, self.executor_service, self.client, self.memory_lock, self.retry_queue ) return else: # 现有批次已满,立即发送 batch_manager.add_now( self.producer_config, self.executor_service, self.client, self.memory_lock, self.retry_queue ) # 创建新批次并添加 batch_log = BatchLog(batch_key, self.producer_config) batch_manager.batch_log = batch_log success = batch_log.try_add(log_group, batch_size, callback, log_count, earliest_log_time, latest_log_time) if not success: self.LOG.error( f"tryAdd batchLog failed, batchKey = {str(batch_key)}, batchSize = {batch_size}, " f"batchCount = {log_group.get_logs_count()}" ) raise TLSException(error_code="Producer Error", error_message="tryAdd batchLog failed") # 检查新批次是否已满需要发送 if batch_manager.full_and_send_batch_request(): batch_manager.add_now( self.producer_config, self.executor_service, self.client, self.memory_lock, self.retry_queue ) ================================================ FILE: volcengine/tls/producer/mover.py ================================================ import threading import time from typing import List from volcengine.tls.producer.log_dispatcher import LogDispatcher from volcengine.tls.producer.producer_model import ProducerConfig, BatchLog from volcengine.tls.producer.retry_queue import RetryQueue from volcengine.tls.producer.send_batch_task import SendBatchTask from volcengine.tls.util import get_logger class Mover(threading.Thread): def __init__(self, name: str, producer_config: ProducerConfig, dispatcher: LogDispatcher, retry_manager: RetryQueue): super().__init__(name=name) self.name = name self.producer_config = producer_config self.retry_queue = retry_manager self.executor_service = dispatcher.executor_service self.client = dispatcher.client self.batches = dispatcher.batches self.batches_mutex = dispatcher.batches_mutex self.memory_lock = dispatcher.memory_lock self.closed = False self.LOG = get_logger(__name__) def run(self) -> None: """线程主执行方法""" self.handle_timeout() # 处理剩余的重试批次 self.handle_remaining_batch() remaining_retry_batches = self.retry_queue.get_retry_batch(True) for log in remaining_retry_batches: self.executor_service.submit( SendBatchTask( log, self.producer_config, self.memory_lock, self.client, self.retry_queue ).run() ) self.LOG.info(f"Mover {self.name} has stopped") def handle_timeout(self) -> None: """处理超时批次的循环""" while not self.closed: try: self.handle_timeout_batch() self.handle_retry_batch() time.sleep(1) except Exception as e: self.LOG.error(f"Mover {self.name} error in handle_timeout: {str(e)}") def handle_retry_batch(self) -> None: """处理需要重试的批次""" batch_logs = self.retry_queue.get_retry_batch(False) for log in batch_logs: self.executor_service.submit( SendBatchTask( log, self.producer_config, self.memory_lock, self.client, self.retry_queue ).run() ) def handle_timeout_batch(self) -> int: """处理超时的批次并返回剩余时间""" self.LOG.debug(f"mover {self.name} handle timeout batch") now = int(time.time() * 1000) # 当前时间(毫秒) batch_logs: List[BatchLog] = [] remains = self.producer_config.linger_ms # 遍历所有批次检查超时 with self.batches_mutex: for entry in self.batches.values(): batch_manager = entry with batch_manager.lock: batch_log = batch_manager.batch_log if batch_log is None: continue # 计算剩余时间 cur_remains = self.producer_config.linger_ms + batch_log.create_ms - now if cur_remains <= 0: # 批次超时,加入处理列表并移除 batch_manager.remove_batch(batch_logs) else: # 更新最小剩余时间 remains = min(remains, cur_remains) # 提交所有超时批次的发送任务 for log in batch_logs: self.executor_service.submit( SendBatchTask(log, self.producer_config, self.memory_lock, self.client, self.retry_queue).run() ) return remains def handle_remaining_batch(self) -> None: """处理剩余的所有批次""" self.LOG.debug(f"mover {self.name} handle remaining batch") batch_logs: List[BatchLog] = [] # 遍历所有批次检查超时 with self.batches_mutex: for entry in self.batches.values(): batch_manager = entry with batch_manager.lock: # 同步处理 batch_log = batch_manager.batch_log if batch_log is None: continue batch_manager.remove_batch(batch_logs) # 提交所有剩余批次的发送任务 for log in batch_logs: self.executor_service.submit( SendBatchTask( log, self.producer_config, self.memory_lock, self.client, self.retry_queue ).run() ) def close(self) -> None: self.LOG.info(f"Mover {self.name} closed") self.closed = True ================================================ FILE: volcengine/tls/producer/producer.py ================================================ import threading import time from typing import Optional from volcengine.tls.log_pb2 import LogGroup, LogGroupList from volcengine.tls.producer.batch_semaphore import BatchSemaphore from volcengine.tls.producer.log_dispatcher import LogDispatcher from volcengine.tls.producer.mover import Mover from volcengine.tls.producer.producer_model import ProducerConfig, CallBack from volcengine.tls.producer.retry_queue import RetryQueue from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import PutLogsV2LogContent from volcengine.tls.util import get_logger class TLSProducer: """TLS Producer的实现类""" _instance_id = 0 _instance_id_lock = threading.Lock() def __init__(self, producer_config: ProducerConfig): producer_config.valid_config() self.producer_config = producer_config # 生成实例名称 with TLSProducer._instance_id_lock: TLSProducer._instance_id += 1 self.name = f"tls-{TLSProducer._instance_id}" self.memory_lock = BatchSemaphore(producer_config.total_size_in_bytes) # 初始化组件 self.retry_queue = RetryQueue() self.dispatcher = LogDispatcher(producer_config, self.name, self.memory_lock, self.retry_queue) self.mover = Mover(f"{self.name}-mover", producer_config, self.dispatcher, self.retry_queue) self.LOG = get_logger(__name__) @staticmethod def default_producer(endpoint: str, region: str, access_key: str, access_secret: str, token: Optional[str] = None, api_key: Optional[str] = None) -> 'TLSProducer': """创建默认的Producer实例""" config = ProducerConfig(endpoint, region, access_key, access_secret, token, api_key) return TLSProducer(config) def send_log_v2(self, hash_key: Optional[str], topic_id: str, source: Optional[str], filename: Optional[str], log: PutLogsV2LogContent, callback: Optional[CallBack]) -> None: """发送单条日志(新版本)""" self.send_logs_v2(hash_key, topic_id, source, filename, [log], callback) def send_logs_v2(self, hash_key: Optional[str], topic_id: str, source: Optional[str], filename: Optional[str], logs: [PutLogsV2LogContent], callback: Optional[CallBack]) -> None: """发送多条日志(新版本)""" # 检查参数 if not topic_id or not logs: raise TLSException(error_code="InvalidArgument", error_message=f"topic id: {topic_id}, log group: {logs}") max_log_group_count = ProducerConfig.MAX_LOG_GROUP_COUNT max_log_group_size = ProducerConfig.MAX_BATCH_SIZE def _varint_len(x: int) -> int: if x < 0: return 10 n = 1 while x >= (1 << 7): n += 1 x >>= 7 return n def _tag_len(field_number: int) -> int: return _varint_len((field_number << 3) | 2) log_groups_field_number = LogGroup.DESCRIPTOR.fields_by_name["logs"].number log_group_list_groups_field_number = LogGroupList.DESCRIPTOR.fields_by_name["log_groups"].number log_group = LogGroup() if source is not None: log_group.source = source if filename is not None: log_group.filename = filename base_group_size = log_group.ByteSize() current_estimated_group_size = base_group_size current_count = 0 for v in logs: new_log = getattr(log_group, "logs").add() new_log.time = v.time if v.time_ns is not None and hasattr(new_log, "TimeNs"): new_log.TimeNs = v.time_ns for key in v.log_dict.keys(): log_content = new_log.contents.add() log_content.key = str(key) log_content.value = str(v.log_dict[key]) current_count += 1 log_size = new_log.ByteSize() current_estimated_group_size += _tag_len(log_groups_field_number) + _varint_len(log_size) + log_size group_size = current_estimated_group_size entry_size = _tag_len(log_group_list_groups_field_number) + _varint_len(group_size) + group_size if entry_size > max_log_group_size: if current_count == 1: actual_group_size = log_group.ByteSize() actual_entry_size = _tag_len(log_group_list_groups_field_number) + _varint_len(actual_group_size) + actual_group_size raise TLSException( error_code="InvalidArgument", error_message=f"log size {actual_entry_size} is larger than MAX_LOG_SIZE {max_log_group_size}" ) getattr(log_group, "logs").pop() current_count -= 1 current_estimated_group_size -= _tag_len(log_groups_field_number) + _varint_len(log_size) + log_size self.dispatcher.add_batch(hash_key, topic_id, source, filename, log_group, callback) log_group = LogGroup() if source is not None: log_group.source = source if filename is not None: log_group.filename = filename base_group_size = log_group.ByteSize() new_log = getattr(log_group, "logs").add() new_log.time = v.time if v.time_ns is not None and hasattr(new_log, "TimeNs"): new_log.TimeNs = v.time_ns for key in v.log_dict.keys(): log_content = new_log.contents.add() log_content.key = str(key) log_content.value = str(v.log_dict[key]) current_count = 1 current_estimated_group_size = base_group_size log_size = new_log.ByteSize() current_estimated_group_size += _tag_len(log_groups_field_number) + _varint_len(log_size) + log_size group_size = current_estimated_group_size entry_size = _tag_len(log_group_list_groups_field_number) + _varint_len(group_size) + group_size if entry_size > max_log_group_size: actual_group_size = log_group.ByteSize() actual_entry_size = _tag_len(log_group_list_groups_field_number) + _varint_len(actual_group_size) + actual_group_size raise TLSException( error_code="InvalidArgument", error_message=f"log size {actual_entry_size} is larger than MAX_LOG_SIZE {max_log_group_size}" ) if current_count >= max_log_group_count: self.dispatcher.add_batch(hash_key, topic_id, source, filename, log_group, callback) log_group = LogGroup() if source is not None: log_group.source = source if filename is not None: log_group.filename = filename current_count = 0 base_group_size = log_group.ByteSize() current_estimated_group_size = base_group_size if current_count > 0: self.dispatcher.add_batch(hash_key, topic_id, source, filename, log_group, callback) def reset_access_key_token(self, access_key: str, secret_key: str, security_token: Optional[str]) -> None: """重置访问密钥和令牌""" if not access_key or not secret_key: raise TLSException( error_code="InvalidArgument", error_message=f"reset producer {self.name} access key failed, accessKey is {access_key}, " f"secretKey is {secret_key}, token is {security_token}" ) self.dispatcher.reset_access_key_token(access_key, secret_key, security_token) def reset_api_key(self, api_key: str) -> None: self.dispatcher.reset_api_key(api_key) def start(self) -> None: """启动Producer""" self.dispatcher.start() self.mover.start() self.LOG.info(f"producer {self.name} started") def close(self, timeout_ms: int = 30000) -> None: """关闭Producer""" feedback_exception = None try: timeout_ms = self._close_mover(timeout_ms) except TLSException as e: feedback_exception = e try: timeout_ms = self._close_executor_service(timeout_ms) except TLSException as e: if feedback_exception is None: feedback_exception = e if feedback_exception: raise feedback_exception self.LOG.info(f"producer {self.name} closed") def _close_mover(self, timeout_ms: int) -> int: start_ms = time.time() * 1000 self.dispatcher.close() self.retry_queue.closed = True self.mover.close() self.mover.join(timeout_ms / 1000) # 转换为秒 if self.mover.is_alive(): self.LOG.warning("producer mover thread is still alive") raise TLSException(error_code="ProducerError", error_message="producer mover thread is still alive") self.LOG.info("producer mover is closed") now_ms = time.time() * 1000 return max(0, int(timeout_ms - (now_ms - start_ms))) def _close_executor_service(self, timeout_ms: int) -> int: start_ms = time.time() * 1000 executor_service = self.dispatcher.executor_service if executor_service: executor_service.shutdown() self.LOG.info("producer executor service is closed") now_ms = time.time() * 1000 return max(0, int(timeout_ms - (now_ms - start_ms))) ================================================ FILE: volcengine/tls/producer/producer_model.py ================================================ import random import sys import time from typing import Optional, List from volcengine.tls.log_pb2 import LogGroupList, LogGroup from volcengine.tls.tls_exception import TLSException from volcengine.tls.util import get_logger class ClientConfig: """客户端配置类""" def __init__(self, endpoint: str, region: str, access_key: str, access_secret: str, token: Optional[str] = None, api_key: Optional[str] = None): self.endpoint = endpoint self.region = region self.access_key_id = access_key self.access_key_secret = access_secret self.token = token self.api_key = api_key def __str__(self) -> str: return (f"ClientConfig(endpoint={self.endpoint}, region={self.region}, " f"access_key_id={'***' if self.access_key_id else None}, " f"access_key_secret={'***' if self.access_key_secret else None}, " f"token={'***' if self.token else None}, " f"api_key={'***' if self.api_key else None})") def reset_api_key(self, api_key: str) -> None: self.api_key = api_key def _valid_number(field: int, min_val: int, max_val: int, default_val: int) -> int: """验证数字是否在有效范围内,否则返回默认值""" try: field_val = int(field) min_val = int(min_val) max_val = int(max_val) default_val = int(default_val) if field_val < min_val or field_val > max_val: return default_val return field_val except (ValueError, TypeError): return default_val class CallBack: """回调基类""" def on_complete(self, result: 'Result'): """请求完成回调""" raise NotImplementedError("Please implement the on_completion method.") class Attempt: def __init__(self, success: bool, request_id: str = "", error_code: str = "", error_message: str = "", http_code: int = -1): self.success = success self.request_id = request_id self.error_code = error_code self.error_message = error_message self.http_code = http_code class Result: def __init__(self, success: bool, attempts: List['Attempt'], attempt_count: int): self.success = success self.attempts = attempts self.attempt_count = attempt_count class ProducerConfig: """日志生产者配置类""" # 静态常量定义 DEFAULT_TOTAL_SIZE_IN_BYTES = 100 * 1024 * 1024 # 100MB DEFAULT_MAX_THREAD_COUNT = 50 DEFAULT_MAX_BATCH_SIZE = 512 * 1024 # 512KB MAX_BATCH_SIZE = 9 * 1024 * 1024 + 512 * 1024 DEFAULT_MAX_BATCH_COUNT = 4096 MAX_BATCH_COUNT = 32768 MAX_LOG_GROUP_COUNT = 10000 DEFAULT_LINGER_MS = 2000 # 2秒 TOO_MANY_REQUEST_ERROR = 429 EXTERNAL_ERROR = 500 MIN_WAIT_MS = 100 DEFAULT_RETRY_COUNT = 4 DEFAULT_RESERVED_ATTEMPTS = DEFAULT_RETRY_COUNT + 1 MAX_RETRY_COUNT = 10 MAX_RESERVED_ATTEMPTS = MAX_RETRY_COUNT + 1 MAX_THREAD_COUNT = 10 DEFAULT_BLOCK_MS = 60 * 1000 # 60秒 def __init__(self, endpoint: str, region: str, access_key: str, access_secret: str, token: Optional[str] = None, api_key: Optional[str] = None): """初始化生产者配置""" self.total_size_in_bytes = self.DEFAULT_TOTAL_SIZE_IN_BYTES self.max_thread_count = self.MAX_THREAD_COUNT self.max_batch_size_bytes = self.DEFAULT_MAX_BATCH_SIZE self.max_batch_count = self.DEFAULT_MAX_BATCH_COUNT self.linger_ms = self.DEFAULT_LINGER_MS self.max_block_ms = self.DEFAULT_BLOCK_MS self.retry_count = self.DEFAULT_RETRY_COUNT self.max_reserved_attempts = self.DEFAULT_RESERVED_ATTEMPTS self.enable_nanosecond = False self.client_config = ClientConfig(endpoint, region, access_key, access_secret, token, api_key) def __str__(self) -> str: return (f"ProducerConfig(total_size_in_bytes={self.total_size_in_bytes}, " f"max_thread_count={self.max_thread_count}, " f"max_batch_size_bytes={self.max_batch_size_bytes}, " f"max_batch_count={self.max_batch_count}, " f"linger_ms={self.linger_ms}, " f"max_block_ms={self.max_block_ms}, " f"retry_count={self.retry_count}, " f"max_reserved_attempts={self.max_reserved_attempts}, " f"enable_nanosecond={self.enable_nanosecond}, " f"client_config={self.client_config})") def valid_config(self) -> None: """验证并修正配置参数""" self.total_size_in_bytes = _valid_number( self.total_size_in_bytes, 1, sys.maxsize, self.DEFAULT_TOTAL_SIZE_IN_BYTES ) self.max_thread_count = _valid_number( self.max_thread_count, 1, self.MAX_THREAD_COUNT, self.MAX_THREAD_COUNT ) self.max_batch_size_bytes = _valid_number( self.max_batch_size_bytes, 1, self.MAX_BATCH_SIZE, self.DEFAULT_MAX_BATCH_SIZE ) self.max_batch_count = _valid_number( self.max_batch_count, 1, self.MAX_BATCH_COUNT, self.DEFAULT_MAX_BATCH_COUNT ) self.linger_ms = _valid_number( self.linger_ms, self.MIN_WAIT_MS, sys.maxsize, self.DEFAULT_LINGER_MS ) self.max_block_ms = _valid_number( self.max_block_ms, 0, sys.maxsize, self.DEFAULT_BLOCK_MS ) self.retry_count = _valid_number( self.retry_count, 1, self.MAX_RETRY_COUNT, self.DEFAULT_RETRY_COUNT ) self.max_reserved_attempts = _valid_number( self.max_reserved_attempts, 2, self.MAX_RESERVED_ATTEMPTS, self.DEFAULT_RESERVED_ATTEMPTS ) # 验证客户端配置 if (not self.client_config or not self.client_config.endpoint or not self.client_config.region or not (self.client_config.api_key or (self.client_config.access_key_id and self.client_config.access_key_secret))): raise TLSException(error_code="InvalidArgument", error_message=str(self.client_config)) def set_total_size_in_bytes(self, total_size_in_bytes: int) -> None: if total_size_in_bytes <= 0: raise TLSException( error_code="InvalidArgument", error_message=f"totalSizeInBytes must be greater than zero, actual: {total_size_in_bytes}" ) self.total_size_in_bytes = total_size_in_bytes def set_max_thread_count(self, max_thread_count: int) -> None: if max_thread_count <= 0 or max_thread_count > self.MAX_THREAD_COUNT: raise TLSException( error_code="InvalidArgument", error_message=f"maxThreadCount must be between 1 to {self.MAX_THREAD_COUNT}, actual: {max_thread_count}" ) self.max_thread_count = max_thread_count def set_max_batch_size_bytes(self, max_batch_size_bytes: int) -> None: if max_batch_size_bytes <= 0 or max_batch_size_bytes > self.MAX_BATCH_SIZE: raise TLSException( error_code="InvalidArgument", error_message=f"maxBatchSizeBytes must be between 1 to {self.MAX_BATCH_SIZE}, actual: {max_batch_size_bytes}" ) self.max_batch_size_bytes = max_batch_size_bytes def set_max_batch_count(self, max_batch_count: int) -> None: if max_batch_count <= 0 or max_batch_count > self.MAX_BATCH_COUNT: raise TLSException( error_code="InvalidArgument", error_message=f"maxBatchCount must be between 1 to {self.MAX_BATCH_COUNT}, actual: {max_batch_count}" ) self.max_batch_count = max_batch_count def set_linger_ms(self, linger_ms: int) -> None: if linger_ms < self.MIN_WAIT_MS: raise TLSException( error_code="InvalidArgument", error_message=f"lingerMs must be greater than {self.MIN_WAIT_MS}, actual: {linger_ms}" ) self.linger_ms = linger_ms def set_retry_count(self, retry_count: int) -> None: if retry_count <= 0 or retry_count > self.MAX_RETRY_COUNT: raise TLSException( error_code="InvalidArgument", error_message=f"retryCount must be between 1 to {self.MAX_RETRY_COUNT}, actual: {retry_count}" ) self.retry_count = retry_count def set_max_reserved_attempts(self, max_reserved_attempts: int) -> None: if max_reserved_attempts < 2 or max_reserved_attempts > self.MAX_RESERVED_ATTEMPTS: raise TLSException( error_code="InvalidArgument", error_message=f"maxReservedAttempts must be between 2 to {self.MAX_RESERVED_ATTEMPTS}, actual: {max_reserved_attempts}" ) self.max_reserved_attempts = max_reserved_attempts def set_client_config(self, client_config: ClientConfig) -> None: if (not client_config or not client_config.endpoint or not client_config.region or not (client_config.api_key or (client_config.access_key_id and client_config.access_key_secret))): raise TLSException( error_code="InvalidArgument", error_message=str(client_config) ) self.client_config = client_config def set_max_block_ms(self, max_block_ms: int) -> None: if max_block_ms <= 0: raise TLSException( error_code="InvalidArgument", error_message=f"maxBlockMs must be greater than zero, actual: {max_block_ms}" ) self.max_block_ms = max_block_ms def check_batch_size(self, batch_size: int) -> None: if batch_size > self.MAX_BATCH_SIZE: raise TLSException( error_code="InvalidArgument", error_message=f"log batch size {batch_size} is larger than MAX_BATCH_SIZE {self.MAX_BATCH_SIZE}" ) if batch_size > self.total_size_in_bytes: raise TLSException( error_code="InvalidArgument", error_message=f"log batch size {batch_size} is larger than total_size_in_bytes {self.total_size_in_bytes}" ) @classmethod def need_retry(cls, http_code): return http_code == cls.TOO_MANY_REQUEST_ERROR or http_code >= cls.EXTERNAL_ERROR or http_code == 0 class BatchLog: def __init__(self, batch_key: 'BatchLog.BatchKey', producer_config: ProducerConfig): self.batch_key = batch_key self.current_batch_size = 0 self.current_batch_count = 0 self.earliest_log_time = None self.latest_log_time = None self.call_back_list = [] self.log_group_list = LogGroupList() self.producer_config = producer_config self.reserved_attempts = [] self.attempt_count = 0 self.create_ms = time.time() * 1000 # 转换为毫秒 self.next_retry_ms = 0 self.retry_backoff_ms = 0 self.max_retry_backoff_ms = 10 * 1000 # 10秒 self.base_retry_backoff_ms = 1000 # 1秒 self.base_increase_backoff_ms = 1000 # 1秒 self.LOG = get_logger(__name__) def try_add(self, log_group: LogGroup, batch_size: int, call_back: Optional[CallBack], log_count: Optional[int] = None, earliest_log_time: Optional[int] = None, latest_log_time: Optional[int] = None) -> bool: """尝试添加日志组到批次中""" current_batch_count = self.current_batch_count current_batch_size = self.current_batch_size if log_count is None: log_count = len(log_group.logs) for log in log_group.logs: normalized_time = log.time if log.time < 1e10: normalized_time = log.time * 1000 elif log.time < 1e15: normalized_time = log.time else: normalized_time = log.time // int(1e6) if earliest_log_time is None or normalized_time < earliest_log_time: earliest_log_time = normalized_time if latest_log_time is None or normalized_time > latest_log_time: latest_log_time = normalized_time # 检查是否超过阈值 if (log_count + current_batch_count > ProducerConfig.MAX_BATCH_COUNT or batch_size + current_batch_size > ProducerConfig.MAX_BATCH_SIZE): return False # 添加日志组 self.log_group_list.log_groups.append(log_group) # pylint: disable=no-member if call_back is not None: self.call_back_list.append(call_back) # 更新当前计数 self.current_batch_count = current_batch_count + log_count self.current_batch_size = current_batch_size + batch_size if log_count > 0 and earliest_log_time is not None and latest_log_time is not None: if self.earliest_log_time is None or earliest_log_time < self.earliest_log_time: self.earliest_log_time = earliest_log_time if self.latest_log_time is None or latest_log_time > self.latest_log_time: self.latest_log_time = latest_log_time return True def full_and_send_batch_request(self) -> bool: """检查批次是否已满,需要发送请求""" return (self.current_batch_count >= self.producer_config.max_batch_count or self.current_batch_size >= self.producer_config.max_batch_size_bytes) def add_attempt(self, attempt: Attempt) -> None: """添加尝试记录""" self.reserved_attempts.append(attempt) self.attempt_count += 1 def fire_callbacks(self) -> None: """触发所有回调函数""" if len(self.reserved_attempts) == 0: self.LOG.error(f"batch log {self.batch_key} fire call back failed ") return attempt = self.reserved_attempts[-1] # 取最后一个尝试结果 result = Result(attempt.success, self.reserved_attempts, self.attempt_count) self._fire_callbacks(result) def handle_next_try(self) -> None: """处理下一次重试的退避时间""" if self.attempt_count == 1: self.retry_backoff_ms += self.base_retry_backoff_ms else: increase_backoff_ms = random.random() * self.base_increase_backoff_ms self.retry_backoff_ms += increase_backoff_ms self.retry_backoff_ms = min(self.retry_backoff_ms, self.max_retry_backoff_ms) self.next_retry_ms = time.time() * 1000 + self.retry_backoff_ms # 转换为毫秒 def _fire_callbacks(self, result: Result) -> None: """实际触发回调的私有方法""" for call_back in self.call_back_list: call_back.on_complete(result) def __lt__(self, other: 'BatchLog') -> bool: return self.next_retry_ms < other.next_retry_ms def __str__(self) -> str: return (f"BatchLog{{batchKey={self.batch_key}, currentBatchSize={self.current_batch_size}, " f"currentBatchCount={self.current_batch_count}, reservedAttempts={self.reserved_attempts}, " f"attemptCount={self.attempt_count}, createMs={self.create_ms}, nextRetryMs={self.next_retry_ms}, " f"retryBackoffMs={self.retry_backoff_ms}, maxRetryBackoffMs={self.max_retry_backoff_ms}, " f"baseRetryBackoffMs={self.base_retry_backoff_ms}, " f"baseIncreaseBackoffMs={self.base_increase_backoff_ms}}}") class BatchKey: """批次键,用于标识唯一批次""" def __init__(self, shard_hash: str, topic_id: str, source: str, file_name: str): self.shard_hash = shard_hash self.topic_id = topic_id self.source = source self.file_name = file_name def __eq__(self, other) -> bool: if not isinstance(other, BatchLog.BatchKey): return False return (self.shard_hash == other.shard_hash and self.topic_id == other.topic_id and self.source == other.source and self.file_name == other.file_name) def __hash__(self) -> int: return hash((self.shard_hash, self.topic_id, self.source, self.file_name)) def __str__(self) -> str: return (f"BatchKey{{shardHash={self.shard_hash}, topicId={self.topic_id}, " f"source={self.source}, fileName={self.file_name}}}") ================================================ FILE: volcengine/tls/producer/retry_queue.py ================================================ import heapq import time import threading from typing import List, Optional from volcengine.tls.producer.producer_model import BatchLog def get_time_ms(nano_seconds: int) -> int: """将纳秒转换为毫秒""" return nano_seconds // 1_000_000 class RetryQueue: def __init__(self): self.batch: List[BatchLog] = [] self.mutex = threading.Lock() self.closed = False # 初始化堆 heapq.heapify(self.batch) def add_to_retry_queue(self, batch: Optional[BatchLog]) -> None: """将批次添加到重试队列""" with self.mutex: if batch is not None: heapq.heappush(self.batch, batch) def get_retry_batch(self, stop_flag: bool) -> List[BatchLog]: """获取可以重试的批次列表""" producer_batch_list: List[BatchLog] = [] with self.mutex: if not stop_flag: # 非停止状态,只获取已到重试时间的批次 while self.__len__() > 0: # 查看堆顶元素但不弹出 peek_batch = self.batch[0] current_ms = get_time_ms(time.time_ns()) if peek_batch.next_retry_ms < current_ms: # 已到重试时间,弹出并加入结果列表 producer_batch = heapq.heappop(self.batch) producer_batch_list.append(producer_batch) else: # 未到重试时间,停止检查 break else: # 停止状态,获取所有批次 while self.__len__() > 0: producer_batch = heapq.heappop(self.batch) producer_batch_list.append(producer_batch) return producer_batch_list def __len__(self) -> int: """返回队列长度""" return len(self.batch) ================================================ FILE: volcengine/tls/producer/send_batch_task.py ================================================ from volcengine.tls.TLSService import TLSService from volcengine.tls.producer.batch_semaphore import BatchSemaphore from volcengine.tls.producer.producer_model import BatchLog, ProducerConfig, Attempt from volcengine.tls.producer.retry_queue import RetryQueue from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import PutLogsRequest from volcengine.tls.tls_responses import PutLogsResponse from volcengine.tls.util import get_logger # 常量定义 HTTP_STATUS_OK = 200 class SendBatchTask: def __init__(self, batch_log: BatchLog, producer_config: ProducerConfig, memory_lock: BatchSemaphore, client: TLSService, retry_queue: RetryQueue): self.LOG = get_logger(__name__) self.producer_config = producer_config self.memory_lock = memory_lock self.client = client self.retry_queue = retry_queue self.batch_log = batch_log def run(self) -> None: """线程执行入口,发送请求""" self.send_request() def send_request(self) -> None: """构建并发送日志请求""" batch_key = self.batch_log.batch_key put_logs_request = PutLogsRequest( batch_key.topic_id, self.batch_log.log_group_list, batch_key.shard_hash, log_count=self.batch_log.current_batch_count, earliest_log_time=self.batch_log.earliest_log_time, latest_log_time=self.batch_log.latest_log_time, enable_nanosecond=self.producer_config.enable_nanosecond, ) if not self.calibrate_batch_size(): return try: put_logs_response = self.client.put_logs(put_logs_request) except TLSException as e: self.handle_log_exception(e) return except Exception as e: self.handle_exception(e) return self.handle_success(put_logs_response) def calibrate_batch_size(self) -> bool: estimated = int(self.batch_log.current_batch_size) actual = int(self.batch_log.log_group_list.ByteSize()) delta = actual - estimated if delta > 0: max_block_ms = self.producer_config.max_block_ms if max_block_ms == 0: self.memory_lock.acquire(delta) else: acquired = self.memory_lock.acquire(delta, timeout=max_block_ms / 1000) if not acquired: self.handle_exception(Exception("buffer full when calibrating batch size")) return False elif delta < 0: self.memory_lock.release(-delta) self.batch_log.current_batch_size = actual return True def handle_failure(self) -> None: """处理失败日志""" self.LOG.info(f"send batch failed, batch: {self.batch_log}") self.batch_log.fire_callbacks() self.memory_lock.release(self.batch_log.current_batch_size) def need_retry(self, e: TLSException) -> bool: """判断是否需要重试""" return (ProducerConfig.need_retry(e.http_code) and self.batch_log.attempt_count <= self.producer_config.retry_count and not self.retry_queue.closed) def handle_log_exception(self, e: TLSException) -> None: """处理日志异常""" self.LOG.error(f"send batch failed, batch:{self.batch_log}", exc_info=e) # 创建失败尝试记录 fail_attempt = Attempt( success=False, request_id=e.request_id, error_code=e.error_code, error_message=e.error_message, http_code=e.http_code ) self.batch_log.add_attempt(fail_attempt) self.batch_log.handle_next_try() # 检查是否需要重试 if self.need_retry(e): try: self.retry_queue.add_to_retry_queue(self.batch_log) self.LOG.info(f"retry queue add batch success, batch: {self.batch_log}") return except TLSException as ex: self.LOG.warn("retry manager is closed and put batch log to failure queue", exc_info=ex) # 不需要重试或重试失败,处理失败日志 self.handle_failure() def handle_exception(self, e: Exception) -> None: """处理通用异常""" self.LOG.error(f"send batch failed, batch:{self.batch_log}", exc_info=e) # 创建失败尝试记录 fail_attempt = Attempt( success=False, error_code=e.__class__.__name__, error_message=str(e) ) self.batch_log.add_attempt(fail_attempt) self.handle_failure() def handle_success(self, put_logs_response: PutLogsResponse) -> None: """处理成功响应""" success_attempt = Attempt( success=True, request_id=put_logs_response.request_id, http_code=HTTP_STATUS_OK ) self.batch_log.add_attempt(success_attempt) self.batch_log.retry_backoff_ms = 0 self.batch_log.fire_callbacks() self.memory_lock.release(self.batch_log.current_batch_size) self.LOG.debug(f"send batch success, batch: {self.batch_log}") ================================================ FILE: volcengine/tls/retry_policy.py ================================================ import math import random RETRY_POLICY_TOTAL_TIMEOUT_MIN = 30 RETRY_POLICY_TOTAL_TIMEOUT_MAX = 15 * 60 RETRY_POLICY_INITIAL_INTERVAL_MIN = 0.1 RETRY_POLICY_INITIAL_INTERVAL_MAX = 30 RETRY_POLICY_MAX_INTERVAL_MIN = 1 RETRY_POLICY_MAX_INTERVAL_MAX = 60 RETRY_POLICY_MULTIPLIER_MIN = 1.0 RETRY_POLICY_MULTIPLIER_MAX = 3.0 RETRY_POLICY_RANDOMIZATION_MIN = 0.1 RETRY_POLICY_RANDOMIZATION_MAX = 1.0 RETRY_POLICY_MAX_ATTEMPTS_MIN = 0 RETRY_POLICY_MAX_ATTEMPTS_MAX = 50 DEFAULT_RETRY_RANDOMIZATION_FACTOR = 0.25 DEFAULT_RETRY_MULTIPLIER = 2.0 DEFAULT_RETRY_MAX_INTERVAL = 10 DEFAULT_RETRY_INTERVAL = 0.5 DEFAULT_RETRY_TIMEOUT = 90 class RetryPolicy(object): def __init__(self, total_timeout=None, initial_interval=None, max_interval=None, multiplier=None, randomization_factor=None, max_attempts=0): self.total_timeout = total_timeout self.initial_interval = initial_interval self.max_interval = max_interval self.multiplier = multiplier self.randomization_factor = randomization_factor self.max_attempts = max_attempts @staticmethod def default_policy(): return RetryPolicy( total_timeout=DEFAULT_RETRY_TIMEOUT, initial_interval=DEFAULT_RETRY_INTERVAL, max_interval=DEFAULT_RETRY_MAX_INTERVAL, multiplier=DEFAULT_RETRY_MULTIPLIER, randomization_factor=DEFAULT_RETRY_RANDOMIZATION_FACTOR, max_attempts=0, ) def normalize(self): total_timeout = self.total_timeout if total_timeout is None or total_timeout <= 0 or (isinstance(total_timeout, float) and math.isnan(total_timeout)): total_timeout = DEFAULT_RETRY_TIMEOUT if total_timeout < RETRY_POLICY_TOTAL_TIMEOUT_MIN: total_timeout = RETRY_POLICY_TOTAL_TIMEOUT_MIN if total_timeout > RETRY_POLICY_TOTAL_TIMEOUT_MAX: total_timeout = RETRY_POLICY_TOTAL_TIMEOUT_MAX initial_interval = self.initial_interval if initial_interval is None or initial_interval <= 0 or (isinstance(initial_interval, float) and math.isnan(initial_interval)): initial_interval = DEFAULT_RETRY_INTERVAL if initial_interval < RETRY_POLICY_INITIAL_INTERVAL_MIN: initial_interval = RETRY_POLICY_INITIAL_INTERVAL_MIN if initial_interval > RETRY_POLICY_INITIAL_INTERVAL_MAX: initial_interval = RETRY_POLICY_INITIAL_INTERVAL_MAX max_interval = self.max_interval if max_interval is None or max_interval <= 0 or (isinstance(max_interval, float) and math.isnan(max_interval)): max_interval = DEFAULT_RETRY_MAX_INTERVAL if max_interval < RETRY_POLICY_MAX_INTERVAL_MIN: max_interval = RETRY_POLICY_MAX_INTERVAL_MIN if max_interval > RETRY_POLICY_MAX_INTERVAL_MAX: max_interval = RETRY_POLICY_MAX_INTERVAL_MAX if max_interval < initial_interval: max_interval = initial_interval multiplier = self.multiplier if multiplier is None or multiplier <= 0 or (isinstance(multiplier, float) and math.isnan(multiplier)): multiplier = DEFAULT_RETRY_MULTIPLIER if multiplier < RETRY_POLICY_MULTIPLIER_MIN: multiplier = RETRY_POLICY_MULTIPLIER_MIN if multiplier > RETRY_POLICY_MULTIPLIER_MAX: multiplier = RETRY_POLICY_MULTIPLIER_MAX randomization_factor = self.randomization_factor if randomization_factor is None or randomization_factor < 0 or ( isinstance(randomization_factor, float) and math.isnan(randomization_factor)): randomization_factor = DEFAULT_RETRY_RANDOMIZATION_FACTOR if randomization_factor < RETRY_POLICY_RANDOMIZATION_MIN: randomization_factor = RETRY_POLICY_RANDOMIZATION_MIN if randomization_factor > RETRY_POLICY_RANDOMIZATION_MAX: randomization_factor = RETRY_POLICY_RANDOMIZATION_MAX max_attempts = self.max_attempts if max_attempts is None: max_attempts = RETRY_POLICY_MAX_ATTEMPTS_MIN if max_attempts < RETRY_POLICY_MAX_ATTEMPTS_MIN: max_attempts = RETRY_POLICY_MAX_ATTEMPTS_MIN if max_attempts > RETRY_POLICY_MAX_ATTEMPTS_MAX: max_attempts = RETRY_POLICY_MAX_ATTEMPTS_MAX return RetryPolicy( total_timeout=total_timeout, initial_interval=initial_interval, max_interval=max_interval, multiplier=multiplier, randomization_factor=randomization_factor, max_attempts=max_attempts, ) def backoff_seconds(self, attempt): interval = self.initial_interval * (self.multiplier ** max(attempt - 1, 0)) if interval > self.max_interval: interval = self.max_interval if self.randomization_factor > 0: delta = self.randomization_factor * interval interval = random.uniform(interval - delta, interval + delta) if interval < 0: interval = 0 return interval ================================================ FILE: volcengine/tls/test/api_key_anonymous_auth_unit_test.py ================================================ import unittest from unittest.mock import patch from volcengine.tls.TLSService import TLSService from volcengine.tls.const import CONTENT_TYPE, APPLICATION_JSON, DESCRIBE_PROJECT, X_TLS_REQUEST_ID, X_SECURITY_TOKEN from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.producer.batch_semaphore import BatchSemaphore from volcengine.tls.producer.log_dispatcher import LogDispatcher from volcengine.tls.producer.producer import TLSProducer from volcengine.tls.producer.producer_model import ProducerConfig from volcengine.tls.producer.retry_queue import RetryQueue from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import DeleteProjectRequest, PutLogsRequest, PutLogsV2Request, PutLogsV2Logs ANONYMOUS_HEADER = "x-tls-anonymous-identity" class _FakeResponse: status_code = 200 text = "" content = b"" headers = { CONTENT_TYPE: APPLICATION_JSON, X_TLS_REQUEST_ID: "request-id", } class _CaptureSession: def __init__(self): self.requests = [] def request(self, method, url, headers=None, data=None, timeout=None): self.requests.append({ "method": method, "url": url, "headers": dict(headers or {}), "data": data, "timeout": timeout, }) return _FakeResponse() class _FailingSession: def request(self, *args, **kwargs): raise AssertionError("network request should not be sent") def _make_put_logs_request(): log_group_list = LogGroupList() log_group = log_group_list.log_groups.add() # pylint: disable=no-member log = log_group.logs.add() log.time = 1 content = log.contents.add() content.key = "k" content.value = "v" return PutLogsRequest("topic-id", log_group_list, compression=None) def _make_put_logs_v2_request(): logs = PutLogsV2Logs() logs.add_log({"k": "v"}, log_time=1) return PutLogsV2Request("topic-id", logs, compression=None) class ApiKeyAnonymousAuthUnitTest(unittest.TestCase): def _service_with_api_key(self, api_key="api-key", access_key_id="", access_key_secret="", security_token=None): with patch("volcengine.base.Service.Service.init", lambda _self: None): if not hasattr(TLSService, "with_api_key"): self.fail("TLSService.with_api_key should exist") try: return TLSService.with_api_key( "tls.example.com", "cn-beijing", api_key, access_key_id=access_key_id, access_key_secret=access_key_secret, security_token=security_token, ) except TypeError as e: self.fail("TLSService.with_api_key should accept optional AK/SK/token: {}".format(e)) def _producer_config_with_api_key(self): try: return ProducerConfig("tls.example.com", "cn-beijing", "", "", api_key="api-key") except TypeError as e: self.fail("ProducerConfig.__init__ should accept api_key: {}".format(e)) def test_with_api_key_put_logs_uses_anonymous_header_without_signature(self): service = self._service_with_api_key() service.session = _CaptureSession() with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: service.put_logs(_make_put_logs_request()) sign.assert_not_called() self.assertEqual(1, len(service.session.requests)) headers = service.session.requests[0]["headers"] self.assertEqual("api-key", headers[ANONYMOUS_HEADER]) self.assertNotIn("Authorization", headers) def test_reset_api_key_updates_anonymous_header(self): service = self._service_with_api_key("old-api-key") service.session = _CaptureSession() service.reset_api_key("new-api-key") with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: service.put_logs(_make_put_logs_request()) sign.assert_not_called() self.assertEqual("new-api-key", service.session.requests[0]["headers"][ANONYMOUS_HEADER]) def test_put_logs_v2_uses_anonymous_header_without_signature(self): service = self._service_with_api_key() service.session = _CaptureSession() with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: service.put_logs_v2(_make_put_logs_v2_request()) sign.assert_not_called() self.assertEqual("api-key", service.session.requests[0]["headers"][ANONYMOUS_HEADER]) self.assertNotIn("Authorization", service.session.requests[0]["headers"]) def test_anonymous_put_logs_does_not_send_security_token(self): service = self._service_with_api_key( access_key_id="ak", access_key_secret="sk", security_token="sts-token", ) service.session = _CaptureSession() with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: service.put_logs(_make_put_logs_request()) sign.assert_not_called() headers = service.session.requests[0]["headers"] self.assertEqual("api-key", headers[ANONYMOUS_HEADER]) self.assertNotIn("Authorization", headers) self.assertNotIn(X_SECURITY_TOKEN, headers) def test_api_key_only_non_put_logs_fails_locally_without_network(self): service = self._service_with_api_key() service.session = _FailingSession() with self.assertRaises(TLSException) as ctx: service.delete_project(DeleteProjectRequest("project-id")) self.assertIn(ctx.exception.error_code, ("MissingCredentials", "InvalidCredentials")) self.assertIn("AK/SK", ctx.exception.error_message) def test_api_key_with_ak_sk_prefers_api_key_for_put_logs_and_signs_other_apis(self): service = self._service_with_api_key(access_key_id="ak", access_key_secret="sk") service.session = _CaptureSession() with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: service.put_logs(_make_put_logs_request()) sign.assert_not_called() headers = service.session.requests[0]["headers"] self.assertEqual("api-key", headers[ANONYMOUS_HEADER]) self.assertNotIn("Authorization", headers) with patch("volcengine.tls.TLSService.SignerV4.sign") as sign: request = service._TLSService__prepare_request(api=DESCRIBE_PROJECT, params={"ProjectId": "project-id"}) sign.assert_called_once() self.assertNotIn(ANONYMOUS_HEADER, request.headers) def test_producer_config_accepts_api_key_and_masks_it(self): config = self._producer_config_with_api_key() config.valid_config() self.assertEqual("api-key", config.client_config.api_key) self.assertNotIn("api-key", str(config)) def test_log_dispatcher_passes_api_key_to_tls_service(self): config = self._producer_config_with_api_key() config.max_thread_count = 1 captured = [] class _FakeTLSService: def __init__(self, endpoint, access_key_id, access_key_secret, region, security_token=None, scheme="https", timeout=60, api_version="0.3.0", api_key=None): captured.append({ "endpoint": endpoint, "access_key_id": access_key_id, "access_key_secret": access_key_secret, "region": region, "security_token": security_token, "api_key": api_key, }) with patch("volcengine.tls.producer.log_dispatcher.TLSService", _FakeTLSService): dispatcher = LogDispatcher(config, "producer", BatchSemaphore(1024), RetryQueue()) dispatcher.close_now() self.assertEqual("api-key", captured[0]["api_key"]) def test_log_dispatcher_reset_api_key_updates_tls_service(self): config = self._producer_config_with_api_key() reset_values = [] class _FakeTLSService: def __init__(self, endpoint, access_key_id, access_key_secret, region, security_token=None, scheme="https", timeout=60, api_version="0.3.0", api_key=None): self.api_key = api_key def reset_api_key(self, api_key): self.api_key = api_key reset_values.append(api_key) with patch("volcengine.tls.producer.log_dispatcher.TLSService", _FakeTLSService): dispatcher = LogDispatcher(config, "producer", BatchSemaphore(1024), RetryQueue()) dispatcher.reset_api_key("new-api-key") dispatcher.close_now() self.assertEqual("new-api-key", config.client_config.api_key) self.assertEqual(["new-api-key"], reset_values) def test_producer_reset_api_key_updates_dispatcher_client(self): config = self._producer_config_with_api_key() reset_values = [] class _FakeTLSService: def __init__(self, endpoint, access_key_id, access_key_secret, region, security_token=None, scheme="https", timeout=60, api_version="0.3.0", api_key=None): self.api_key = api_key def reset_api_key(self, api_key): self.api_key = api_key reset_values.append(api_key) with patch("volcengine.tls.producer.log_dispatcher.TLSService", _FakeTLSService): producer = TLSProducer(config) producer.reset_api_key("new-api-key") producer.dispatcher.close_now() self.assertEqual("new-api-key", config.client_config.api_key) self.assertEqual(["new-api-key"], reset_values) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/cancel_download_task_test.py ================================================ import os import unittest import random import string from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import CancelDownloadTaskRequest from volcengine.tls.tls_responses import CancelDownloadTaskResponse class TestCancelDownloadTask(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def generate_random_task_id(self): """生成随机的下载任务ID用于测试""" random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) return f"test-download-task-{random_suffix}" def test_cancel_download_task_request_validation(self): """测试取消下载任务请求参数验证""" # 测试正常情况 request = CancelDownloadTaskRequest(task_id="test-task-id") self.assertTrue(request.check_validation()) # 测试task_id为None的情况 request = CancelDownloadTaskRequest(task_id=None) self.assertFalse(request.check_validation()) def test_cancel_download_task_response(self): """测试取消下载任务响应""" # 这里只是测试响应类的基本结构,实际API调用需要真实的环境配置 # 由于需要真实的服务端响应,这里仅做基本的类实例化测试 pass def test_cancel_download_task_integration(self): """集成测试 - 需要真实的环境配置""" if not all([self.access_key_id, self.access_key_secret]): self.skipTest("环境变量未配置,跳过集成测试") try: tls_client = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 生成一个随机的任务ID进行测试 task_id = self.generate_random_task_id() request = CancelDownloadTaskRequest(task_id=task_id) # 调用取消下载任务接口 # 注意:这里可能会失败,因为任务ID可能不存在,但我们主要测试接口调用 response = tls_client.cancel_download_task(request) # 验证响应类型 self.assertIsInstance(response, CancelDownloadTaskResponse) # 验证响应包含请求ID self.assertIsNotNone(response.get_request_id()) except Exception as e: # 如果是因为任务不存在或其他业务错误,我们也认为接口调用是成功的 # 因为主要目的是测试接口调用,而不是业务逻辑 print(f"集成测试执行中(预期内的错误): {e}") if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/consumer_test.py ================================================ # coding=utf-8 import os import time import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.consumer.consumer import LogProcessor, TLSConsumer from volcengine.tls.consumer.consumer_model import ConsumerConfig from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.test.util_test import NewTLSService class TestLogProcessor(LogProcessor): def process(self, topic_id: str, shard_id: int, log_group_list: LogGroupList): print(topic_id + " --- " + str(shard_id)) count = 0 for log_group in log_group_list.log_groups: for log in log_group.logs: count += 1 print("*** Count = {} ***".format(count)) for content in log.contents: print("{}: {}".format(content.key, content.value)) print() class TestTLSService(unittest.TestCase): cli = NewTLSService() project_id = "" project_name = "python-sdk-consumer-test-project" + uuid.uuid4().hex topic_id = "" topic_name = "python-sdk-consumer-test-topic" + uuid.uuid4().hex timestamp = str(int(time.time()) - 1) @classmethod def setUpClass(cls): # 创建project create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=os.environ["VOLCENGINE_REGION"], ) create_project_response = cls.cli.create_project( create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id # 创建topic create_topic_request = tls_requests.CreateTopicRequest( project_id=cls.project_id, topic_name=cls.topic_name, ttl=1, shard_count=1, ) create_topic_response = cls.cli.create_topic(create_topic_request) cls.assertTrue(create_topic_response.topic_id, "create topic failed") cls.topic_id = create_topic_response.topic_id # 写入日志数据 logs = tls_requests.PutLogsV2Logs( source="python-sdk-local", filename="test.log") for i in range(10): logs.add_log( contents={ "key": "key-" + str(i), "value": "test-message" + str(i) }, log_time=int(time.time()) ) cls.cli.put_logs_v2(tls_requests.PutLogsV2Request(cls.topic_id, logs)) time.sleep(10) @classmethod def tearDownClass(cls): # 删除topic delete_topic_request = tls_requests.DeleteTopicRequest( topic_id=cls.topic_id) delete_topic_response = cls.cli.delete_topic(delete_topic_request) cls.assertTrue(delete_topic_response.request_id, "delete topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest( project_id=cls.project_id) delete_project_response = cls.cli.delete_project( delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def setUp(self): pass def tearDown(self): pass def test_consumer(self): # 配置消费组的必填参数,ConsumerConfig构造函数设定了一些默认参数,您也可根据需要自定义配置 consumer_config = ConsumerConfig( project_id=self.project_id, consumer_group_name="python-consumer-group", consumer_name="python-consumer", topic_id_list=[self.topic_id], consume_from=self.timestamp, ) tls_consumer = TLSConsumer( consumer_config, self.cli, TestLogProcessor()) # 调用start方法开始持续消费 tls_consumer.start() # 可通过调用tls_consumer.stop()来结束消费组消费 time.sleep(300) tls_consumer.stop() ================================================ FILE: volcengine/tls/test/create_alarm_content_template_test.py ================================================ import os import unittest import random import string import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..')) from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import CreateAlarmContentTemplateRequest from volcengine.tls.tls_responses import CreateAlarmContentTemplateResponse from volcengine.tls.data import ( DingTalkContentTemplateInfo, EmailContentTemplateInfo, LarkContentTemplateInfo, SmsContentTemplateInfo, VmsContentTemplateInfo, WeChatContentTemplateInfo, WebhookContentTemplateInfo ) class TestCreateAlarmContentTemplate(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def generate_random_string(self, length=10): return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) def test_create_alarm_content_template(self): """Test creating an alarm content template with all notification types""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("Missing required environment variables") tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # Create content template with all notification types template_name = f"tls-python-sdk-test-alarm-content-template-" \ f"{self.generate_random_string()}" # Email content template email_template = EmailContentTemplateInfo( subject="告警通知", content="告警策略:{{Alarm}}
告警日志项目:{{ProjectName}}
", locale="zh-CN" ) # DingTalk content template dingtalk_content = "尊敬的用户,您好!\n您的账号(主账户ID:{{AccountID}} )" \ "的日志服务{%if NotifyType==1%}触发告警{%else%}告警恢复" \ "{%endif%}\n告警策略:{{Alarm}}\n告警日志主题:{{AlarmTopicName}}" \ "\n触发时间:{{StartTime}}\n触发条件:{{Condition}}\n" \ "当前查询结果:[{%-for x in TriggerParams-%}]{{-x-}} {%-endfor-%}]" \ "\n通知内容:{{NotifyMsg|escapejs}}\n日志检索详情:[查看详情]({{QueryUrl}})" \ "\n告警详情:[查看详情]({{SignInUrl}})\n\n感谢对火山引擎的支持" dingtalk_template = DingTalkContentTemplateInfo( title="告警通知", content=dingtalk_content, locale="zh-CN" ) # Lark content template lark_content = "尊敬的用户,您好!\n您的账号(主账户ID:{{AccountID}} )" \ "的日志服务{%if NotifyType==1%}触发告警{%else%}告警恢复" \ "{%endif%}\n告警策略:{{Alarm}}\n告警日志主题:{{AlarmTopicName}}" \ "\n触发时间:{{StartTime}}\n触发条件:{{Condition}}\n" \ "当前查询结果:[{%-for x in TriggerParams-%}]{{-x-}} {%-endfor-%}]" \ "\n通知内容:{{NotifyMsg|escapejs}}\n日志检索详情:[查看详情]({{QueryUrl}})" \ "\n告警详情:[查看详情]({{SignInUrl}})\n\n感谢对火山引擎的支持" lark_template = LarkContentTemplateInfo( title="告警通知", content=lark_content, locale="zh-CN" ) # WeChat content template wechat_content = "尊敬的用户,您好!\n您的账号(主账户ID:{{AccountID}} )" \ "的日志服务{%if NotifyType==1%}触发告警{%else%}告警恢复" \ "{%endif%}\n告警策略:{{Alarm}}\n告警日志主题:{{AlarmTopicName}}" \ "\n触发时间:{{StartTime}}\n触发条件:{{Condition}}\n" \ "当前查询结果:[{%-for x in TriggerParams-%}]{{-x-}} {%-endfor-%}]" \ "\n通知内容:{{NotifyMsg|escapejs}}\n日志检索详情:[查看详情]({{QueryUrl}})" \ "\n告警详情:[查看详情]({{SignInUrl}})\n\n感谢对火山引擎支持" wechat_template = WeChatContentTemplateInfo( title="告警通知", content=wechat_content, locale="zh-CN" ) # SMS content template sms_content = "告警策略{{Alarm}}, 告警日志项目:{{ProjectName}}, " \ "告警日志主题:{{AlarmTopicName}}, 告警级别:{{Severity}}, " \ "通知类型:{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%}," \ "触发时间:{{StartTime}}, 触发条件:{{Condition}}, " \ "当前查询结果:[{%-for x in TriggerParams-%}]{{-x-}} {%-endfor-%}], " \ "通知内容:{{NotifyMsg}}" sms_template = SmsContentTemplateInfo( content=sms_content, locale="zh-CN" ) # VMS content template vms_template = VmsContentTemplateInfo( content="通知类型:{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%}", locale="zh-CN" ) # Webhook content template webhook_content = '{ "msg_type": "interactive", "card": { "config": ' \ '{ "wide_screen_mode": true }, "elements": [ { "content": ' \ '"尊敬的用户,您好!\\n您的账号(主账户ID:{{AccountID}} )的日志服务' \ '{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%}\\n告警策略:{{Alarm}}' \ '\\n告警日志主题:{{AlarmTopicName}}\\n触发时间:{{StartTime}}\\n触发条件:{{Condition}}' \ '\\n当前查询结果:[{%-for x in TriggerParams-%}]{{-x-}} {%-endfor-%}];\\n' \ '通知内容:{{NotifyMsg|escapejs}}\\n\\n感谢对火山引擎支持", "tag": "markdown" } ], ' \ '"header": { "template": "{%if NotifyType==1%}red{%else%}green{%endif%}", ' \ '"title": { "content": "【火山引擎】【日志服务】{%if NotifyType==1%}触发告警' \ '{%else%}告警恢复{%endif%}", "tag": "plain_text" } } }' webhook_template = WebhookContentTemplateInfo( content=webhook_content ) # Create the request request = CreateAlarmContentTemplateRequest( alarm_content_template_name=template_name, email=email_template, ding_talk=dingtalk_template, lark=lark_template, we_chat=wechat_template, sms=sms_template, vms=vms_template, webhook=webhook_template, need_valid_content=True ) # Execute the request try: response = tls_service.create_alarm_content_template(request) # Verify the response self.assertIsNotNone(response) template_id = response.get_alarm_content_template_id() self.assertIsNotNone(template_id) self.assertIsInstance(template_id, str) self.assertGreater(len(template_id), 0) print(f"Successfully created alarm content template: {template_name} " f"with ID: {template_id}") except Exception as exc: # In a real test environment, we would handle specific exceptions # For now, we'll just print the error and fail the test self.fail(f"Failed to create alarm content template: {str(exc)}") def test_create_alarm_content_template_minimal(self): """Test creating an alarm content template with minimal required fields""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("Missing required environment variables") tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # Create content template with only required field template_name = f"tls-python-sdk-test-minimal-" \ f"{self.generate_random_string()}" request = CreateAlarmContentTemplateRequest( alarm_content_template_name=template_name ) # Execute the request try: response = tls_service.create_alarm_content_template(request) # Verify the response self.assertIsNotNone(response) template_id = response.get_alarm_content_template_id() self.assertIsNotNone(template_id) self.assertIsInstance(template_id, str) self.assertGreater(len(template_id), 0) print(f"Successfully created minimal alarm content template: " f"{template_name} with ID: {template_id}") except Exception as exc: self.fail(f"Failed to create minimal alarm content template: {str(exc)}") def test_create_alarm_content_template_validation(self): """Test that validation fails when required fields are missing""" # Test with missing template name request = CreateAlarmContentTemplateRequest( alarm_content_template_name=None ) # Check validation self.assertFalse(request.check_validation()) # Test with empty template name request = CreateAlarmContentTemplateRequest( alarm_content_template_name="" ) # Check validation self.assertFalse(request.check_validation()) # Test with valid template name request = CreateAlarmContentTemplateRequest( alarm_content_template_name="valid-template-name" ) # Check validation self.assertTrue(request.check_validation()) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/create_alarm_webhook_integration_test.py ================================================ # coding=utf-8 """Unit tests for CreateAlarmWebhookIntegration request and TLSService integration (without real backend). 本文件仅关注 CreateAlarmWebhookIntegration 请求体结构与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import CreateAlarmWebhookIntegrationRequest, GeneralWebhookHeaderKV from volcengine.tls.tls_responses import CreateAlarmWebhookIntegrationResponse class TestCreateAlarmWebhookIntegration(unittest.TestCase): """CreateAlarmWebhookIntegration 单元测试类。""" def setUp(self): """使用本地默认配置构造 TLSService,避免依赖真实环境变量和后端。""" self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_request_validation(self): """测试请求参数验证逻辑(必填字段与 GeneralWebhook 约束)。""" # 缺少必填参数 request = CreateAlarmWebhookIntegrationRequest( webhook_name="", webhook_type="Lark", webhook_url="", ) self.assertFalse(request.check_validation()) # GeneralWebhook 类型但缺少 method/headers request = CreateAlarmWebhookIntegrationRequest( webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", ) self.assertFalse(request.check_validation()) # 正确的 Lark 配置(非 GeneralWebhook 类型,仅要求 Name/Type/Url 非空) request = CreateAlarmWebhookIntegrationRequest( webhook_name="test-webhook", webhook_type="Lark", webhook_url="https://example.com/webhook", ) self.assertTrue(request.check_validation()) # 正确的 GeneralWebhook 配置(Type 为 GeneralWebhook 时需要 Method + Headers) headers = [GeneralWebhookHeaderKV(key="Content-Type", value="application/json")] request = CreateAlarmWebhookIntegrationRequest( webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", webhook_method="POST", webhook_headers=headers, ) self.assertTrue(request.check_validation()) def test_get_api_input_general_type(self): """测试非 GeneralWebhook 类型(如 Lark)下顶层键名与字段构造。""" request = CreateAlarmWebhookIntegrationRequest( webhook_name="lark-webhook", webhook_type="Lark", webhook_url="https://example.com/lark", ) api_input = request.get_api_input() self.assertEqual(api_input["WebhookName"], "lark-webhook") self.assertEqual(api_input["WebhookType"], "Lark") self.assertEqual(api_input["WebhookUrl"], "https://example.com/lark") # 非 GeneralWebhook 场景下 Method / Headers / Secret 可选,不应强制出现在请求体中 self.assertNotIn("WebhookMethod", api_input) self.assertNotIn("WebhookHeaders", api_input) self.assertNotIn("WebhookSecret", api_input) def test_get_api_input_general_webhook_type(self): """测试 GeneralWebhook 类型下顶层键名与 Headers 序列化。""" headers = [ GeneralWebhookHeaderKV(key="Content-Type", value="application/json"), GeneralWebhookHeaderKV(key="Authorization", value="Bearer AUTH_PLACEHOLDER"), ] request = CreateAlarmWebhookIntegrationRequest( webhook_name="custom-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/custom", webhook_method="POST", webhook_headers=headers, webhook_secret="example-secret", ) api_input = request.get_api_input() self.assertEqual(api_input["WebhookName"], "custom-webhook") self.assertEqual(api_input["WebhookType"], "GeneralWebhook") self.assertEqual(api_input["WebhookUrl"], "https://example.com/custom") self.assertEqual(api_input["WebhookMethod"], "POST") self.assertEqual(api_input["WebhookSecret"], "example-secret") self.assertIn("WebhookHeaders", api_input) self.assertEqual(len(api_input["WebhookHeaders"]), 2) self.assertEqual( api_input["WebhookHeaders"][0], {"Key": "Content-Type", "Value": "application/json"}, ) self.assertEqual( api_input["WebhookHeaders"][1], {"Key": "Authorization", "Value": "Bearer AUTH_PLACEHOLDER"}, ) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_create_alarm_webhook_integration_service_call_lark(self, mock_request): """测试 TLSService.create_alarm_webhook_integration 在 Lark 类型下的调用路径与请求体。""" request = CreateAlarmWebhookIntegrationRequest( webhook_name="lark-webhook", webhook_type="Lark", webhook_url="https://example.com/lark", ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = '{"AlarmWebhookIntegrationId": "webhook-123"}' mock_request.return_value = mock_response response = self.tls_service.create_alarm_webhook_integration(request) expected_body = request.get_api_input() mock_request.assert_called_once_with( api="/CreateAlarmWebhookIntegration", body=expected_body, ) self.assertIsInstance(response, CreateAlarmWebhookIntegrationResponse) self.assertEqual(response.get_alarm_webhook_integration_id(), "webhook-123") self.assertEqual(response.get_request_id(), "test-request-id") @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_create_alarm_webhook_integration_service_call_general_webhook(self, mock_request): """测试 TLSService.create_alarm_webhook_integration 在 GeneralWebhook 类型下的调用路径与请求体。""" headers = [GeneralWebhookHeaderKV(key="Content-Type", value="application/json")] request = CreateAlarmWebhookIntegrationRequest( webhook_name="custom-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/custom", webhook_method="POST", webhook_headers=headers, ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = '{"AlarmWebhookIntegrationId": "webhook-456"}' mock_request.return_value = mock_response response = self.tls_service.create_alarm_webhook_integration(request) expected_body = request.get_api_input() mock_request.assert_called_once_with( api="/CreateAlarmWebhookIntegration", body=expected_body, ) self.assertIsInstance(response, CreateAlarmWebhookIntegrationResponse) self.assertEqual(response.get_alarm_webhook_integration_id(), "webhook-456") self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/delete_alarm_content_template_test.py ================================================ import os import unittest from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DeleteAlarmContentTemplateRequest from volcengine.tls.tls_responses import DeleteAlarmContentTemplateResponse class TestDeleteAlarmContentTemplate(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_delete_alarm_content_template(self): """测试删除告警通知内容模板""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量") tls_client = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 测试删除告警通知内容模板 alarm_content_template_id = "test-template-id" delete_request = DeleteAlarmContentTemplateRequest( alarm_content_template_id=alarm_content_template_id ) try: response = tls_client.delete_alarm_content_template(delete_request) # 验证响应类型 self.assertIsInstance(response, DeleteAlarmContentTemplateResponse) # 验证请求ID存在 self.assertIsNotNone(response.get_request_id()) print(f"DeleteAlarmContentTemplate成功,请求ID: {response.get_request_id()}") except Exception as e: # 即使API返回错误,也应该包含请求ID print(f"DeleteAlarmContentTemplate测试完成,响应: {str(e)}") def test_delete_alarm_content_template_validation(self): """测试删除告警通知内容模板的参数验证""" # 测试参数验证 delete_request = DeleteAlarmContentTemplateRequest( alarm_content_template_id=None ) self.assertFalse(delete_request.check_validation()) # 测试有效参数 delete_request_valid = DeleteAlarmContentTemplateRequest( alarm_content_template_id="test-template-id" ) self.assertTrue(delete_request_valid.check_validation()) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/delete_schedule_sql_task_test.py ================================================ import os import unittest import random from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DeleteScheduleSqlTaskRequest from volcengine.tls.tls_responses import DeleteScheduleSqlTaskResponse class TestDeleteScheduleSqlTask(unittest.TestCase): """DeleteScheduleSqlTask 功能测试类""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def test_delete_schedule_sql_task_request_validation(self): """测试 DeleteScheduleSqlTaskRequest 参数验证""" # 测试有效的请求 request = DeleteScheduleSqlTaskRequest(task_id="test-task-id") self.assertTrue(request.check_validation()) # 测试无效的请求 request_invalid = DeleteScheduleSqlTaskRequest(task_id=None) self.assertFalse(request_invalid.check_validation()) def test_delete_schedule_sql_task_request_api_input(self): """测试 DeleteScheduleSqlTaskRequest 的 API 输入转换""" task_id = "test-schedule-sql-task-123" request = DeleteScheduleSqlTaskRequest(task_id=task_id) api_input = request.get_api_input() self.assertEqual(api_input["TaskId"], task_id) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_schedule_sql_task_service_call(self, mock_request): """测试 TLSService.delete_schedule_sql_task 方法调用""" # 设置 mock 响应 mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json', } mock_response.text = '{}' mock_request.return_value = mock_response # 创建 TLS 服务实例 tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建请求 task_id = f"test-schedule-sql-task-{str(int(__import__('time').time()))}" request = DeleteScheduleSqlTaskRequest(task_id=task_id) # 调用方法 response = tls_service.delete_schedule_sql_task(request) # 验证响应类型 self.assertIsInstance(response, DeleteScheduleSqlTaskResponse) # 验证 mock 调用 mock_request.assert_called_once() call_args = mock_request.call_args self.assertEqual(call_args[1]['api'], '/DeleteScheduleSqlTask') self.assertEqual(call_args[1]['body']['TaskId'], task_id) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_schedule_sql_task_with_invalid_request(self, mock_request): """测试使用无效请求调用 delete_schedule_sql_task""" # 创建 TLS 服务实例 tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建无效请求(task_id 为 None) invalid_request = DeleteScheduleSqlTaskRequest(task_id=None) # 验证抛出异常 with self.assertRaises(Exception) as context: tls_service.delete_schedule_sql_task(invalid_request) # 验证异常信息 self.assertIn("InvalidArgument", str(context.exception)) # 验证 mock 没有被调用 mock_request.assert_not_called() def test_delete_schedule_sql_task_integration_pattern(self): """测试与 Node.js 示例类似的集成模式""" # 模拟 Node.js 测试中的随机任务ID生成 task_id = f"test-schedule-sql-task-{str(random.random()).replace('.', '')}" request = DeleteScheduleSqlTaskRequest(task_id=task_id) # 验证请求对象创建成功 self.assertIsNotNone(request) self.assertEqual(request.task_id, task_id) self.assertTrue(request.check_validation()) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/describe_alarm_content_templates_test.py ================================================ import os import unittest from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeAlarmContentTemplatesRequest from volcengine.tls.tls_responses import DescribeAlarmContentTemplatesResponse from volcengine.tls.data import ContentTemplateInfo class TestDescribeAlarmContentTemplates(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def test_describe_alarm_content_templates_request(self): """测试 DescribeAlarmContentTemplatesRequest 的创建和验证""" request = DescribeAlarmContentTemplatesRequest( alarm_content_template_name="test-template", alarm_content_template_id="test-id", order_field="CreateTime", asc=True, page_number=1, page_size=20 ) self.assertTrue(request.check_validation()) # 验证 Asc -> "ASC" 的参数映射 api_input = request.get_api_input() self.assertIn("ASC", api_input) self.assertNotIn("Asc", api_input) self.assertTrue(api_input["ASC"]) # 测试空参数 empty_request = DescribeAlarmContentTemplatesRequest() self.assertTrue(empty_request.check_validation()) def test_describe_alarm_content_templates_response_structure(self): """测试 DescribeAlarmContentTemplates 响应结构""" # 这里可以添加响应结构验证逻辑 # 基于 Node.js 版本的验证模式 # 验证返回的数据包含 AlarmContentTemplates 和 Total 字段 pass def test_describe_alarm_content_templates_integration(self): """测试 DescribeAlarmContentTemplates 的完整调用流程""" try: tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) request = DescribeAlarmContentTemplatesRequest( page_number=1, page_size=20 ) response = tls_service.describe_alarm_content_templates(request) # 验证响应不为空 self.assertIsNotNone(response) # 验证响应类型 self.assertIsInstance(response, DescribeAlarmContentTemplatesResponse) # 验证响应包含必要的字段 templates = response.get_alarm_content_templates() total = response.get_total() # 基于 Node.js 版本的验证逻辑 # templates 应该是列表 self.assertIsInstance(templates, list) # total 应该是整数 self.assertIsInstance(total, int) # 验证模板列表中的每个模板结构 for template in templates: self.assertIsInstance(template, ContentTemplateInfo) # 验证基本字段 self.assertIsInstance(template.is_default, bool) self.assertIsInstance(template.create_time, str) self.assertIsInstance(template.modify_time, str) self.assertIsInstance(template.alarm_content_template_id, str) self.assertIsInstance(template.alarm_content_template_name, str) # 验证可选字段(如果存在) if template.sms is not None: self.assertIsInstance(template.sms.locale, (str, type(None))) self.assertIsInstance(template.sms.content, (str, type(None))) if template.vms is not None: self.assertIsInstance(template.vms.locale, (str, type(None))) self.assertIsInstance(template.vms.content, (str, type(None))) if template.lark is not None: self.assertIsInstance(template.lark.title, (str, type(None))) self.assertIsInstance(template.lark.locale, (str, type(None))) self.assertIsInstance(template.lark.content, (str, type(None))) if template.email is not None: self.assertIsInstance(template.email.locale, (str, type(None))) self.assertIsInstance(template.email.content, (str, type(None))) self.assertIsInstance(template.email.subject, (str, type(None))) if template.we_chat is not None: self.assertIsInstance(template.we_chat.title, (str, type(None))) self.assertIsInstance(template.we_chat.locale, (str, type(None))) self.assertIsInstance(template.we_chat.content, (str, type(None))) if template.webhook is not None: self.assertIsInstance(template.webhook.content, (str, type(None))) if template.ding_talk is not None: self.assertIsInstance(template.ding_talk.title, (str, type(None))) self.assertIsInstance(template.ding_talk.locale, (str, type(None))) self.assertIsInstance(template.ding_talk.content, (str, type(None))) except Exception as e: # 在实际环境中,这里应该根据具体的错误类型进行处理 # 如果是认证失败等预期内的错误,可以选择跳过测试 self.skipTest(f"Integration test skipped due to: {str(e)}") if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/describe_alarm_notify_groups_test.py ================================================ # coding=utf-8 # pylint: disable=no-member import unittest from volcengine.tls.data import AlarmNotifyGroupInfo class TestDescribeAlarmNotifyGroupsData(unittest.TestCase): def test_parse_notice_rules_and_receivers(self): """验证 DescribeAlarmNotifyGroups 响应中 NoticeRules 和 Receivers 的解析逻辑""" receiver_payload = { "ReceiverType": "User", "ReceiverNames": ["user-a", "user-b"], "ReceiverChannels": ["Email", "GeneralWebhook"], "StartTime": "00:00", "EndTime": "23:59", "Webhook": "https://example-webhook", "GeneralWebhookUrl": "https://example.com/hook", "GeneralWebhookBody": "{\"msg\":\"test\"}", "AlarmWebhookAtUsers": ["user-a"], "AlarmWebhookIsAtAll": False, "AlarmWebhookAtGroups": ["group-1"], "GeneralWebhookMethod": "POST", "GeneralWebhookHeaders": [ {"Key": "X-Test-Header", "Value": "value"}, ], "AlarmContentTemplateId": "tpl-001", "AlarmWebhookIntegrationId": "wh-001", "AlarmWebhookIntegrationName": "integration-name", } response_data = { "AlarmNotifyGroupName": "python-sdk-test-notify-group", "AlarmNotifyGroupId": "group-id-123", "NotifyType": ["Trigger", "Recovery"], "Receivers": [receiver_payload], "NoticeRules": [ { "HasNext": False, "HasEndNode": True, "RuleNode": { "Type": "Condition", "Value": ["severity = 'critical'"], "Children": [], }, "ReceiverInfos": [receiver_payload], } ], "CreateTime": "2025-01-01 00:00:00", "ModifyTime": "2025-01-01 00:10:00", "IamProjectName": "default", } info: AlarmNotifyGroupInfo = AlarmNotifyGroupInfo.set_attributes(response_data) # 基本字段 self.assertEqual(info.get_alarm_notify_group_name(), "python-sdk-test-notify-group") self.assertEqual(info.get_alarm_notify_group_id(), "group-id-123") self.assertEqual(info.get_iam_project_name(), "default") # Receivers 解析 receivers = info.get_receivers() self.assertEqual(len(receivers), 1) receiver = receivers[0] self.assertEqual(receiver.get_receiver_type(), "User") self.assertEqual(receiver.get_receiver_names(), ["user-a", "user-b"]) self.assertEqual(receiver.get_general_webhook_url(), "https://example.com/hook") self.assertEqual(receiver.get_alarm_webhook_at_users(), ["user-a"]) self.assertEqual(receiver.get_alarm_webhook_is_at_all(), False) self.assertEqual(receiver.get_alarm_webhook_at_groups(), ["group-1"]) headers = receiver.get_general_webhook_headers() self.assertEqual(len(headers), 1) self.assertEqual(headers[0].get_key(), "X-Test-Header") self.assertEqual(headers[0].get_value(), "value") # NoticeRules 解析 notice_rules = info.get_notice_rules() self.assertEqual(len(notice_rules), 1) rule = notice_rules[0] self.assertFalse(rule.get_has_next()) self.assertTrue(rule.get_has_end_node()) rule_node = rule.get_rule_node() self.assertIsNotNone(rule_node) self.assertEqual(rule_node.get_type(), "Condition") self.assertEqual(rule_node.get_value(), ["severity = 'critical'"]) self.assertEqual(rule_node.get_children(), []) rule_receivers = rule.get_receiver_infos() self.assertEqual(len(rule_receivers), 1) self.assertEqual(rule_receivers[0].get_general_webhook_url(), "https://example.com/hook") if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/describe_alarm_webhook_integrations_test.py ================================================ # coding=utf-8 """Unit tests for DescribeAlarmWebhookIntegrations request and TLSService integration (without real backend). 本文件仅关注 DescribeAlarmWebhookIntegrations 请求参数构造与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeAlarmWebhookIntegrationsRequest from volcengine.tls.tls_responses import DescribeAlarmWebhookIntegrationsResponse class TestDescribeAlarmWebhookIntegrations(unittest.TestCase): """DescribeAlarmWebhookIntegrations 单元测试。""" def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_basic_request_fields_and_validation(self): """测试仅分页参数场景下的字段与校验。""" request = DescribeAlarmWebhookIntegrationsRequest(page_number=1, page_size=20) self.assertIsInstance(request, DescribeAlarmWebhookIntegrationsRequest) self.assertEqual(request.page_number, 1) self.assertEqual(request.page_size, 20) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertEqual(api_input["PageNumber"], 1) self.assertEqual(api_input["PageSize"], 20) self.assertNotIn("WebhookID", api_input) self.assertNotIn("WebhookName", api_input) self.assertNotIn("WebhookType", api_input) def test_request_with_filters_and_pagination(self): """测试携带过滤条件与分页参数时的字段构造与校验。""" request = DescribeAlarmWebhookIntegrationsRequest( webhook_id="test-webhook-id", webhook_name="test-webhook-name", webhook_type="general", page_number=2, page_size=10, ) self.assertEqual(request.webhook_id, "test-webhook-id") self.assertEqual(request.webhook_name, "test-webhook-name") self.assertEqual(request.webhook_type, "general") self.assertEqual(request.page_number, 2) self.assertEqual(request.page_size, 10) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertEqual(api_input["WebhookID"], "test-webhook-id") self.assertEqual(api_input["WebhookName"], "test-webhook-name") self.assertEqual(api_input["WebhookType"], "general") self.assertEqual(api_input["PageNumber"], 2) self.assertEqual(api_input["PageSize"], 10) def test_request_validation_optional_fields(self): """测试所有参数可选场景下的校验逻辑。""" request = DescribeAlarmWebhookIntegrationsRequest() self.assertTrue(request.check_validation()) request = DescribeAlarmWebhookIntegrationsRequest( webhook_id="", webhook_name="", webhook_type="", ) self.assertTrue(request.check_validation()) def test_get_api_input_field_mapping(self): """测试 get_api_input 字段命名与键名映射。""" request = DescribeAlarmWebhookIntegrationsRequest( webhook_id="test-id", webhook_name="test-name", webhook_type="test-type", page_number=1, page_size=20, ) api_input = request.get_api_input() self.assertEqual(api_input["WebhookID"], "test-id") self.assertEqual(api_input["WebhookName"], "test-name") self.assertEqual(api_input["WebhookType"], "test-type") self.assertEqual(api_input["PageNumber"], 1) self.assertEqual(api_input["PageSize"], 20) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_describe_alarm_webhook_integrations_service_call_basic(self, mock_request): """测试 TLSService.describe_alarm_webhook_integrations 基础分页场景的调用路径与 params。""" request = DescribeAlarmWebhookIntegrationsRequest(page_number=1, page_size=20) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = '{"Total": 0, "WebhookIntegrations": []}' mock_request.return_value = mock_response response = self.tls_service.describe_alarm_webhook_integrations(request) expected_params = request.get_api_input() mock_request.assert_called_once_with( api="/DescribeAlarmWebhookIntegrations", params=expected_params, ) self.assertIsInstance(response, DescribeAlarmWebhookIntegrationsResponse) self.assertEqual(response.get_total(), 0) self.assertEqual(response.get_webhook_integrations(), []) self.assertEqual(response.get_request_id(), "test-request-id") @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_describe_alarm_webhook_integrations_service_call_with_filters(self, mock_request): """测试 TLSService.describe_alarm_webhook_integrations 携带过滤条件与分页参数时的调用。""" request = DescribeAlarmWebhookIntegrationsRequest( webhook_id="test-id", webhook_name="test-name", webhook_type="custom", page_number=3, page_size=50, ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = '{"Total": 1, "WebhookIntegrations": []}' mock_request.return_value = mock_response response = self.tls_service.describe_alarm_webhook_integrations(request) expected_params = request.get_api_input() mock_request.assert_called_once_with( api="/DescribeAlarmWebhookIntegrations", params=expected_params, ) self.assertIsInstance(response, DescribeAlarmWebhookIntegrationsResponse) self.assertEqual(response.get_total(), 1) self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/describe_etl_task_test.py ================================================ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeETLTaskRequest from volcengine.tls.tls_responses import DescribeETLTaskResponse class TestDescribeETLTask(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def test_describe_etl_task_request_validation(self): """测试 DescribeETLTaskRequest 参数验证""" # 测试正常情况 request = DescribeETLTaskRequest(task_id="test-task-id") self.assertTrue(request.check_validation()) # 测试 task_id 为 None 的情况 request = DescribeETLTaskRequest(task_id=None) self.assertFalse(request.check_validation()) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_etl_task_success(self, mock_request): """测试 DescribeETLTask 成功场景""" # 模拟响应数据 mock_response = Mock() mock_response.headers = {'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json'} mock_response.text = '''{ "CreateTime": "2023-12-01T12:00:00Z", "DSLType": "NORMAL", "Description": "Test ETL Task", "ETLStatus": "RUNNING", "Enable": true, "FromTime": 1701432000, "LastEnableTime": "2023-12-01T12:00:00Z", "ModifyTime": "2023-12-01T12:00:00Z", "Name": "test-etl-task", "ProjectId": "test-project-id", "ProjectName": "test-project", "Script": "test script content", "SourceTopicId": "test-source-topic-id", "SourceTopicName": "test-source-topic", "TargetResources": [ { "Alias": "target1", "TopicId": "test-target-topic-id", "ProjectId": "test-target-project-id", "ProjectName": "test-target-project", "Region": "cn-beijing", "TopicName": "test-target-topic", "RoleTrn": "test-role-trn" } ], "TaskId": "test-task-id", "TaskType": "Resident", "ToTime": 1701518400 }''' mock_request.return_value = mock_response # 创建 TLS 服务实例 tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建请求 request = DescribeETLTaskRequest(task_id="test-task-id") # 执行请求 response = tls_service.describe_etl_task(request) # 验证响应 self.assertIsInstance(response, DescribeETLTaskResponse) self.assertEqual(response.get_create_time(), "2023-12-01T12:00:00Z") self.assertEqual(response.get_dsl_type(), "NORMAL") self.assertEqual(response.get_description(), "Test ETL Task") self.assertEqual(response.get_etl_status(), "RUNNING") self.assertEqual(response.get_enable(), True) self.assertEqual(response.get_from_time(), 1701432000) self.assertEqual(response.get_last_enable_time(), "2023-12-01T12:00:00Z") self.assertEqual(response.get_modify_time(), "2023-12-01T12:00:00Z") self.assertEqual(response.get_name(), "test-etl-task") self.assertEqual(response.get_project_id(), "test-project-id") self.assertEqual(response.get_project_name(), "test-project") self.assertEqual(response.get_script(), "test script content") self.assertEqual(response.get_source_topic_id(), "test-source-topic-id") self.assertEqual(response.get_source_topic_name(), "test-source-topic") self.assertEqual(response.get_task_id(), "test-task-id") self.assertEqual(response.get_task_type(), "Resident") self.assertEqual(response.get_to_time(), 1701518400) # 验证目标资源 target_resources = response.get_target_resources() self.assertEqual(len(target_resources), 1) target_resource = target_resources[0] self.assertEqual(target_resource.get_alias(), "target1") self.assertEqual(target_resource.get_topic_id(), "test-target-topic-id") self.assertEqual(target_resource.get_project_id(), "test-target-project-id") self.assertEqual(target_resource.get_project_name(), "test-target-project") self.assertEqual(target_resource.get_region(), "cn-beijing") self.assertEqual(target_resource.get_topic_name(), "test-target-topic") self.assertEqual(target_resource.get_role_trn(), "test-role-trn") def test_describe_etl_task_invalid_request(self): """测试 DescribeETLTask 无效请求""" tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建无效请求(task_id 为 None) request = DescribeETLTaskRequest(task_id=None) # 验证请求无效 self.assertFalse(request.check_validation()) # 执行请求应该抛出异常 with self.assertRaises(Exception) as context: tls_service.describe_etl_task(request) self.assertIn("InvalidArgument", str(context.exception)) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_etl_task_empty_target_resources(self, mock_request): """测试 DescribeETLTask 空目标资源场景""" # 模拟响应数据(空目标资源) mock_response = Mock() mock_response.headers = {'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json'} mock_response.text = '''{ "CreateTime": "2023-12-01T12:00:00Z", "DSLType": "NORMAL", "Description": "Test ETL Task", "ETLStatus": "RUNNING", "Enable": true, "FromTime": 1701432000, "LastEnableTime": "2023-12-01T12:00:00Z", "ModifyTime": "2023-12-01T12:00:00Z", "Name": "test-etl-task", "ProjectId": "test-project-id", "ProjectName": "test-project", "Script": "test script content", "SourceTopicId": "test-source-topic-id", "SourceTopicName": "test-source-topic", "TargetResources": [], "TaskId": "test-task-id", "TaskType": "Resident", "ToTime": 1701518400 }''' mock_request.return_value = mock_response # 创建 TLS 服务实例 tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建请求 request = DescribeETLTaskRequest(task_id="test-task-id") # 执行请求 response = tls_service.describe_etl_task(request) # 验证响应 self.assertIsInstance(response, DescribeETLTaskResponse) target_resources = response.get_target_resources() self.assertEqual(len(target_resources), 0) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/describe_import_task_test.py ================================================ # coding=utf-8 """Unit tests for DescribeImportTask API""" import os import unittest import random import string from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeImportTaskRequest from volcengine.tls.tls_responses import DescribeImportTaskResponse class TestDescribeImportTask(unittest.TestCase): """Test cases for DescribeImportTask API""" def setUp(self): """Set up test environment""" self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") if not self.access_key_id or not self.access_key_secret: self.skipTest("Access key not configured") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) def generate_random_task_id(self): """Generate a random task ID for testing""" return f"test-import-task-{''.join(random.choices(string.digits, k=10))}" def test_describe_import_task_request_validation(self): """Test DescribeImportTaskRequest parameter validation""" # Test with valid task_id request = DescribeImportTaskRequest(task_id="test-task-id") api_input = request.get_api_input() self.assertEqual(api_input["TaskId"], "test-task-id") # Test with None task_id (should still work as it's not validated) request_none = DescribeImportTaskRequest(task_id=None) api_input_none = request_none.get_api_input() self.assertIsNone(api_input_none.get("TaskId")) def test_describe_import_task_api_call(self): """Test DescribeImportTask API call with a non-existent task""" task_id = self.generate_random_task_id() request = DescribeImportTaskRequest(task_id=task_id) try: response = self.tls_service.describe_import_task(request) # Verify response type self.assertIsInstance(response, DescribeImportTaskResponse) # Verify response has required fields self.assertIsNotNone(response.get_headers()) self.assertIsNotNone(response.request_id) # The task might not exist, but the API should be callable # and return a valid response structure # Task info might be None if task doesn't exist, which is expected except Exception as e: # The API should be callable even if the task doesn't exist # The error should be about task not found, not about API structure error_message = str(e).lower() self.assertTrue( any(keyword in error_message for keyword in ["not found", "invalid", "error"]), f"Unexpected error type: {error_message}" ) def test_describe_import_task_response_structure(self): """Test the response structure of DescribeImportTask""" task_id = self.generate_random_task_id() request = DescribeImportTaskRequest(task_id=task_id) try: response = self.tls_service.describe_import_task(request) # Test response headers headers = response.get_headers() self.assertIsInstance(headers, dict) self.assertIn("X-Tls-Requestid", headers) # Test task info getter task_info = response.get_task_info() # Task info can be None if task doesn't exist if task_info is not None: self.assertTrue(hasattr(task_info, 'task_id')) self.assertTrue(hasattr(task_info, 'task_name')) self.assertTrue(hasattr(task_info, 'status')) except Exception: # If task doesn't exist, that's acceptable for this test # We're mainly testing the response structure pass def test_describe_import_task_with_empty_task_id(self): """Test DescribeImportTask with empty task ID""" request = DescribeImportTaskRequest(task_id="") try: # Empty task ID should either return an error or empty response # Both are acceptable behaviors self.tls_service.describe_import_task(request) except Exception as e: # Expected behavior - empty task ID should cause an error self.assertTrue(len(str(e)) > 0) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/describe_import_tasks_test.py ================================================ # coding=utf-8 """Unit tests for DescribeImportTasks functionality""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeImportTasksRequest from volcengine.tls.tls_responses import DescribeImportTasksResponse class TestDescribeImportTasks(unittest.TestCase): """Test cases for DescribeImportTasks functionality""" def setUp(self): """Set up test fixtures""" self.endpoint = "https://tls-cn-beijing.ivolces.com" self.region = "cn-beijing" self.access_key_id = "test-ak" self.access_key_secret = "test-sk" self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) def test_describe_import_tasks_request_initialization(self): """Test DescribeImportTasksRequest initialization with all parameters""" request = DescribeImportTasksRequest( task_id="test-task-id", task_name="test-task-name", project_id="test-project-id", project_name="test-project-name", topic_id="test-topic-id", topic_name="test-topic-name", page_number=2, page_size=50, source_type="tos", status=1 ) self.assertEqual(request.task_id, "test-task-id") self.assertEqual(request.task_name, "test-task-name") self.assertEqual(request.project_id, "test-project-id") self.assertEqual(request.project_name, "test-project-name") self.assertEqual(request.topic_id, "test-topic-id") self.assertEqual(request.topic_name, "test-topic-name") self.assertEqual(request.page_number, 2) self.assertEqual(request.page_size, 50) self.assertEqual(request.source_type, "tos") self.assertEqual(request.status, 1) def test_describe_import_tasks_request_default_values(self): """Test DescribeImportTasksRequest default values""" request = DescribeImportTasksRequest() self.assertIsNone(request.task_id) self.assertIsNone(request.task_name) self.assertIsNone(request.project_id) self.assertIsNone(request.project_name) self.assertIsNone(request.topic_id) self.assertIsNone(request.topic_name) self.assertEqual(request.page_number, 1) self.assertEqual(request.page_size, 20) self.assertIsNone(request.source_type) self.assertIsNone(request.status) def test_describe_import_tasks_request_get_api_input(self): """Test DescribeImportTasksRequest get_api_input method""" request = DescribeImportTasksRequest( task_id="test-task-id", task_name="test-task-name", project_id="test-project-id", topic_id="test-topic-id", page_number=1, page_size=10 ) api_input = request.get_api_input() self.assertEqual(api_input["TaskId"], "test-task-id") self.assertEqual(api_input["TaskName"], "test-task-name") self.assertEqual(api_input["ProjectId"], "test-project-id") self.assertEqual(api_input["TopicId"], "test-topic-id") self.assertEqual(api_input["PageNumber"], 1) self.assertEqual(api_input["PageSize"], 10) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_import_tasks_success(self, mock_request): """Test successful describe_import_tasks call""" # Mock response mock_response = Mock() mock_response.status_code = 200 mock_response.text = json.dumps({ "Total": 2, "TaskInfo": [ { "TaskId": "task-1", "TaskName": "import-task-1", "TopicId": "topic-1", "TopicName": "topic-name-1", "ProjectId": "project-1", "ProjectName": "project-name-1", "Status": 1, "CreateTime": "2023-12-01T10:00:00Z", "ModifyTime": "2023-12-01T10:30:00Z", "SourceType": "tos", "Description": "Test import task" }, { "TaskId": "task-2", "TaskName": "import-task-2", "TopicId": "topic-2", "TopicName": "topic-name-2", "ProjectId": "project-2", "ProjectName": "project-name-2", "Status": 0, "CreateTime": "2023-12-01T11:00:00Z", "ModifyTime": "2023-12-01T11:30:00Z", "SourceType": "kafka", "Description": "Another test import task" } ] }) mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json" } mock_request.return_value = mock_response # Create request request = DescribeImportTasksRequest( project_id="test-project", page_number=1, page_size=10 ) # Call the method response = self.tls_service.describe_import_tasks(request) # Verify the response self.assertIsInstance(response, DescribeImportTasksResponse) self.assertEqual(response.get_total(), 2) self.assertEqual(len(response.get_task_info()), 2) # Verify first task first_task = response.get_task_info()[0] self.assertEqual(first_task.task_id, "task-1") self.assertEqual(first_task.task_name, "import-task-1") self.assertEqual(first_task.status, 1) # Verify second task second_task = response.get_task_info()[1] self.assertEqual(second_task.task_id, "task-2") self.assertEqual(second_task.task_name, "import-task-2") self.assertEqual(second_task.status, 0) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_import_tasks_empty_result(self, mock_request): """Test describe_import_tasks with empty result""" # Mock empty response mock_response = Mock() mock_response.status_code = 200 mock_response.text = json.dumps({ "Total": 0, "TaskInfo": [] }) mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json" } mock_request.return_value = mock_response # Create request request = DescribeImportTasksRequest( project_id="empty-project" ) # Call the method response = self.tls_service.describe_import_tasks(request) # Verify the response self.assertEqual(response.get_total(), 0) self.assertEqual(len(response.get_task_info()), 0) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_import_tasks_with_filters(self, mock_request): """Test describe_import_tasks with various filters""" # Mock response mock_response = Mock() mock_response.status_code = 200 mock_response.text = json.dumps({ "Total": 1, "TaskInfo": [ { "TaskId": "filtered-task", "TaskName": "filtered-task-name", "TopicId": "filtered-topic", "TopicName": "filtered-topic-name", "ProjectId": "filtered-project", "ProjectName": "filtered-project-name", "Status": 1, "CreateTime": "2023-12-01T10:00:00Z", "ModifyTime": "2023-12-01T10:30:00Z", "SourceType": "tos" } ] }) mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json" } mock_request.return_value = mock_response # Create request with multiple filters request = DescribeImportTasksRequest( task_id="filtered-task", task_name="filtered-task-name", topic_id="filtered-topic", project_name="filtered-project-name", source_type="tos", status=1, page_number=1, page_size=20 ) # Call the method response = self.tls_service.describe_import_tasks(request) # Verify the request was called self.assertTrue(mock_request.called) # Verify response self.assertEqual(response.get_total(), 1) self.assertEqual(len(response.get_task_info()), 1) task = response.get_task_info()[0] self.assertEqual(task.task_id, "filtered-task") self.assertEqual(task.task_name, "filtered-task-name") def test_describe_import_tasks_request_validation(self): """Test that request validation works correctly""" # DescribeImportTasksRequest does not have check_validation method # This test verifies that the request can be created without validation errors request = DescribeImportTasksRequest() # Should be able to create request without required parameters self.assertIsNotNone(request) # All parameters should be optional, but default values will be included api_input = request.get_api_input() # The request will include default values for page_number and page_size self.assertIn('PageNumber', api_input) self.assertIn('PageSize', api_input) self.assertEqual(api_input['PageNumber'], 1) self.assertEqual(api_input['PageSize'], 20) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/describe_rule_test.py ================================================ """Unit tests for DescribeRuleResponse and RuleInfo pause field.""" # pylint: disable=no-member import json import unittest from volcengine.tls.const import ( X_TLS_REQUEST_ID, CONTENT_TYPE, PROJECT_ID, PROJECT_NAME, TOPIC_ID, TOPIC_NAME, RULE_INFO, HOST_GROUP_INFOS, PAUSE, ) from volcengine.tls.tls_responses import DescribeRuleResponse from volcengine.tls.data import RuleInfo class MockResponse: """Simple mock of requests.Response used by TLSResponse.""" def __init__(self, json_body): self.headers = { X_TLS_REQUEST_ID: "test-request-id", CONTENT_TYPE: "application/json", } self.text = json.dumps(json_body) self.content = self.text.encode("utf-8") class TestDescribeRule(unittest.TestCase): """Tests for DescribeRuleResponse mapping Pause field into RuleInfo.""" def test_describe_rule_response_includes_pause_field(self): """Verify that Pause field is parsed into RuleInfo.get_pause().""" rule_info_body = { # Only Pause field is required for this test; other fields are optional. PAUSE: 1, } response_body = { PROJECT_ID: "project-id", PROJECT_NAME: "project-name", TOPIC_ID: "topic-id", TOPIC_NAME: "topic-name", RULE_INFO: rule_info_body, HOST_GROUP_INFOS: [], } response = DescribeRuleResponse(MockResponse(response_body)) rule_info: RuleInfo = response.get_rule_info() self.assertEqual(1, rule_info.get_pause()) if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/describe_schedule_sql_task_test.py ================================================ import unittest # pylint: disable=no-member from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeScheduleSqlTaskRequest from volcengine.tls.tls_responses import DescribeScheduleSqlTaskResponse from volcengine.tls.data import ScheduleSqlTaskInfo, RequestCycleInfo class TestDescribeScheduleSqlTask(unittest.TestCase): def setUp(self): self.mock_response = Mock() self.mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json' } self.mock_response.text = '''{ "TaskId": "f3e901c3-b17f-42fd-aa8c-dc91a6c7****", "TaskName": "test-schedule-sql-task", "Description": "Test schedule SQL task", "SourceProjectID": "source-project-id", "SourceProjectName": "source-project-name", "SourceTopicID": "source-topic-id", "SourceTopicName": "source-topic-name", "DestRegion": "cn-beijing", "DestProjectID": "dest-project-id", "DestTopicID": "dest-topic-id", "DestTopicName": "dest-topic-name", "Status": 1, "ProcessStartTime": 1640995200, "ProcessEndTime": 1672531200, "ProcessSqlDelay": 300, "ProcessTimeWindow": "[1640995200, 1672531200]", "Query": "SELECT * FROM log WHERE status = 'error'", "RequestCycle": { "Time": 60, "Type": "Period", "CronTab": null, "CronTimeZone": null }, "CreateTimeStamp": 1640995200, "ModifyTimeStamp": 1640995200 }''' def test_describe_schedule_sql_task_request_validation(self): """测试 DescribeScheduleSqlTaskRequest 参数验证""" # 有效请求 request = DescribeScheduleSqlTaskRequest(task_id="test-task-id") self.assertTrue(request.check_validation()) # 无效请求 - 缺少 task_id request = DescribeScheduleSqlTaskRequest(task_id=None) self.assertFalse(request.check_validation()) def test_describe_schedule_sql_task_request_api_input(self): """测试 DescribeScheduleSqlTaskRequest 的 API 输入转换""" request = DescribeScheduleSqlTaskRequest(task_id="test-task-id") api_input = request.get_api_input() self.assertEqual(api_input["TaskId"], "test-task-id") def test_describe_schedule_sql_task_response_parsing(self): """测试 DescribeScheduleSqlTaskResponse 响应解析""" self.mock_response.status_code = 200 response = DescribeScheduleSqlTaskResponse(self.mock_response) # 验证基础响应字段 self.assertEqual(response.get_request_id(), "test-request-id") # 验证调度SQL任务信息 task_info: ScheduleSqlTaskInfo = response.get_schedule_sql_task_info() self.assertIsInstance(task_info, ScheduleSqlTaskInfo) # 验证任务基本信息 self.assertEqual(task_info.task_id, "f3e901c3-b17f-42fd-aa8c-dc91a6c7****") self.assertEqual(task_info.task_name, "test-schedule-sql-task") self.assertEqual(task_info.description, "Test schedule SQL task") # 验证源项目信息 self.assertEqual(task_info.source_project_id, "source-project-id") self.assertEqual(task_info.source_project_name, "source-project-name") self.assertEqual(task_info.source_topic_id, "source-topic-id") self.assertEqual(task_info.source_topic_name, "source-topic-name") # 验证目标项目信息 self.assertEqual(task_info.dest_region, "cn-beijing") self.assertEqual(task_info.dest_project_id, "dest-project-id") self.assertEqual(task_info.dest_topic_id, "dest-topic-id") self.assertEqual(task_info.dest_topic_name, "dest-topic-name") # 验证处理配置 self.assertEqual(task_info.status, 1) self.assertEqual(task_info.process_start_time, 1640995200) self.assertEqual(task_info.process_end_time, 1672531200) self.assertEqual(task_info.process_sql_delay, 300) self.assertEqual(task_info.process_time_window, "[1640995200, 1672531200]") self.assertEqual(task_info.query, "SELECT * FROM log WHERE status = 'error'") # 验证调度周期 self.assertIsInstance(task_info.request_cycle, RequestCycleInfo) self.assertEqual(task_info.request_cycle.time, 60) self.assertEqual(task_info.request_cycle.type, "Period") self.assertIsNone(task_info.request_cycle.cron_tab) self.assertIsNone(task_info.request_cycle.cron_time_zone) # 验证时间戳 self.assertEqual(task_info.create_time_stamp, 1640995200) self.assertEqual(task_info.modify_time_stamp, 1640995200) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_describe_schedule_sql_task_service_call(self, mock_request): """测试 TLSService.describe_schedule_sql_task 方法调用""" # 准备模拟响应 self.mock_response.status_code = 200 mock_request.return_value = self.mock_response # 创建服务实例 service = TLSService( endpoint="test-endpoint", access_key_id="test-ak", access_key_secret="test-sk", region="test-region" ) # 创建请求 request = DescribeScheduleSqlTaskRequest(task_id="test-task-id") # 调用服务方法 response = service.describe_schedule_sql_task(request) # 验证响应类型 self.assertIsInstance(response, DescribeScheduleSqlTaskResponse) # 验证请求参数 mock_request.assert_called_once() call_args = mock_request.call_args self.assertEqual(call_args[1]['api'], '/DescribeScheduleSqlTask') # 验证响应内容 task_info: ScheduleSqlTaskInfo = response.get_schedule_sql_task_info() self.assertEqual(task_info.task_id, "f3e901c3-b17f-42fd-aa8c-dc91a6c7****") def test_schedule_sql_task_info_with_cron_schedule(self): """测试包含 Cron 表达式的调度SQL任务信息""" mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json' } mock_response.text = '''{ "TaskId": "cron-task-id", "TaskName": "cron-schedule-sql-task", "RequestCycle": { "Time": 0, "Type": "Cron", "CronTab": "0 18 * * *", "CronTimeZone": "Asia/Shanghai" }, "CreateTimeStamp": 1640995200, "ModifyTimeStamp": 1640995200 }''' response = DescribeScheduleSqlTaskResponse(mock_response) task_info: ScheduleSqlTaskInfo = response.get_schedule_sql_task_info() # 验证 Cron 调度信息 self.assertEqual(task_info.task_id, "cron-task-id") self.assertEqual(task_info.task_name, "cron-schedule-sql-task") self.assertIsInstance(task_info.request_cycle, RequestCycleInfo) self.assertEqual(task_info.request_cycle.type, "Cron") self.assertEqual(task_info.request_cycle.cron_tab, "0 18 * * *") self.assertEqual(task_info.request_cycle.cron_time_zone, "Asia/Shanghai") def test_request_cycle_info_data_class(self): """测试 RequestCycleInfo 数据类""" # 测试 Period 类型 period_cycle = RequestCycleInfo( time=60, task_type="Period", cron_tab=None, cron_time_zone=None ) self.assertEqual(period_cycle.time, 60) self.assertEqual(period_cycle.type, "Period") self.assertIsNone(period_cycle.cron_tab) self.assertIsNone(period_cycle.cron_time_zone) # 测试 Cron 类型 cron_cycle = RequestCycleInfo( time=0, task_type="Cron", cron_tab="0 18 * * *", cron_time_zone="Asia/Shanghai" ) self.assertEqual(cron_cycle.time, 0) self.assertEqual(cron_cycle.type, "Cron") self.assertEqual(cron_cycle.cron_tab, "0 18 * * *") self.assertEqual(cron_cycle.cron_time_zone, "Asia/Shanghai") if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/describe_shipper_test.py ================================================ """TLSService.describe_shipper 的请求构造与异常场景单元测试(无需真实后端)。""" import os import unittest from unittest.mock import patch, Mock from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeShipperRequest from volcengine.tls.tls_exception import TLSException class TestDescribeShipper(unittest.TestCase): """测试 DescribeShipper 请求结构与 TLSService 调用行为。""" def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_describe_shipper_request_body(self): """验证 DescribeShipperRequest.get_api_input 顶层键名。""" request = DescribeShipperRequest(shipper_id="shipper-123") api_input = request.get_api_input() self.assertEqual(api_input["ShipperId"], "shipper-123") @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_describe_shipper_nonexistent_shipper(self, mock_request): """模拟投递配置不存在时,TLSService.describe_shipper 抛出异常并携带正确请求参数。""" shipper_id = "nonexistent-shipper-id" request = DescribeShipperRequest(shipper_id=shipper_id) # 配置底层 __request 抛出 TLSException,模拟后端 404/NotFound 场景 mock_request.side_effect = TLSException( error_code="NotFound", error_message="Shipper not found" ) with self.assertRaises(TLSException): self.tls_service.describe_shipper(request) # 验证 __request 调用参数 mock_request.assert_called_once() _, kwargs = mock_request.call_args self.assertEqual(kwargs.get("api"), "/DescribeShipper") params = kwargs.get("params") self.assertIsInstance(params, dict) self.assertEqual(params.get("ShipperId"), shipper_id) if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/describe_trace_instances_test.py ================================================ """Unit tests for DescribeTraceInstances functionality.""" import os import unittest from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeTraceInstancesRequest from volcengine.tls.data import TraceInstanceInfo class TestDescribeTraceInstances(unittest.TestCase): """Test cases for DescribeTraceInstances functionality.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_describe_trace_instances_basic(self): """Test basic DescribeTraceInstances functionality.""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("Missing required environment variables") # Create TLS client TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # Create request request = DescribeTraceInstancesRequest( page_number=1, page_size=20 ) # Verify request parameters self.assertTrue(request.check_validation()) self.assertEqual(request.page_number, 1) self.assertEqual(request.page_size, 20) # Test API input format api_input = request.get_api_input() self.assertIn("PageNumber", api_input) self.assertIn("PageSize", api_input) self.assertEqual(api_input["PageNumber"], 1) self.assertEqual(api_input["PageSize"], 20) def test_describe_trace_instances_with_filters(self): """Test DescribeTraceInstances functionality with filters.""" request = DescribeTraceInstancesRequest( page_number=1, page_size=10, trace_instance_name="test-trace", project_id="test-project", status="CREATED" ) # Verify request parameters self.assertTrue(request.check_validation()) self.assertEqual(request.page_size, 10) self.assertEqual(request.trace_instance_name, "test-trace") self.assertEqual(request.project_id, "test-project") self.assertEqual(request.status, "CREATED") # Test API input format api_input = request.get_api_input() self.assertIn("TraceInstanceName", api_input) self.assertIn("ProjectId", api_input) self.assertIn("Status", api_input) self.assertEqual(api_input["TraceInstanceName"], "test-trace") self.assertEqual(api_input["ProjectId"], "test-project") self.assertEqual(api_input["Status"], "CREATED") def test_describe_trace_instances_validation(self): """Test request parameter validation.""" # Test default parameters request = DescribeTraceInstancesRequest() self.assertTrue(request.check_validation()) # Test custom parameters request = DescribeTraceInstancesRequest( page_number=2, page_size=50, iam_project_name="test-iam-project" ) self.assertTrue(request.check_validation()) def test_trace_instance_info_data_structure(self): """Test TraceInstanceInfo data structure.""" # Create TraceInstanceInfo object trace_instance = TraceInstanceInfo( trace_instance_id="trace-123", trace_instance_name="test-trace-instance", project_id="project-456", project_name="test-project", trace_topic_id="topic-789", trace_topic_name="test-trace-topic", dependency_topic_id="dep-topic-111", dependency_topic_topic_name="test-dep-topic", trace_instance_status="CREATED", description="Test trace instance", create_time="2023-01-01T00:00:00Z", modify_time="2023-01-02T00:00:00Z" ) # Verify getter methods self.assertEqual(trace_instance.get_trace_instance_id(), "trace-123") self.assertEqual(trace_instance.get_trace_instance_name(), "test-trace-instance") self.assertEqual(trace_instance.get_project_id(), "project-456") self.assertEqual(trace_instance.get_project_name(), "test-project") self.assertEqual(trace_instance.get_trace_topic_id(), "topic-789") self.assertEqual(trace_instance.get_trace_topic_name(), "test-trace-topic") self.assertEqual(trace_instance.get_dependency_topic_id(), "dep-topic-111") self.assertEqual(trace_instance.get_dependency_topic_topic_name(), "test-dep-topic") self.assertEqual(trace_instance.get_trace_instance_status(), "CREATED") self.assertEqual(trace_instance.get_description(), "Test trace instance") self.assertEqual(trace_instance.get_create_time(), "2023-01-01T00:00:00Z") self.assertEqual(trace_instance.get_modify_time(), "2023-01-02T00:00:00Z") if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/describe_trace_test.py ================================================ import os import unittest import random from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DescribeTraceRequest from volcengine.tls.tls_responses import DescribeTraceResponse from volcengine.tls.data import TraceInfo, SpanInfo, StatusInfo, ResourceInfo, KeyValueInfo class TestDescribeTrace(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_describe_trace_request_validation(self): """测试 DescribeTraceRequest 参数验证""" # 测试有效参数 trace_id = "test-trace-id-" + str(random.randint(1000, 9999)) trace_instance_id = "test-trace-instance-id" request = DescribeTraceRequest( trace_id=trace_id, trace_instance_id=trace_instance_id ) self.assertTrue(request.check_validation()) self.assertEqual(request.trace_id, trace_id) self.assertEqual(request.trace_instance_id, trace_instance_id) # 测试空参数验证 invalid_request = DescribeTraceRequest(trace_id=None, trace_instance_id=None) self.assertFalse(invalid_request.check_validation()) # 测试部分空参数 invalid_request1 = DescribeTraceRequest(trace_id=trace_id, trace_instance_id=None) self.assertFalse(invalid_request1.check_validation()) invalid_request2 = DescribeTraceRequest(trace_id=None, trace_instance_id=trace_instance_id) self.assertFalse(invalid_request2.check_validation()) def test_describe_trace_request_serialization(self): """测试请求参数的序列化""" trace_id = "test-trace-id-12345" trace_instance_id = "test-trace-instance-id" request = DescribeTraceRequest( trace_id=trace_id, trace_instance_id=trace_instance_id ) api_input = request.get_api_input() expected = { "TraceId": trace_id, "TraceInstanceId": trace_instance_id } self.assertEqual(api_input, expected) def test_trace_data_structures(self): """测试 Trace 数据结构""" # 测试 KeyValueInfo key_value = KeyValueInfo(key="test_key", value="test_value") self.assertEqual(key_value.key, "test_key") self.assertEqual(key_value.value, "test_value") # 测试 StatusInfo status = StatusInfo(code="SUCCESS", message="Test message") self.assertEqual(status.code, "SUCCESS") self.assertEqual(status.message, "Test message") # 测试 ResourceInfo attributes = [KeyValueInfo(key="service", value="test-service")] resource = ResourceInfo(attributes=attributes) self.assertEqual(len(resource.attributes), 1) self.assertEqual(resource.attributes[0].key, "service") self.assertEqual(resource.attributes[0].value, "test-service") # 测试 SpanInfo span = SpanInfo( trace_id="test-trace-id", span_id="test-span-id", kind="server", name="test-operation", start_time=1640995200000000, end_time=1640995260000000, status=status, resource=resource ) self.assertEqual(span.trace_id, "test-trace-id") self.assertEqual(span.span_id, "test-span-id") self.assertEqual(span.kind, "server") self.assertEqual(span.name, "test-operation") self.assertEqual(span.start_time, 1640995200000000) self.assertEqual(span.end_time, 1640995260000000) self.assertEqual(span.status.code, "SUCCESS") self.assertEqual(len(span.resource.attributes), 1) # 测试 TraceInfo trace = TraceInfo(spans=[span]) self.assertEqual(len(trace.spans), 1) self.assertEqual(trace.spans[0].trace_id, "test-trace-id") def test_describe_trace_response(self): """测试 DescribeTraceResponse""" # 模拟响应数据 mock_response_data = { "Trace": { "Spans": [ { "TraceId": "test-trace-id", "SpanId": "test-span-id", "Kind": "server", "Name": "test-operation", "StartTime": 1640995200000000, "EndTime": 1640995260000000, "Status": { "Code": "SUCCESS", "Message": "Test message" }, "Resource": { "Attributes": [ { "Key": "service", "Value": "test-service" } ] } } ] } } # 创建模拟响应对象 class MockResponse: def __init__(self): self.headers = {"X-Tls-Requestid": "test-request-id", "Content-Type": "application/json"} self.text = str(mock_response_data).replace("'", '"') mock_response = MockResponse() # 测试响应解析 response = DescribeTraceResponse(mock_response) trace = response.get_trace() self.assertIsNotNone(trace) self.assertEqual(len(trace.spans), 1) # pylint: disable=no-member self.assertEqual(trace.spans[0].trace_id, "test-trace-id") # pylint: disable=no-member self.assertEqual(trace.spans[0].span_id, "test-span-id") # pylint: disable=no-member self.assertEqual(trace.spans[0].kind, "server") # pylint: disable=no-member self.assertEqual(trace.spans[0].name, "test-operation") # pylint: disable=no-member self.assertEqual(trace.spans[0].status.code, "SUCCESS") # pylint: disable=no-member self.assertEqual(len(trace.spans[0].resource.attributes), 1) # pylint: disable=no-member self.assertEqual(trace.spans[0].resource.attributes[0].key, "service") # pylint: disable=no-member self.assertEqual(trace.spans[0].resource.attributes[0].value, "test-service") # pylint: disable=no-member def test_describe_trace_integration(self): """测试 DescribeTrace 集成(需要环境变量)""" if not all([self.endpoint, self.access_key_id, self.access_key_secret, self.region]): self.skipTest("缺少必要的环境变量") tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 模拟测试数据 trace_id = "test-trace-id-" + str(random.randint(1000, 9999)) trace_instance_id = "test-trace-instance-id" try: # 尝试调用 DescribeTrace 方法 describe_trace_request = DescribeTraceRequest( trace_id=trace_id, trace_instance_id=trace_instance_id ) # 验证请求参数 self.assertTrue(describe_trace_request.check_validation()) # 注意:由于我们没有真实的 trace 数据,这个调用可能会失败 # 这里主要是测试请求构建和参数验证 response = tls_service.describe_trace(describe_trace_request) # 如果调用成功,验证响应 trace = response.get_trace() self.assertIsNotNone(trace) except Exception as e: # pylint: disable=broad-exception-caught # 如果 trace 不存在,应该抛出异常 # 这里我们主要验证请求构建是正确的 self.assertIn("Trace", str(e)) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/etl_task_test.py ================================================ """ETL Task Test Module This module contains unit tests for ETL task functionality. """ import os import unittest import random import string from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ModifyETLTaskRequest, DescribeETLTasksRequest from volcengine.tls.tls_responses import DescribeETLTasksResponse from volcengine.tls.data import TargetResource class TestETLTask(unittest.TestCase): """Test class for ETL task functionality.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def generate_random_string(self, length=10): """Generate a random string for testing.""" return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) def test_modify_etl_task_request_validation(self): """测试 ModifyETLTaskRequest 参数验证""" # 测试 task_id 为 None 的情况 request = ModifyETLTaskRequest(task_id=None) self.assertFalse(request.check_validation()) # 测试 task_id 不为 None 的情况 request = ModifyETLTaskRequest(task_id="test-task-id") self.assertTrue(request.check_validation()) def test_modify_etl_task_request_with_target_resources(self): """测试 ModifyETLTaskRequest 包含 TargetResource 的情况""" target_resources = [ TargetResource( alias="test", topic_id="test-topic-id", region="cn-beijing", role_trn="trn:iam::2100000001:role/TLSETLAccessForUserA" ) ] request = ModifyETLTaskRequest( task_id="test-task-id", name="test-etl-task-name", description="This is a test ETL task", script='f_set("key","value")', target_resources=target_resources ) # 验证参数 self.assertTrue(request.check_validation()) self.assertEqual(request.task_id, "test-task-id") self.assertEqual(request.name, "test-etl-task-name") self.assertEqual(request.description, "This is a test ETL task") self.assertEqual(request.script, 'f_set("key","value")') self.assertEqual(len(request.target_resources), 1) # 验证 API 输入格式 api_input = request.get_api_input() self.assertIn("TaskId", api_input) self.assertIn("Name", api_input) self.assertIn("Description", api_input) self.assertIn("Script", api_input) self.assertIn("TargetResources", api_input) target_resource = api_input["TargetResources"][0] self.assertEqual(target_resource["Alias"], "test") self.assertEqual(target_resource["TopicId"], "test-topic-id") self.assertEqual(target_resource["Region"], "cn-beijing") self.assertEqual(target_resource["RoleTrn"], "trn:iam::2100000001:role/TLSETLAccessForUserA") def test_target_resource_data_class(self): """测试 TargetResource 数据类""" target_resource = TargetResource( alias="test-alias", topic_id="test-topic", region="cn-shanghai", role_trn="trn:iam::123456789:role/TestRole" ) # 测试 json 方法 json_data = target_resource.json() self.assertEqual(json_data["Alias"], "test-alias") self.assertEqual(json_data["TopicId"], "test-topic") self.assertEqual(json_data["Region"], "cn-shanghai") self.assertEqual(json_data["RoleTrn"], "trn:iam::123456789:role/TestRole") def test_modify_etl_task_integration(self): """测试 ModifyETLTask 方法的集成测试(模拟)""" # 生成随机任务ID和名称 task_id = f"test-etl-task-{self.generate_random_string()}" task_name = f"test-etl-task-name-{self.generate_random_string()}" # 创建请求 target_resources = [ TargetResource( alias="test", topic_id="test-topic-id", region="cn-beijing", role_trn="trn:iam::2100000001:role/TLSETLAccessForUserA" ) ] modify_request = ModifyETLTaskRequest( task_id=task_id, name=task_name, description="This is a test ETL task", script='f_set("key","value")', target_resources=target_resources ) # 验证请求参数 self.assertTrue(modify_request.check_validation()) # 验证 API 输入格式 api_input = modify_request.get_api_input() self.assertEqual(api_input["TaskId"], task_id) self.assertEqual(api_input["Name"], task_name) self.assertEqual(api_input["Description"], "This is a test ETL task") self.assertEqual(api_input["Script"], 'f_set("key","value")') def test_create_etl_task_request_body_fields(self): """测试 CreateETLTaskRequest 的请求体字段与 TargetResources 序列化""" from volcengine.tls import tls_requests request = tls_requests.CreateETLTaskRequest( dsl_type="NORMAL", name="python-sdk-etl-test-task-body", source_topic_id="source-topic-id", script='f_set("key","value")', target_resources=[ { "alias": "dict-alias", "topic_id": "dict-topic-id", "region": "cn-beijing", "role_trn": "trn:iam::2100000001:role/DictRole", }, TargetResource( alias="obj-alias", topic_id="obj-topic-id", region="cn-shanghai", role_trn="trn:iam::2100000001:role/ObjRole", ), ], ) body = request.get_api_input() # 顶层字段命名 self.assertEqual(body["DSLType"], "NORMAL") self.assertEqual(body["Name"], "python-sdk-etl-test-task-body") self.assertEqual(body["SourceTopicId"], "source-topic-id") self.assertEqual(body["Script"], 'f_set("key","value")') # TargetResources 序列化结果 self.assertIn("TargetResources", body) self.assertEqual(len(body["TargetResources"]), 2) first = body["TargetResources"][0] self.assertEqual(first["Alias"], "dict-alias") self.assertEqual(first["TopicId"], "dict-topic-id") self.assertEqual(first["Region"], "cn-beijing") self.assertEqual(first["RoleTrn"], "trn:iam::2100000001:role/DictRole") second = body["TargetResources"][1] self.assertEqual(second["Alias"], "obj-alias") self.assertEqual(second["TopicId"], "obj-topic-id") self.assertEqual(second["Region"], "cn-shanghai") self.assertEqual(second["RoleTrn"], "trn:iam::2100000001:role/ObjRole") def test_describe_etl_tasks_request_body_fields(self): """测试 DescribeETLTasksRequest 的查询参数序列化。""" request = DescribeETLTasksRequest( project_id="project-1", project_name="project-name", source_topic_id="source-topic-1", source_topic_name="source-topic-name", task_id="etl-task-1", task_name="etl-task-name", status="RUNNING", iam_project_name="default", page_number=2, page_size=50, ) params = request.get_api_input() self.assertEqual(params["ProjectId"], "project-1") self.assertEqual(params["ProjectName"], "project-name") self.assertEqual(params["SourceTopicId"], "source-topic-1") self.assertEqual(params["SourceTopicName"], "source-topic-name") self.assertEqual(params["TaskId"], "etl-task-1") self.assertEqual(params["TaskName"], "etl-task-name") self.assertEqual(params["Status"], "RUNNING") self.assertEqual(params["IamProjectName"], "default") self.assertEqual(params["PageNumber"], 2) self.assertEqual(params["PageSize"], 50) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_describe_etl_tasks_service_call(self, mock_request): """测试 TLSService.describe_etl_tasks 调用路径与响应解析。""" tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = ( '{"Total": 1, "Tasks": [' '{"TaskId": "etl-task-1", "Name": "etl-task-name", ' '"ProjectId": "project-1", "SourceTopicId": "topic-1", "TargetResources": []}' ']}' ) mock_request.return_value = mock_response request = DescribeETLTasksRequest(project_id="project-1", page_number=1, page_size=20) response = tls_service.describe_etl_tasks(request) expected_params = request.get_api_input() mock_request.assert_called_once_with( api="/DescribeETLTasks", params=expected_params, ) self.assertIsInstance(response, DescribeETLTasksResponse) self.assertEqual(response.get_total(), 1) tasks = response.get_tasks() self.assertEqual(len(tasks), 1) self.assertEqual(tasks[0].task_id, "etl-task-1") if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/etl_test.py ================================================ # coding=utf-8 import os import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.test.util_test import NewTLSService class TestETL(unittest.TestCase): cli = NewTLSService() project_id = "" project_name = "python-sdk-etl-test-project" + uuid.uuid4().hex source_topic_id = "" target_topic_id = "" @classmethod def setUpClass(cls): # 创建project region = os.environ.get("VOLCENGINE_REGION") if not region: raise unittest.SkipTest("Missing required environment variable VOLCENGINE_REGION") create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=region, ) create_project_response = cls.cli.create_project( create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id # 创建源topic create_source_topic_request = tls_requests.CreateTopicRequest( topic_name="python-sdk-etl-test-source-topic" + uuid.uuid4().hex, project_id=cls.project_id, ttl=1, shard_count=1 ) create_source_topic_response = cls.cli.create_topic(create_source_topic_request) cls.assertTrue(create_source_topic_response.topic_id, "create source topic failed") cls.source_topic_id = create_source_topic_response.topic_id # 创建目标topic create_target_topic_request = tls_requests.CreateTopicRequest( topic_name="python-sdk-etl-test-target-topic" + uuid.uuid4().hex, project_id=cls.project_id, ttl=1, shard_count=1 ) create_target_topic_response = cls.cli.create_topic(create_target_topic_request) cls.assertTrue(create_target_topic_response.topic_id, "create target topic failed") cls.target_topic_id = create_target_topic_response.topic_id @classmethod def tearDownClass(cls): # 删除topic delete_source_topic_request = tls_requests.DeleteTopicRequest(cls.source_topic_id) delete_source_topic_response = cls.cli.delete_topic(delete_source_topic_request) cls.assertTrue(delete_source_topic_response.request_id, "delete source topic failed") delete_target_topic_request = tls_requests.DeleteTopicRequest(cls.target_topic_id) delete_target_topic_response = cls.cli.delete_topic(delete_target_topic_request) cls.assertTrue(delete_target_topic_response.request_id, "delete target topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest( project_id=cls.project_id) delete_project_response = cls.cli.delete_project( delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def test_create_etl_task(self): """测试创建ETL任务""" # 创建ETL任务 create_etl_task_request = tls_requests.CreateETLTaskRequest( dsl_type="NORMAL", name="python-sdk-etl-test-task" + uuid.uuid4().hex, description="Test ETL task", enable=True, source_topic_id=self.source_topic_id, script='f_set("key", "value")', task_type="Resident", target_resources=[ { "alias": "test", "topic_id": self.target_topic_id, "region": os.environ["VOLCENGINE_REGION"] } ] ) create_etl_task_response = self.cli.create_etl_task(create_etl_task_request) self.assertTrue(create_etl_task_response.task_id, "create etl task failed") self.assertIsNotNone(create_etl_task_response.get_task_id(), "get task id failed") def test_create_etl_task_validation(self): """测试ETL任务参数验证""" # 测试缺少必需参数 with self.assertRaises(Exception): # 缺少dsl_type invalid_request = tls_requests.CreateETLTaskRequest( dsl_type=None, name="test-task", source_topic_id=self.source_topic_id, script='f_set("key", "value")', target_resources=[ { "alias": "test", "topic_id": self.target_topic_id, "region": os.environ["VOLCENGINE_REGION"] } ] ) self.cli.create_etl_task(invalid_request) # 测试无效的target_resources格式 with self.assertRaises(Exception): invalid_request = tls_requests.CreateETLTaskRequest( dsl_type="NORMAL", name="test-task", source_topic_id=self.source_topic_id, script='f_set("key", "value")', target_resources=[ { "alias": "test", # 缺少topic_id "region": os.environ["VOLCENGINE_REGION"] } ] ) self.cli.create_etl_task(invalid_request) ================================================ FILE: volcengine/tls/test/get_account_status_test.py ================================================ import os import unittest from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import GetAccountStatusRequest class TestGetAccountStatus(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def test_get_account_status_request(self): """测试 GetAccountStatusRequest 的创建和验证""" request = GetAccountStatusRequest() self.assertTrue(request.check_validation()) def test_get_account_status_response_structure(self): """测试 GetAccountStatus 响应结构""" # 这里可以添加响应结构验证逻辑 # 基于 Node.js 版本的验证模式 # 验证返回的数据包含 ArchVersion 和 Status 字段 def test_get_account_status_integration(self): """测试 GetAccountStatus 的完整调用流程""" try: tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) request = GetAccountStatusRequest() response = tls_service.get_account_status(request) # 验证响应不为空 self.assertIsNotNone(response) # 验证响应包含必要的字段 arch_version = response.get_arch_version() status = response.get_status() # 基于 Node.js 版本的验证逻辑 # ArchVersion 应该是字符串 if arch_version is not None: self.assertIsInstance(arch_version, str) # Status 应该是字符串,且值在预期范围内 if status is not None: self.assertIsInstance(status, str) self.assertIn(status, ["Activated", "NonActivated"]) except Exception as e: # 在实际环境中,这里应该根据具体的错误类型进行处理 # 如果是认证失败等预期内的错误,可以选择跳过测试 self.skipTest(f"Integration test skipped due to: {str(e)}") if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/import_task_test.py ================================================ # coding=utf-8 """ Unit tests for CreateImportTask functionality in TLS SDK. This module contains comprehensive tests for the CreateImportTask API, including both TOS and Kafka import scenarios. """ # pylint: disable=no-member from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import unittest import time import random from volcengine.tls.TLSService import TLSService from volcengine.tls.data import ImportTaskInfo from volcengine.tls.tls_requests import ( CreateProjectRequest, CreateTopicRequest, DeleteProjectRequest, DeleteTopicRequest, CreateImportTaskRequest, DescribeImportTaskRequest, DescribeImportTasksRequest, TosSourceInfo, KafkaSourceInfo, ImportSourceInfo, TargetInfo, ImportExtractRule ) class TestImportTask(unittest.TestCase): """Test class for ImportTask related functionality.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "" ) self.tls_service = None self.test_suffix = None self.project_id = None self.topic_id = None # Skip tests if environment variables are not set self.skip_tests = not all([ self.endpoint, self.region, self.access_key_id, self.access_key_secret ]) def setUp(self): """Set up test environment before each test.""" if self.skip_tests: self.skipTest("Environment variables not configured") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # Generate unique identifiers for this test run self.test_suffix = str(int(time.time())) + str( random.randint(1000, 9999) ) # Create project and topic for testing self.project_id = self._create_test_project() self.topic_id = self._create_test_topic() def tearDown(self): """Clean up test environment after each test.""" # Clean up: delete topic and project try: if hasattr(self, 'topic_id') and self.topic_id: delete_topic_request = DeleteTopicRequest( topic_id=self.topic_id ) self.tls_service.delete_topic(delete_topic_request) if hasattr(self, 'project_id') and self.project_id: delete_project_request = DeleteProjectRequest( project_id=self.project_id ) self.tls_service.delete_project(delete_project_request) except Exception: # pylint: disable=broad-exception-caught # Ignore cleanup errors pass def _create_test_project(self): """Create a test project and return its ID.""" project_name = ( f"tls-python-sdk-test-import-task-project-{self.test_suffix}" ) create_project_request = CreateProjectRequest( project_name=project_name, region=self.region, description="Test project for import task" ) response = self.tls_service.create_project(create_project_request) return response.get_project_id() def _create_test_topic(self): """Create a test topic and return its ID.""" topic_name = f"tls-python-sdk-test-import-task-topic-{self.test_suffix}" create_topic_request = CreateTopicRequest( topic_name=topic_name, project_id=self.project_id, shard_count=1, ttl=1, description="Test topic for import task" ) response = self.tls_service.create_topic(create_topic_request) return response.get_topic_id() def test_create_import_task_tos(self): """Test creating TOS import task.""" # TOS source info tos_source_info = TosSourceInfo( bucket="test-bucket", prefix="test-prefix/", region="cn-shanghai", compress_type="none" ) # Import source info import_source_info = ImportSourceInfo(tos_source_info=tos_source_info) # Target info target_info = TargetInfo( region=self.region, log_type="json_log" ) # Create import task request task_name = f"tls-python-sdk-test-import-task-{self.test_suffix}" create_request = CreateImportTaskRequest( topic_id=self.topic_id, task_name=task_name, source_type="tos", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id, description="Test TOS import task" ) # Execute request response = self.tls_service.create_import_task(create_request) # Verify response self.assertIsNotNone(response) self.assertIsNotNone(response.get_task_id()) task_id = response.get_task_id() self.assertIsInstance(task_id, str) self.assertGreater(len(task_id), 0) # Verify we can query the task describe_request = DescribeImportTaskRequest(task_id=task_id) describe_response = self.tls_service.describe_import_task( describe_request ) self.assertIsNotNone(describe_response) task_info: ImportTaskInfo = describe_response.get_task_info() self.assertIsNotNone(task_info) self.assertEqual(task_info.task_name, task_name) self.assertEqual(task_info.source_type, "tos") def test_create_import_task_kafka(self): """Test creating Kafka import task.""" # Kafka source info kafka_source_info = KafkaSourceInfo( host="kafka-host1:9092,kafka-host2:9092", topic="test-topic", encode="UTF-8", protocol="plaintext", is_need_auth=False, initial_offset=1, time_source_default=0 ) # Import source info import_source_info = ImportSourceInfo( kafka_source_info=kafka_source_info ) # Target info with extract rule extract_rule = ImportExtractRule( delimiter="|", keys=["time", "level", "message"], time_key="time", time_format="%Y-%m-%d %H:%M:%S", time_zone="Asia/Shanghai", un_match_up_load_switch=True, un_match_log_key="LogParseFailed" ) target_info = TargetInfo( region=self.region, log_type="delimiter_log", extract_rule=extract_rule, log_sample="2023-12-01 10:00:00|INFO|This is a sample log" ) # Create import task request task_name = f"tls-python-sdk-test-kafka-import-task-{self.test_suffix}" create_request = CreateImportTaskRequest( topic_id=self.topic_id, task_name=task_name, source_type="kafka", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id, description="Test Kafka import task" ) # Execute request response = self.tls_service.create_import_task(create_request) # Verify response self.assertIsNotNone(response) self.assertIsNotNone(response.get_task_id()) task_id = response.get_task_id() self.assertIsInstance(task_id, str) self.assertGreater(len(task_id), 0) # Verify we can query the task describe_request = DescribeImportTaskRequest(task_id=task_id) describe_response = self.tls_service.describe_import_task( describe_request ) self.assertIsNotNone(describe_response) task_info: ImportTaskInfo = describe_response.get_task_info() self.assertIsNotNone(task_info) self.assertEqual(task_info.task_name, task_name) self.assertEqual(task_info.source_type, "kafka") def test_create_import_task_validation(self): """Test input validation for CreateImportTaskRequest.""" # Test missing required parameters with self.assertRaises(Exception): CreateImportTaskRequest( topic_id=None, # Missing required topic_id task_name="test-task", source_type="tos", import_source_info=None, target_info=None ) def test_describe_import_tasks(self): """Test querying multiple import tasks.""" # Create a test task first self.test_create_import_task_tos() # Query tasks describe_request = DescribeImportTasksRequest( project_id=self.project_id, topic_id=self.topic_id, page_number=1, page_size=10 ) response = self.tls_service.describe_import_tasks(describe_request) # Verify response self.assertIsNotNone(response) self.assertIsNotNone(response.get_task_infos()) self.assertIsInstance(response.get_task_infos(), list) self.assertGreater(len(response.get_task_infos()), 0) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/list_tags_for_resources_test.py ================================================ """Unit tests for ListTagsForResources request and TLSService integration. 本文件仅构造请求并通过 Mock 拦截 TLSService._TLSService__request, 不依赖真实后端环境或 TLS 资源。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ListTagsForResourcesRequest from volcengine.tls.tls_responses import ListTagsForResourcesResponse class TestListTagsForResources(unittest.TestCase): """测试 ListTagsForResourcesRequest 与 TLSService.list_tags_for_resources""" def setUp(self): # 使用本地默认配置构造 TLSService,避免依赖真实环境变量和后端 self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_list_tags_for_resources_request_validation(self): """测试 ListTagsForResourcesRequest.check_validation 仅校验 resource_type 非空""" request = ListTagsForResourcesRequest(resource_type="project") self.assertTrue(request.check_validation()) request = ListTagsForResourcesRequest(resource_type=None) self.assertFalse(request.check_validation()) def test_list_tags_for_resources_request_body_fields(self): """测试 JSON 请求体顶层字段与 TagFilters 内部结构""" request = ListTagsForResourcesRequest( resource_type="project", resources_ids=["res-1"], tag_filters=[ {"key": "k1", "values": ["v1", "v2"]}, {"Key": "k2", "Values": ["v3"]}, ], max_results=50, next_token="cursor-1", ) body = request.get_api_input() # 顶层字段命名 self.assertEqual(body["ResourceType"], "project") self.assertEqual(body["ResourcesIds"], ["res-1"]) self.assertEqual(body["MaxResults"], 50) self.assertEqual(body["NextToken"], "cursor-1") # TagFilters 结构 self.assertIn("TagFilters", body) self.assertEqual(len(body["TagFilters"]), 2) first = body["TagFilters"][0] self.assertEqual(first["Key"], "k1") self.assertEqual(first["Values"], ["v1", "v2"]) second = body["TagFilters"][1] self.assertEqual(second["Key"], "k2") self.assertEqual(second["Values"], ["v3"]) if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/manual_shard_split_test.py ================================================ import os import unittest import random import string from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import (CreateProjectRequest, CreateTopicRequest, DescribeShardsRequest, ManualShardSplitRequest) from volcengine.tls.tls_responses import (CreateProjectResponse, CreateTopicResponse, DescribeShardsResponse, ManualShardSplitResponse) class TestManualShardSplit(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService(self.endpoint, self.access_key_id, self.access_key_secret, self.region) def generate_random_string(self, length=10): return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) def test_manual_shard_split(self): """测试手动分区分裂功能""" required_env = ["VOLCENGINE_ENDPOINT", "VOLCENGINE_REGION", "VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"] if not all(os.environ.get(k) for k in required_env): self.skipTest("缺少必要的环境变量,跳过手动分区分裂集成测试") # 创建项目 project_name = f"tls-python-sdk-test-manual-shard-split-project-{self.generate_random_string()}" create_project_request = CreateProjectRequest(project_name=project_name, region=self.region) try: create_project_response = self.tls_service.create_project(create_project_request) self.assertIsInstance(create_project_response, CreateProjectResponse) project_id = create_project_response.get_project_id() # 创建主题 topic_name = f"tls-python-sdk-test-manual-shard-split-topic-{self.generate_random_string()}" create_topic_request = CreateTopicRequest( topic_name=topic_name, project_id=project_id, ttl=1, shard_count=2 ) create_topic_response = self.tls_service.create_topic(create_topic_request) self.assertIsInstance(create_topic_response, CreateTopicResponse) topic_id = create_topic_response.get_topic_id() # 查询分片 describe_shards_request = DescribeShardsRequest(topic_id=topic_id, page_number=1, page_size=20) describe_shards_response = self.tls_service.describe_shards(describe_shards_request) self.assertIsInstance(describe_shards_response, DescribeShardsResponse) shards = describe_shards_response.get_shards() self.assertGreater(len(shards), 0, "No shards found") # 选择一个分片进行分裂 shard_to_split = shards[0] shard_id = shard_to_split.get_shard_id() # 执行手动分区分裂 manual_shard_split_request = ManualShardSplitRequest( topic_id=topic_id, shard_id=shard_id, number=2 ) manual_shard_split_response = self.tls_service.manual_shard_split(manual_shard_split_request) self.assertIsInstance(manual_shard_split_response, ManualShardSplitResponse) # 验证响应 result_shards = manual_shard_split_response.get_shards() self.assertIsNotNone(result_shards, "Shards should not be None") self.assertGreater(len(result_shards), 0, "Result shards should not be empty") # 验证每个分片的信息 for shard in result_shards: self.assertIsNotNone(shard.get_shard_id(), "Shard ID should not be None") self.assertIsNotNone(shard.get_topic_id(), "Topic ID should not be None") self.assertIsNotNone(shard.get_status(), "Status should not be None") self.assertIsNotNone(shard.get_inclusive_begin_key(), "Inclusive begin key should not be None") self.assertIsNotNone(shard.get_exclusive_end_key(), "Exclusive end key should not be None") self.assertIsNotNone(shard.get_modify_time(), "Modify time should not be None") except Exception as e: self.fail(f"Manual shard split test failed: {str(e)}") finally: # 清理资源 try: if 'topic_id' in locals(): from volcengine.tls.tls_requests import DeleteTopicRequest delete_topic_request = DeleteTopicRequest(topic_id=topic_id) self.tls_service.delete_topic(delete_topic_request) if 'project_id' in locals(): from volcengine.tls.tls_requests import DeleteProjectRequest delete_project_request = DeleteProjectRequest(project_id=project_id) self.tls_service.delete_project(delete_project_request) except Exception as cleanup_e: print(f"Cleanup failed: {str(cleanup_e)}") def test_manual_shard_split_request_validation(self): """测试ManualShardSplitRequest参数验证""" # 测试缺少必需参数 invalid_request = ManualShardSplitRequest( topic_id=None, shard_id=1, number=2) self.assertFalse(invalid_request.check_validation()) invalid_request = ManualShardSplitRequest( topic_id="test-topic", shard_id=None, number=2) self.assertFalse(invalid_request.check_validation()) invalid_request = ManualShardSplitRequest( topic_id="test-topic", shard_id=1, number=None) self.assertFalse(invalid_request.check_validation()) # 测试合法参数 valid_request = ManualShardSplitRequest( topic_id="test-topic", shard_id=1, number=2) self.assertTrue(valid_request.check_validation()) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/modify_alarm_webhook_integration_test.py ================================================ # coding=utf-8 """Unit tests for ModifyAlarmWebhookIntegration request and TLSService integration (without real backend). 本文件仅关注 ModifyAlarmWebhookIntegration 请求体结构与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ModifyAlarmWebhookIntegrationRequest, GeneralWebhookHeaderKV from volcengine.tls.tls_responses import ModifyAlarmWebhookIntegrationResponse class TestModifyAlarmWebhookIntegration(unittest.TestCase): """ModifyAlarmWebhookIntegration 单元测试。""" def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_request_validation(self): """测试 ModifyAlarmWebhookIntegrationRequest.check_validation 必填约束。""" # 缺少 WebhookID request = ModifyAlarmWebhookIntegrationRequest( webhook_id="", webhook_name="test-webhook", webhook_type="Lark", webhook_url="https://example.com/webhook", ) self.assertFalse(request.check_validation()) # GeneralWebhook 类型但缺少 Method/Headers request = ModifyAlarmWebhookIntegrationRequest( webhook_id="webhook-123", webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", ) self.assertFalse(request.check_validation()) # 非 GeneralWebhook 类型,仅要求 ID/Name/Type/Url 非空 request = ModifyAlarmWebhookIntegrationRequest( webhook_id="webhook-123", webhook_name="test-webhook", webhook_type="Lark", webhook_url="https://example.com/webhook", ) self.assertTrue(request.check_validation()) # GeneralWebhook 类型完整参数 headers = [GeneralWebhookHeaderKV(key="Content-Type", value="application/json")] request = ModifyAlarmWebhookIntegrationRequest( webhook_id="webhook-123", webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", webhook_method="POST", webhook_headers=headers, ) self.assertTrue(request.check_validation()) def test_get_api_input_general_webhook_type(self): """测试 GeneralWebhook 类型下 get_api_input 顶层键名与 Headers 序列化。""" headers = [GeneralWebhookHeaderKV(key="Content-Type", value="application/json")] request = ModifyAlarmWebhookIntegrationRequest( webhook_id="webhook-123", webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", webhook_method="POST", webhook_headers=headers, webhook_secret="example-secret", ) api_input = request.get_api_input() self.assertEqual(api_input["WebhookID"], "webhook-123") self.assertEqual(api_input["WebhookName"], "test-webhook") self.assertEqual(api_input["WebhookType"], "GeneralWebhook") self.assertEqual(api_input["WebhookUrl"], "https://example.com/webhook") self.assertEqual(api_input["WebhookMethod"], "POST") self.assertEqual(api_input["WebhookSecret"], "example-secret") self.assertIn("WebhookHeaders", api_input) self.assertEqual(len(api_input["WebhookHeaders"]), 1) self.assertEqual(api_input["WebhookHeaders"][0]["Key"], "Content-Type") self.assertEqual(api_input["WebhookHeaders"][0]["Value"], "application/json") def test_response_parsing(self): """测试 ModifyAlarmWebhookIntegrationResponse 对 RequestId 的解析。""" class MockResponse: def __init__(self): self.headers = {"X-Tls-Requestid": "test-request-id", "Content-Type": "application/json"} self.text = "" self.content = b"" mock_response = MockResponse() response = ModifyAlarmWebhookIntegrationResponse(mock_response) self.assertEqual(response.request_id, "test-request-id") self.assertEqual(response.headers, mock_response.headers) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_modify_alarm_webhook_integration_service_call(self, mock_request): """测试 TLSService.modify_alarm_webhook_integration 调用路径与请求体结构。""" headers = [GeneralWebhookHeaderKV(key="Content-Type", value="application/json")] request = ModifyAlarmWebhookIntegrationRequest( webhook_id="webhook-123", webhook_name="test-webhook", webhook_type="GeneralWebhook", webhook_url="https://example.com/webhook", webhook_method="POST", webhook_headers=headers, ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = "{}" mock_request.return_value = mock_response response = self.tls_service.modify_alarm_webhook_integration(request) expected_body = request.get_api_input() mock_request.assert_called_once_with( api="/ModifyAlarmWebhookIntegration", body=expected_body, ) self.assertIsInstance(response, ModifyAlarmWebhookIntegrationResponse) self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/processor_contract_test.py ================================================ """Contract tests for index phrase switch and processor request models.""" import json import unittest from volcengine.tls.const import CONTENT_TYPE, X_TLS_REQUEST_ID from volcengine.tls.tls_requests import ( CreateIndexRequest, ModifyIndexRequest, CreateProcessorRequest, ) from volcengine.tls.tls_responses import DescribeIndexResponse class MockResponse: def __init__(self, json_body): self.headers = { X_TLS_REQUEST_ID: "test-request-id", CONTENT_TYPE: "application/json", } self.text = json.dumps(json_body) self.content = self.text.encode("utf-8") class TestProcessorContract(unittest.TestCase): def test_index_requests_include_enable_phrase_index(self): create_input = CreateIndexRequest("topic-id", enable_phrase_index=True).get_api_input() modify_input = ModifyIndexRequest("topic-id", enable_phrase_index=True).get_api_input() self.assertTrue(create_input["EnablePhraseIndex"]) self.assertTrue(modify_input["EnablePhraseIndex"]) def test_describe_index_response_parses_enable_phrase_index(self): response = DescribeIndexResponse(MockResponse({ "TopicId": "topic-id", "FullText": None, "KeyValue": [], "UserInnerKeyValue": [], "CreateTime": "2026-05-01 00:00:00", "ModifyTime": "2026-05-01 00:00:00", "EnablePhraseIndex": True, })) self.assertTrue(response.get_enable_phrase_index()) def test_create_processor_request_uses_service_contract_fields(self): api_input = CreateProcessorRequest( project_id="project-id", processor_name="processor-name", dsl_content='f_set("k", "v")', processor_type="ingester", processor_dsl_type="dsl", processor_status="enabled", fail_strategy="keep_raw", timeout_ms=5000, max_qps=10, ).get_api_input() self.assertEqual("project-id", api_input["ProjectId"]) self.assertEqual("processor-name", api_input["ProcessorName"]) self.assertEqual("ingester", api_input["ProcessorType"]) self.assertEqual("dsl", api_input["ProcessorDSLType"]) self.assertEqual("enabled", api_input["ProcessorStatus"]) self.assertEqual("keep_raw", api_input["FailStrategy"]) self.assertEqual(5000, api_input["TimeoutMs"]) self.assertEqual(10, api_input["MaxQps"]) if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/producer_split_unit_test.py ================================================ import threading import unittest from volcengine.tls.producer.producer import TLSProducer from volcengine.tls.producer.producer_model import BatchLog from volcengine.tls.producer.producer_model import ProducerConfig from volcengine.tls.tls_exception import TLSException from volcengine.tls.tls_requests import PutLogsV2LogContent from volcengine.tls.log_pb2 import LogGroup, Log class _CaptureDispatcher: def __init__(self): self.lock = threading.Lock() self.groups = [] def add_batch(self, hash_key, topic_id, source, filename, log_group, callback): with self.lock: self.groups.append(log_group) class ProducerSplitUnitTest(unittest.TestCase): def _new_producer(self): config = ProducerConfig("endpoint", "region", "ak", "sk", None) producer = TLSProducer(config) producer.dispatcher = _CaptureDispatcher() return producer def test_split_by_count(self): producer = self._new_producer() logs = [PutLogsV2LogContent(time=1, log_dict={"k": "v"}) for _ in range(25000)] producer.send_logs_v2(None, "topic", None, None, logs, None) groups = producer.dispatcher.groups self.assertEqual(3, len(groups)) self.assertEqual(10000, len(getattr(groups[0], "logs"))) self.assertEqual(10000, len(getattr(groups[1], "logs"))) self.assertEqual(5000, len(getattr(groups[2], "logs"))) for g in groups: self.assertLessEqual(len(getattr(g, "logs")), ProducerConfig.MAX_LOG_GROUP_COUNT) self.assertLessEqual(len(g.SerializeToString()), ProducerConfig.MAX_BATCH_SIZE) def test_split_by_size(self): producer = self._new_producer() value = "a" * (2 * 1024 * 1024) logs = [PutLogsV2LogContent(time=1, log_dict={"k": value}) for _ in range(10)] producer.send_logs_v2(None, "topic", None, None, logs, None) groups = producer.dispatcher.groups self.assertGreater(len(groups), 1) for g in groups: self.assertLessEqual(len(g.SerializeToString()), ProducerConfig.MAX_BATCH_SIZE) def test_concurrent_produce_never_exceeds_max_size(self): producer = self._new_producer() def worker(): for _ in range(200): producer.send_log_v2(None, "topic", None, None, PutLogsV2LogContent(time=1, log_dict={"k": "v"}), None) threads = [threading.Thread(target=worker) for _ in range(10)] for th in threads: th.start() for th in threads: th.join() groups = producer.dispatcher.groups self.assertGreater(len(groups), 0) for g in groups: self.assertLessEqual(len(g.SerializeToString()), ProducerConfig.MAX_BATCH_SIZE) def test_single_log_exceeds_max_size_raises(self): producer = self._new_producer() value = "a" * (ProducerConfig.MAX_BATCH_SIZE + 1024) with self.assertRaises(TLSException): producer.send_log_v2(None, "topic", None, None, PutLogsV2LogContent(time=1, log_dict={"k": value}), None) def test_batch_log_group_list_count_never_exceeds_32768(self): config = ProducerConfig("endpoint", "region", "ak", "sk", None) config.max_batch_count = ProducerConfig.MAX_BATCH_COUNT config.max_batch_size_bytes = ProducerConfig.MAX_BATCH_SIZE key = BatchLog.BatchKey("", "topic", "", "") groups = [] for _ in range(6): g = LogGroup() for _ in range(10000): getattr(g, "logs").append(Log()) groups.append(g) batches = [] current = BatchLog(key, config) for g in groups: added = current.try_add(g, len(g.SerializeToString()), None) if not added: self.assertLessEqual(current.current_batch_count, ProducerConfig.MAX_BATCH_COUNT) batches.append(current) current = BatchLog(key, config) self.assertTrue(current.try_add(g, len(g.SerializeToString()), None)) batches.append(current) self.assertGreater(len(batches), 1) total = 0 for b in batches: self.assertLessEqual(b.current_batch_count, ProducerConfig.MAX_BATCH_COUNT) total += b.current_batch_count self.assertEqual(60000, total) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/producer_test.py ================================================ # coding=utf-8 import os import random import string import time import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.consumer.consumer import LogProcessor, TLSConsumer from volcengine.tls.consumer.consumer_model import ConsumerConfig from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.producer.producer import TLSProducer from volcengine.tls.producer.producer_model import ProducerConfig, CallBack from volcengine.tls.test.util_test import NewTLSService from volcengine.tls.tls_requests import PutLogsV2LogContent consume_count = 0 produce_success_count = 0 produce_failed_count = 0 class TestLogProcessor(LogProcessor): def process(self, topic_id: str, shard_id: int, log_group_list: LogGroupList): print(topic_id + " --- " + str(shard_id)) global consume_count for log_group in log_group_list.log_groups: for log in log_group.logs: consume_count += 1 print("*** Count = {} ***".format(consume_count)) class MyCallBack(CallBack): def __init__(self, logs: list[PutLogsV2LogContent]): self.logs = logs def on_complete(self, result: 'Result'): global produce_success_count global produce_failed_count if result.success: produce_success_count += len(self.logs) else: produce_failed_count += len(self.logs) class TestTLSProducerService(unittest.TestCase): cli = None project_id = "" project_name = "python-sdk-producer-test-project" + uuid.uuid4().hex topic_id = "" topic_name = "python-sdk-producer-test-topic" + uuid.uuid4().hex timestamp = str(int(time.time()) - 1) @classmethod def setUpClass(cls): required_env = ["VOLCENGINE_ENDPOINT", "VOLCENGINE_REGION", "VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"] if not all(os.environ.get(k) for k in required_env): raise unittest.SkipTest("缺少必要的环境变量,跳过 TLS producer 集成测试") # 创建 TLSService 客户端 cls.cli = NewTLSService() # 创建project create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=os.environ.get("VOLCENGINE_REGION", ""), ) create_project_response = cls.cli.create_project(create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id # 创建topic create_topic_request = tls_requests.CreateTopicRequest( project_id=cls.project_id, topic_name=cls.topic_name, ttl=1, shard_count=1, ) create_topic_response = cls.cli.create_topic(create_topic_request) cls.assertTrue(create_topic_response.topic_id, "create topic failed") cls.topic_id = create_topic_response.topic_id pass @classmethod def tearDownClass(cls): # 删除topic delete_topic_request = tls_requests.DeleteTopicRequest(topic_id=cls.topic_id) delete_topic_response = cls.cli.delete_topic(delete_topic_request) cls.assertTrue(delete_topic_response.request_id, "delete topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest(project_id=cls.project_id) delete_project_response = cls.cli.delete_project(delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def setUp(self): pass def tearDown(self): pass def test_producer_and_consumer(self): # 创建producer producer_config = ProducerConfig( endpoint=os.environ.get("VOLCENGINE_ENDPOINT", ""), access_key=os.environ.get("VOLCENGINE_ACCESS_KEY_ID", ""), access_secret=os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", ""), region=os.environ.get("VOLCENGINE_REGION", ""), ) producer_config.total_size_in_bytes = 10 * 1024 * 1024 tls_producer = TLSProducer(producer_config) tls_producer.start() size = 5 * 1024 large_string = ''.join(random.choices(string.ascii_letters + string.digits, k=size)) for i in range(100): logs = [tls_requests.PutLogsV2LogContent( log_dict={ "key": "key-" + str(i), "value": large_string + str(i) }, time=int(time.time()) - 300 ), tls_requests.PutLogsV2LogContent( log_dict={ "key": "key1-" + str(i), "value": large_string + str(i) }, time=int(time.time()) - 300 )] callback = MyCallBack(logs) tls_producer.send_logs_v2("", self.topic_id, "python-sdk-local", "test.log", logs, callback) tls_producer.close() tls_producer.close() print("*****produce success count: " + str(produce_success_count)) print("*****produce failed count: " + str(produce_failed_count)) # 配置消费组的必填参数,ConsumerConfig构造函数设定了一些默认参数,您也可根据需要自定义配置 consumer_config = ConsumerConfig( project_id=self.project_id, consumer_group_name="python-consumer-group-1", consumer_name="python-consumer-1", topic_id_list=[self.topic_id], consume_from=self.timestamp, ) tls_consumer = TLSConsumer(consumer_config, self.cli, TestLogProcessor()) # 调用start方法开始持续消费 tls_consumer.start() # 可通过调用tls_consumer.stop()来结束消费组消费 time.sleep(60) tls_consumer.stop() print("consume count: " + str(consume_count)) ================================================ FILE: volcengine/tls/test/put_logs_test.py ================================================ # coding=utf-8 import os import time import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.test.util_test import NewTLSService from volcengine.tls.tls_responses import PutLogsResponse, DescribeCursorResponse, ConsumeLogsResponse class TestPutLogs(unittest.TestCase): cli = None project_id = "" project_name = "python-sdk-consumer-test-project" + uuid.uuid4().hex topic_id = "" topic_name = "python-sdk-consumer-test-topic" + uuid.uuid4().hex @classmethod def setUpClass(cls): required_env = ["VOLCENGINE_ENDPOINT", "VOLCENGINE_REGION", "VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"] if not all(os.environ.get(k) for k in required_env): raise unittest.SkipTest("缺少必要的环境变量,跳过 TLS PutLogs 集成测试") cls.cli = NewTLSService() # 创建project create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=os.environ.get("VOLCENGINE_REGION", ""), ) create_project_response = cls.cli.create_project(create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id # 创建topic create_topic_request = tls_requests.CreateTopicRequest( project_id=cls.project_id, topic_name=cls.topic_name, ttl=1, shard_count=1, ) create_topic_response = cls.cli.create_topic(create_topic_request) cls.assertTrue(create_topic_response.topic_id, "create topic failed") cls.topic_id = create_topic_response.topic_id @classmethod def tearDownClass(cls): # 删除topic delete_topic_request = tls_requests.DeleteTopicRequest(topic_id=cls.topic_id) delete_topic_response = cls.cli.delete_topic(delete_topic_request) cls.assertTrue(delete_topic_response.request_id, "delete topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest(project_id=cls.project_id) delete_project_response = cls.cli.delete_project(delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def setUp(self): pass def tearDown(self): pass def test_put_logs_v2(self): num = 100 time_start = int(time.time()) logGroup = tls_requests.PutLogsV2Logs(source="python-sdk-local", filename="test.log") for i in range(num): logGroup.add_log( contents={ "key": "key-" + str(i), "value": "test-message" + str(i) }, log_time=time_start + i ) logGroup.add_log( contents={ "key": "key-" + str(num), "value": "test-message" + str(num), }, log_time=0 ) response: PutLogsResponse = self.cli.put_logs_v2(tls_requests.PutLogsV2Request(self.topic_id, logGroup)) self.assertIsNotNone(response.get_request_id()) describe_cursor_response: DescribeCursorResponse = self.cli.describe_cursor(tls_requests.DescribeCursorRequest( topic_id=self.topic_id, shard_id=0, from_time="begin", )) self.assertIsNotNone(response.get_request_id()) consume_logs_response: ConsumeLogsResponse = self.cli.consume_logs(tls_requests.ConsumeLogsRequest( self.topic_id, shard_id=0, cursor=describe_cursor_response.get_cursor(), )) self.assertEqual(1, consume_logs_response.get_x_tls_count()) log_group_list = consume_logs_response.get_pb_message() count = 0 for log_group in log_group_list.log_groups: # pylint: disable=no-member for log in log_group.logs: if log.time < int(1e10): self.assertLessEqual(time_start, log.time) self.assertGreaterEqual(time_start+num-1, log.time) else: self.assertLessEqual(time_start * 1000, log.time) self.assertGreaterEqual((time_start+num-1) * 1000, log.time) count += 1 self.assertEqual(num+1, count) ================================================ FILE: volcengine/tls/test/put_logs_validation_unit_test.py ================================================ import unittest from volcengine.tls.log_pb2 import LogGroupList, LogGroup, Log from volcengine.tls.tls_requests import PutLogsRequest class PutLogsValidationUnitTest(unittest.TestCase): def _make_group(self, count): group = LogGroup() for _ in range(count): getattr(group, "logs").append(Log()) return group def test_log_group_count_validation(self): log_group_list = LogGroupList() getattr(log_group_list, "log_groups").append(self._make_group(10000)) request = PutLogsRequest("topic", log_group_list) self.assertTrue(request.check_validation()) log_group_list = LogGroupList() getattr(log_group_list, "log_groups").append(self._make_group(10001)) request = PutLogsRequest("topic", log_group_list) self.assertFalse(request.check_validation()) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/schedule_sql_task_test.py ================================================ # coding=utf-8 import os import time import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.test.util_test import NewTLSService class TestScheduleSqlTask(unittest.TestCase): cli = NewTLSService() project_id = "" project_name = "python-sdk-schedule-sql-test-project" + uuid.uuid4().hex[:16] source_topic_id = "" source_topic_name = "python-sdk-schedule-sql-source-topic" + uuid.uuid4().hex[:16] dest_topic_id = "" dest_topic_name = "python-sdk-schedule-sql-dest-topic" + uuid.uuid4().hex[:16] @classmethod def setUpClass(cls): # 创建project region = os.environ.get("VOLCENGINE_REGION") if not region: raise unittest.SkipTest("Missing required environment variable VOLCENGINE_REGION") create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=region, ) create_project_response = cls.cli.create_project(create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id # 创建源topic create_source_topic_request = tls_requests.CreateTopicRequest( project_id=cls.project_id, topic_name=cls.source_topic_name, ttl=1, shard_count=1, ) create_source_topic_response = cls.cli.create_topic(create_source_topic_request) cls.assertTrue(create_source_topic_response.topic_id, "create source topic failed") cls.source_topic_id = create_source_topic_response.topic_id # 创建目标topic create_dest_topic_request = tls_requests.CreateTopicRequest( project_id=cls.project_id, topic_name=cls.dest_topic_name, ttl=1, shard_count=1, ) create_dest_topic_response = cls.cli.create_topic(create_dest_topic_request) cls.assertTrue(create_dest_topic_response.topic_id, "create dest topic failed") cls.dest_topic_id = create_dest_topic_response.topic_id # 为源主题创建索引 create_index_request = tls_requests.CreateIndexRequest( topic_id=cls.source_topic_id, full_text=tls_requests.FullTextInfo( delimiter=",; ", case_sensitive=False, include_chinese=False, ), ) create_index_response = cls.cli.create_index(create_index_request) cls.assertTrue(create_index_response.request_id, "create index failed") @classmethod def tearDownClass(cls): # 删除目标topic delete_dest_topic_request = tls_requests.DeleteTopicRequest(topic_id=cls.dest_topic_id) delete_dest_topic_response = cls.cli.delete_topic(delete_dest_topic_request) cls.assertTrue(delete_dest_topic_response.request_id, "delete dest topic failed") # 删除源topic delete_source_topic_request = tls_requests.DeleteTopicRequest(topic_id=cls.source_topic_id) delete_source_topic_response = cls.cli.delete_topic(delete_source_topic_request) cls.assertTrue(delete_source_topic_response.request_id, "delete source topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest(project_id=cls.project_id) delete_project_response = cls.cli.delete_project(delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def setUp(self): pass def tearDown(self): pass def test_create_schedule_sql_task(self): # 创建定时SQL任务 current_time = int(time.time()) task_name = f"python-sdk-test-schedule-task-{uuid.uuid4().hex}" create_schedule_sql_task_request = tls_requests.CreateScheduleSqlTaskRequest( task_name=task_name, topic_id=self.source_topic_id, dest_topic_id=self.dest_topic_id, process_start_time=current_time + 3600, # 1小时后开始 process_time_window="@m-15m,@m", query="* | select count(*) as count", request_cycle=tls_requests.RequestCycle( cycle_type="Period", time=60, # 每60分钟执行一次 ), status=0, # 关闭任务,后续需手动启动 description="测试定时SQL任务", process_sql_delay=60, ) create_schedule_sql_task_response = self.cli.create_schedule_sql_task( create_schedule_sql_task_request) self.assertIsNotNone(create_schedule_sql_task_response.get_task_id(), "create schedule sql task failed") self.assertTrue(create_schedule_sql_task_response.get_task_id(), "task_id should not be empty") def test_create_schedule_sql_task_request_body(self): """验证 CreateScheduleSqlTaskRequest.get_api_input 的字段结构""" current_time = int(time.time()) task_name = f"python-sdk-test-schedule-body-{uuid.uuid4().hex}" request_cycle = tls_requests.RequestCycle( cycle_type="Period", time=5, ) request = tls_requests.CreateScheduleSqlTaskRequest( task_name=task_name, topic_id="4a9bd4bd-53f1-43ff-b88a-64ee1be5****", dest_topic_id="2a9bd4bd-53f1-43ff-b88a-64ee1be5****", process_start_time=current_time, process_time_window="@m-15m,@m", query="* | select count(*) as count", request_cycle=request_cycle, status=1, ) self.assertTrue(request.check_validation()) body = request.get_api_input() # 顶层字段键名与服务端 JSON tag 对齐 self.assertEqual(body["TaskName"], task_name) self.assertIn("TopicID", body) self.assertIn("DestTopicID", body) self.assertEqual(body["Status"], 1) self.assertEqual(body["ProcessStartTime"], current_time) self.assertEqual(body["ProcessTimeWindow"], "@m-15m,@m") self.assertEqual(body["Query"], "* | select count(*) as count") # RequestCycle 嵌套结构校验 self.assertIn("RequestCycle", body) request_cycle_body = body["RequestCycle"] self.assertEqual(request_cycle_body["Type"], "Period") self.assertEqual(request_cycle_body["Time"], 5) self.assertNotIn("CronTab", request_cycle_body) self.assertNotIn("CronTimeZone", request_cycle_body) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/shipper_test.py ================================================ # coding: utf-8 """Unit tests for TLS Shipper functionality (DeleteShipper / ModifyShipper). 本文件仅关注请求体结构与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ( DeleteShipperRequest, ModifyShipperRequest, ) from volcengine.tls.tls_responses import DeleteShipperResponse, ModifyShipperResponse from volcengine.tls.data import ContentInfo, JsonInfo, TosShipperInfo, KafkaShipperInfo, CsvInfo class TestDeleteShipper(unittest.TestCase): """DeleteShipper 相关单元测试。""" def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_delete_shipper_request_validation(self): """测试 DeleteShipperRequest.check_validation 仅校验非 None。""" # 合法 shipper_id valid_request = DeleteShipperRequest(shipper_id="test-shipper-123") self.assertTrue(valid_request.check_validation()) # shipper_id 为 None 判定为非法 invalid_request = DeleteShipperRequest(shipper_id=None) self.assertFalse(invalid_request.check_validation()) def test_delete_shipper_request_api_input(self): """测试 DeleteShipperRequest.get_api_input 顶层键名。""" shipper_id = "test-shipper-456" request = DeleteShipperRequest(shipper_id=shipper_id) api_input = request.get_api_input() # 应将 shipper_id 转换为 ShipperId self.assertIn("ShipperId", api_input) self.assertEqual(api_input["ShipperId"], shipper_id) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_delete_shipper_service_call(self, mock_request): """测试 TLSService.delete_shipper 调用的 API 名称与请求体结构。""" mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = "{}" mock_request.return_value = mock_response request = DeleteShipperRequest(shipper_id="shipper-123") response = self.tls_service.delete_shipper(request) mock_request.assert_called_once_with( api="/DeleteShipper", body={"ShipperId": "shipper-123"} ) self.assertIsInstance(response, DeleteShipperResponse) self.assertEqual(response.get_request_id(), "test-request-id") class TestModifyShipper(unittest.TestCase): """ModifyShipper 相关单元测试。""" def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_modify_shipper_validation(self): """测试 ModifyShipperRequest.check_validation 仅校验 ShipperId 非空。""" invalid_request = ModifyShipperRequest( shipper_id=None, shipper_name="test-shipper", ) self.assertFalse(invalid_request.check_validation()) valid_request = ModifyShipperRequest(shipper_id="test-shipper-id") self.assertTrue(valid_request.check_validation()) def test_modify_shipper_api_input_tos_with_trn_and_time(self): """测试 ModifyShipperRequest TOS 配置下的请求体结构、Trn 与时间字段。""" content_info = ContentInfo( format="json", json_info=JsonInfo(enable=True, keys=["field1", "field2"], escape=False), ) tos_shipper_info = TosShipperInfo( prefix="test-prefix", max_size=10, compress="gzip", interval=600, partition_format="%Y/%m/%d", ) modify_shipper_request = ModifyShipperRequest( shipper_id="test-shipper-id", shipper_name="test-shipper-name", shipper_type="tos", status=True, content_info=content_info, tos_shipper_info=tos_shipper_info, shipper_start_time=1111111111111, shipper_end_time=2222222222222, role_trn="trn:iam::123456789012:role/test-role", service_trn="trn:iam::123456789012:role/service-role", ) api_input = modify_shipper_request.get_api_input() # 顶层字段 self.assertEqual(api_input["ShipperId"], "test-shipper-id") self.assertEqual(api_input["ShipperName"], "test-shipper-name") self.assertEqual(api_input["ShipperType"], "tos") self.assertEqual(api_input["Status"], True) self.assertEqual(api_input["RoleTrn"], "trn:iam::123456789012:role/test-role") self.assertEqual( api_input["ServiceTrn"], "trn:iam::123456789012:role/service-role" ) self.assertEqual(api_input["ShipperStartTime"], 1111111111111) self.assertEqual(api_input["ShipperEndTime"], 2222222222222) # ContentInfo 嵌套结构 self.assertIn("ContentInfo", api_input) content_info_data = api_input["ContentInfo"] self.assertEqual(content_info_data["Format"], "json") self.assertIn("JsonInfo", content_info_data) json_info_data = content_info_data["JsonInfo"] self.assertEqual(json_info_data["Enable"], True) self.assertEqual(json_info_data["Keys"], ["field1", "field2"]) self.assertEqual(json_info_data["Escape"], False) # TOS ShipperInfo 嵌套结构 self.assertIn("TosShipperInfo", api_input) tos_info_data = api_input["TosShipperInfo"] self.assertEqual(tos_info_data["Prefix"], "test-prefix") self.assertEqual(tos_info_data["MaxSize"], 10) self.assertEqual(tos_info_data["Compress"], "gzip") self.assertEqual(tos_info_data["Interval"], 600) self.assertEqual(tos_info_data["PartitionFormat"], "%Y/%m/%d") def test_modify_shipper_csv_content(self): """测试 ModifyShipperRequest 在 CSV 内容格式下的 ContentInfo 序列化。""" csv_info = CsvInfo( keys=["field1", "field2", "field3"], delimiter=",", escape_char="\\", print_header=True, non_field_content="N/A", ) content_info = ContentInfo( format="csv", csv_info=csv_info, ) modify_shipper_request = ModifyShipperRequest( shipper_id="test-shipper-id", content_info=content_info, ) api_input = modify_shipper_request.get_api_input() self.assertIn("ContentInfo", api_input) content_info_data = api_input["ContentInfo"] self.assertEqual(content_info_data["Format"], "csv") self.assertIn("CsvInfo", content_info_data) csv_info_data = content_info_data["CsvInfo"] self.assertEqual(csv_info_data["Keys"], ["field1", "field2", "field3"]) self.assertEqual(csv_info_data["Delimiter"], ",") self.assertEqual(csv_info_data["EscapeChar"], "\\") self.assertEqual(csv_info_data["PrintHeader"], True) self.assertEqual(csv_info_data["NonFieldContent"], "N/A") def test_modify_shipper_kafka_content(self): """测试 ModifyShipperRequest 中 KafkaShipperInfo 序列化。""" kafka_shipper_info = KafkaShipperInfo( instance="kafka-instance-123", kafka_topic="test-topic", compress="lz4", start_time=1640995200000, # 2022-01-01 00:00:00 UTC end_time=1643673600000, # 2022-02-01 00:00:00 UTC ) modify_shipper_request = ModifyShipperRequest( shipper_id="test-shipper-id", shipper_type="kafka", kafka_shipper_info=kafka_shipper_info, ) api_input = modify_shipper_request.get_api_input() self.assertIn("KafkaShipperInfo", api_input) kafka_info_data = api_input["KafkaShipperInfo"] self.assertEqual(kafka_info_data["Instance"], "kafka-instance-123") self.assertEqual(kafka_info_data["KafkaTopic"], "test-topic") self.assertEqual(kafka_info_data["Compress"], "lz4") self.assertEqual(kafka_info_data["StartTime"], 1640995200000) self.assertEqual(kafka_info_data["EndTime"], 1643673600000) @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_modify_shipper_service_call(self, mock_request): """测试 TLSService.modify_shipper 调用的 API 名称与请求体结构。""" content_info = ContentInfo( format="json", json_info=JsonInfo(enable=True), ) tos_shipper_info = TosShipperInfo( prefix="test-prefix", max_size=5, compress="snappy", interval=300, partition_format="%Y/%m/%d/%H/%M", ) request = ModifyShipperRequest( shipper_id="shipper-123", shipper_name="shipper-name", shipper_type="tos", status=True, content_info=content_info, tos_shipper_info=tos_shipper_info, role_trn="trn:iam::123456789012:role/test-role", service_trn="trn:iam::123456789012:role/service-role", ) mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = "{}" mock_request.return_value = mock_response response = self.tls_service.modify_shipper(request) expected_body = request.get_api_input() mock_request.assert_called_once_with(api="/ModifyShipper", body=expected_body) self.assertIsInstance(response, ModifyShipperResponse) self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/tag_resources_test.py ================================================ # coding=utf-8 """Unit tests for TagResources request and TLSService integration (without real backend). 本文件仅关注请求体结构与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import TagResourcesRequest from volcengine.tls.tls_responses import TagResourcesResponse from volcengine.tls.data import TagInfo class TestTagResources(unittest.TestCase): """测试 TagResourcesRequest 与 TLSService.tag_resources 的请求体结构""" def setUp(self): # 使用本地默认配置构造 TLSService,避免依赖真实环境变量和后端 self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_tag_resources_request_validation(self): """测试 TagResourcesRequest.check_validation 参数校验""" # 正常情况 request = TagResourcesRequest( resource_type="project", resources_ids=["project-123"], tags=[TagInfo(key="env", value="test")], ) self.assertTrue(request.check_validation()) # 缺少 resource_type request = TagResourcesRequest( resource_type=None, resources_ids=["project-123"], tags=[TagInfo(key="env", value="test")], ) self.assertFalse(request.check_validation()) # 缺少 resources_ids request = TagResourcesRequest( resource_type="project", resources_ids=None, tags=[TagInfo(key="env", value="test")], ) self.assertFalse(request.check_validation()) # 缺少 tags request = TagResourcesRequest( resource_type="project", resources_ids=["project-123"], tags=None, ) self.assertFalse(request.check_validation()) def test_tag_resources_request_api_input(self): """测试 TagResourcesRequest.get_api_input 顶层键名与 Tags 结构""" request = TagResourcesRequest( resource_type="topic", resources_ids=["topic-123", "topic-456"], tags=[ TagInfo(key="k1", value="v1"), TagInfo(key="k2", value="v2"), ], ) body = request.get_api_input() # 顶层字段 self.assertEqual(body["ResourceType"], "topic") self.assertEqual(body["ResourcesIds"], ["topic-123", "topic-456"]) self.assertIn("Tags", body) self.assertEqual(len(body["Tags"]), 2) first = body["Tags"][0] self.assertEqual(first["Key"], "k1") self.assertEqual(first["Value"], "v1") second = body["Tags"][1] self.assertEqual(second["Key"], "k2") self.assertEqual(second["Value"], "v2") @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_tag_resources_service_call(self, mock_request): """测试 TLSService.tag_resources 调用时的 API 名称与请求体结构""" # 模拟 HTTP 响应 mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = "{}" mock_request.return_value = mock_response request = TagResourcesRequest( resource_type="project", resources_ids=["project-123"], tags=[ TagInfo(key="env", value="test"), TagInfo(key="owner", value="alice"), ], ) response = self.tls_service.tag_resources(request) # 验证底层 __request 被正确调用 mock_request.assert_called_once_with( api="/TagResources", body={ "ResourceType": "project", "ResourcesIds": ["project-123"], "Tags": [ {"Key": "env", "Value": "test"}, {"Key": "owner", "Value": "alice"}, ], }, ) # 验证响应类型与 RequestId 解析 self.assertIsInstance(response, TagResourcesResponse) self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/test_create_shipper.py ================================================ # coding=utf-8 """Unit tests for CreateShipper request and TLSService integration (without real backend). 本文件仅关注 CreateShipper 请求体结构与 TLSService 调用参数,不依赖真实后端环境。 """ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import CreateShipperRequest from volcengine.tls.tls_responses import CreateShipperResponse from volcengine.tls.data import ContentInfo, JsonInfo, TosShipperInfo, KafkaShipperInfo class TestCreateShipper(unittest.TestCase): """CreateShipper 相关单元测试。""" def setUp(self): # 使用本地默认配置构造 TLSService,避免依赖真实环境变量和后端 self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test-sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region, ) def test_content_info_json_serialization(self): """测试 ContentInfo JSON 序列化结构与键名。""" json_info = JsonInfo(enable=True, keys=["field1", "field2"], escape=False) content_info = ContentInfo(format="json", json_info=json_info) json_data = content_info.json() self.assertEqual(json_data["Format"], "json") self.assertIn("JsonInfo", json_data) self.assertEqual(json_data["JsonInfo"]["Enable"], True) self.assertEqual(json_data["JsonInfo"]["Keys"], ["field1", "field2"]) self.assertEqual(json_data["JsonInfo"]["Escape"], False) def test_tos_shipper_info_json_serialization(self): """测试 TosShipperInfo JSON 序列化结构与键名。""" tos_info = TosShipperInfo( bucket="test-bucket", prefix="logs/", max_size=100, compress="gzip", interval=600, partition_format="%Y/%m/%d", ) json_data = tos_info.json() self.assertEqual(json_data["Bucket"], "test-bucket") self.assertEqual(json_data["Prefix"], "logs/") self.assertEqual(json_data["MaxSize"], 100) self.assertEqual(json_data["Compress"], "gzip") self.assertEqual(json_data["Interval"], 600) self.assertEqual(json_data["PartitionFormat"], "%Y/%m/%d") def test_kafka_shipper_info_json_serialization(self): """测试 KafkaShipperInfo JSON 序列化结构与键名。""" kafka_info = KafkaShipperInfo( instance="kafka-instance", kafka_topic="test-topic", compress="snappy", start_time=1234567890000, end_time=1234567899999, ) json_data = kafka_info.json() self.assertEqual(json_data["Instance"], "kafka-instance") self.assertEqual(json_data["KafkaTopic"], "test-topic") self.assertEqual(json_data["Compress"], "snappy") self.assertEqual(json_data["StartTime"], 1234567890000) self.assertEqual(json_data["EndTime"], 1234567899999) def test_create_shipper_request_trn_and_time_fields(self): """测试 CreateShipperRequest 中 Trn 与时间字段的序列化。""" content_info = ContentInfo( format="json", json_info=JsonInfo(enable=True), ) tos_shipper_info = TosShipperInfo( bucket="test-bucket", prefix="logs/", max_size=5, compress="snappy", interval=300, partition_format="%Y/%m/%d", ) request = CreateShipperRequest( topic_id="test-topic-id", shipper_name="test-shipper", shipper_type="tos", content_info=content_info, tos_shipper_info=tos_shipper_info, shipper_start_time=1111111111111, shipper_end_time=2222222222222, role_trn="trn:iam::123456789012:role/test-role", service_trn="trn:iam::123456789012:role/service-role", ) api_input = request.get_api_input() self.assertEqual(api_input["TopicId"], "test-topic-id") self.assertEqual(api_input["ShipperName"], "test-shipper") self.assertEqual(api_input["ShipperType"], "tos") self.assertEqual(api_input["RoleTrn"], "trn:iam::123456789012:role/test-role") self.assertEqual( api_input["ServiceTrn"], "trn:iam::123456789012:role/service-role" ) self.assertEqual(api_input["ShipperStartTime"], 1111111111111) self.assertEqual(api_input["ShipperEndTime"], 2222222222222) # 嵌套结构 self.assertIn("ContentInfo", api_input) self.assertIn("TosShipperInfo", api_input) self.assertEqual(api_input["TosShipperInfo"]["Bucket"], "test-bucket") @patch("volcengine.tls.TLSService.TLSService._TLSService__request") def test_create_shipper_service_call_tos(self, mock_request): """测试 TLSService.create_shipper 调用时的 API 名称与请求体结构。""" content_info = ContentInfo( format="json", json_info=JsonInfo(enable=True), ) tos_shipper_info = TosShipperInfo( bucket="test-bucket", prefix="logs/", max_size=5, compress="snappy", interval=300, partition_format="%Y/%m/%d", ) request = CreateShipperRequest( topic_id="test-topic-id", shipper_name="test-shipper", shipper_type="tos", content_info=content_info, tos_shipper_info=tos_shipper_info, role_trn="trn:iam::123456789012:role/test-role", service_trn="trn:iam::123456789012:role/service-role", ) # 模拟 HTTP 响应 mock_response = Mock() mock_response.headers = { "X-Tls-Requestid": "test-request-id", "Content-Type": "application/json", } mock_response.text = "{\"ShipperId\": \"shipper-123\"}" mock_request.return_value = mock_response response = self.tls_service.create_shipper(request) expected_body = request.get_api_input() mock_request.assert_called_once_with(api="/CreateShipper", body=expected_body) # 验证响应类型与 RequestId/字段解析 self.assertIsInstance(response, CreateShipperResponse) self.assertEqual(response.get_shipper_id(), "shipper-123") self.assertEqual(response.get_request_id(), "test-request-id") if __name__ == "__main__": # pragma: no cover unittest.main() ================================================ FILE: volcengine/tls/test/test_delete_alarm_webhook_integration.py ================================================ """Unit tests for DeleteAlarmWebhookIntegration functionality.""" import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DeleteAlarmWebhookIntegrationRequest from volcengine.tls.tls_responses import DeleteAlarmWebhookIntegrationResponse class TestDeleteAlarmWebhookIntegration(unittest.TestCase): """Test cases for DeleteAlarmWebhookIntegration functionality.""" def setUp(self): """Set up test fixtures.""" self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) def test_delete_alarm_webhook_integration_request_validation(self): """Test DeleteAlarmWebhookIntegrationRequest validation.""" # Test with valid webhook ID request = DeleteAlarmWebhookIntegrationRequest(webhook_id="test-webhook-id-12345") self.assertTrue(request.check_validation()) # Test with None webhook ID request = DeleteAlarmWebhookIntegrationRequest(webhook_id=None) self.assertFalse(request.check_validation()) def test_delete_alarm_webhook_integration_request_api_input(self): """Test DeleteAlarmWebhookIntegrationRequest API input generation.""" webhook_id = "test-webhook-id-12345" request = DeleteAlarmWebhookIntegrationRequest(webhook_id=webhook_id) api_input = request.get_api_input() expected_input = { "WebhookID": webhook_id } self.assertEqual(api_input, expected_input) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_alarm_webhook_integration_success(self, mock_request): """Test successful delete alarm webhook integration.""" # Mock successful response mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json' } mock_response.text = '' mock_response.status_code = 200 mock_request.return_value = mock_response # Create request webhook_id = "test-webhook-id-12345" request = DeleteAlarmWebhookIntegrationRequest(webhook_id=webhook_id) # Call the method response = self.tls_service.delete_alarm_webhook_integration(request) # Verify the response self.assertIsInstance(response, DeleteAlarmWebhookIntegrationResponse) self.assertEqual(response.get_request_id(), 'test-request-id') # Verify the API was called correctly mock_request.assert_called_once() call_args = mock_request.call_args self.assertEqual(call_args[1]['api'], '/DeleteAlarmWebhookIntegration') @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_alarm_webhook_integration_invalid_request(self, mock_request): """Test delete alarm webhook integration with invalid request.""" # Test with invalid request request = DeleteAlarmWebhookIntegrationRequest(webhook_id=None) # Should raise exception for invalid request with self.assertRaises(Exception): self.tls_service.delete_alarm_webhook_integration(request) # Verify the API was not called mock_request.assert_not_called() def test_delete_alarm_webhook_integration_integration(self): """Test delete alarm webhook integration integration.""" # This is an integration test that would require actual credentials and endpoint # It should only be run in a test environment with proper setup if not all([ os.environ.get("VOLCENGINE_ENDPOINT"), os.environ.get("VOLCENGINE_REGION"), os.environ.get("VOLCENGINE_ACCESS_KEY_ID"), os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET") ]): self.skipTest("Integration test requires environment variables to be set") # This test would create a webhook integration first, then delete it # For now, we just verify the method exists and can be called # In a real integration test, you would: # 1. Create a webhook integration using CreateAlarmWebhookIntegration # 2. Get the webhook ID from the response # 3. Delete the webhook integration using DeleteAlarmWebhookIntegration # 4. Verify the deletion was successful # For this test, we just verify the method exists self.assertTrue(hasattr(self.tls_service, 'delete_alarm_webhook_integration')) self.assertTrue(callable(getattr(self.tls_service, 'delete_alarm_webhook_integration'))) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_delete_import_task.py ================================================ # coding=utf-8 """Unit tests for DeleteImportTask functionality.""" import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.const import X_TLS_REQUEST_ID from volcengine.tls.tls_requests import DeleteImportTaskRequest from volcengine.tls.tls_responses import DeleteImportTaskResponse from volcengine.tls.tls_exception import TLSException class TestDeleteImportTask(unittest.TestCase): """Test class for DeleteImportTask functionality.""" def setUp(self): self.endpoint = "https://tls-cn-beijing.ivolces.com" self.region = "cn-beijing" self.access_key_id = "test_ak" self.access_key_secret = "test_sk" self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) def test_delete_import_task_request_validation_success(self): """测试 DeleteImportTaskRequest 参数验证成功的情况""" task_id = "test-import-task-123" request = DeleteImportTaskRequest(task_id) self.assertTrue(request.check_validation()) self.assertEqual(request.task_id, task_id) def test_delete_import_task_request_validation_failed(self): """测试 DeleteImportTaskRequest 参数验证失败的情况""" # 测试 task_id 为 None request = DeleteImportTaskRequest(None) self.assertFalse(request.check_validation()) def test_delete_import_task_api_call_success(self): """测试 DeleteImportTask API 调用成功的情况""" task_id = "test-import-task-123" request = DeleteImportTaskRequest(task_id) # Mock 响应 mock_response = Mock() mock_response.headers = { X_TLS_REQUEST_ID: 'test-request-id', 'Content-Type': 'application/json' } mock_response.text = '{}' mock_response.status_code = 200 with patch.object(self.tls_service, '_TLSService__request', return_value=mock_response): response = self.tls_service.delete_import_task(request) self.assertIsInstance(response, DeleteImportTaskResponse) self.assertEqual(response.request_id, 'test-request-id') def test_delete_import_task_with_empty_task_id(self): """测试使用空 task_id 的情况,应该抛出异常""" request = DeleteImportTaskRequest("") with self.assertRaises(TLSException) as context: self.tls_service.delete_import_task(request) self.assertIn("Invalid request", str(context.exception)) def test_delete_import_task_api_response_with_data(self): """测试 API 返回包含数据的响应""" task_id = "test-import-task-456" request = DeleteImportTaskRequest(task_id) # Mock 响应包含数据 mock_response = Mock() mock_response.headers = { X_TLS_REQUEST_ID: 'test-request-id-2', 'Content-Type': 'application/json' } mock_response.text = '{"key": "value", "status": "deleted"}' mock_response.status_code = 200 with patch.object(self.tls_service, '_TLSService__request', return_value=mock_response): response = self.tls_service.delete_import_task(request) self.assertIsInstance(response, DeleteImportTaskResponse) self.assertEqual(response.request_id, 'test-request-id-2') self.assertEqual(response.response, {"key": "value", "status": "deleted"}) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_delete_trace_instance.py ================================================ """Unit tests for DeleteTraceInstance functionality.""" import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import DeleteTraceInstanceRequest from volcengine.tls.tls_responses import DeleteTraceInstanceResponse class TestDeleteTraceInstance(unittest.TestCase): """Test cases for DeleteTraceInstance functionality.""" def setUp(self): """Set up test fixtures.""" self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) def test_delete_trace_instance_request_validation(self): """Test DeleteTraceInstanceRequest validation.""" # Test with valid trace instance ID request = DeleteTraceInstanceRequest(trace_instance_id="test-trace-instance-id") self.assertTrue(request.check_validation()) # Test with None trace instance ID request = DeleteTraceInstanceRequest(trace_instance_id=None) self.assertFalse(request.check_validation()) def test_delete_trace_instance_request_api_input(self): """Test DeleteTraceInstanceRequest API input generation.""" trace_instance_id = "test-trace-instance-id" request = DeleteTraceInstanceRequest(trace_instance_id=trace_instance_id) api_input = request.get_api_input() expected_input = { "TraceInstanceId": trace_instance_id } self.assertEqual(api_input, expected_input) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_trace_instance_success(self, mock_request): """Test successful delete trace instance.""" # Mock successful response mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json' } mock_response.text = '' mock_response.status_code = 200 mock_request.return_value = mock_response # Create request trace_instance_id = "test-trace-instance-id" request = DeleteTraceInstanceRequest(trace_instance_id=trace_instance_id) # Call the method response = self.tls_service.delete_trace_instance(request) # Verify the response self.assertIsInstance(response, DeleteTraceInstanceResponse) self.assertEqual(response.get_request_id(), 'test-request-id') # Verify the API was called correctly mock_request.assert_called_once() call_args = mock_request.call_args self.assertEqual(call_args[1]['api'], '/DeleteTraceInstance') @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_delete_trace_instance_invalid_request(self, mock_request): """Test delete trace instance with invalid request.""" # Test with invalid request request = DeleteTraceInstanceRequest(trace_instance_id=None) # Should raise exception for invalid request with self.assertRaises(Exception): self.tls_service.delete_trace_instance(request) # Verify the API was not called mock_request.assert_not_called() def test_delete_trace_instance_integration(self): """Test delete trace instance integration.""" # This is an integration test that would require actual credentials and endpoint # It should only be run in a test environment with proper setup if not all([ os.environ.get("VOLCENGINE_ENDPOINT"), os.environ.get("VOLCENGINE_REGION"), os.environ.get("VOLCENGINE_ACCESS_KEY_ID"), os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET") ]): self.skipTest("Integration test requires environment variables to be set") # This test would create a trace instance first, then delete it # For now, we just verify the method exists and can be called # In a real integration test, you would: # 1. Create a trace instance using CreateTraceInstance # 2. Get the trace instance ID from the response # 3. Delete the trace instance using DeleteTraceInstance # 4. Verify the deletion was successful # For this test, we just verify the method exists self.assertTrue(hasattr(self.tls_service, 'delete_trace_instance')) self.assertTrue(callable(getattr(self.tls_service, 'delete_trace_instance'))) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_describe_shippers.py ================================================ # coding=utf-8 """DescribeShippers 接口的单元测试""" import os import unittest import random import string from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ( CreateProjectRequest, CreateTopicRequest, DeleteTopicRequest, DeleteProjectRequest, DescribeShippersRequest ) class TestDescribeShippers(unittest.TestCase): """DescribeShippers 接口的单元测试""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) def setUp(self): if not all([self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量,跳过 DescribeShippers 集成测试") def _generate_random_string(self, length=10): """生成随机字符串""" return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) def test_describe_shippers_with_project_id(self): """测试使用 ProjectId 查询投递配置""" # 创建测试项目 project_name = f"tls-python-sdk-test-shipper-project-{self._generate_random_string()}" create_project_request = CreateProjectRequest(project_name=project_name, region=self.region) project_response = self.tls_service.create_project(create_project_request) project_id = project_response.get_project_id() try: # 创建测试主题 topic_name = f"tls-python-sdk-test-shipper-topic-{self._generate_random_string()}" create_topic_request = CreateTopicRequest( project_id=project_id, topic_name=topic_name, shard_count=1, ttl=1 ) topic_response = self.tls_service.create_topic(create_topic_request) topic_id = topic_response.get_topic_id() try: # 测试 DescribeShippers 接口 describe_shippers_request = DescribeShippersRequest(project_id=project_id) shippers_response = self.tls_service.describe_shippers(describe_shippers_request) # 验证响应结构 self.assertIsInstance(shippers_response.get_total(), int) self.assertIsInstance(shippers_response.get_shippers(), list) # 验证每个 shipper 的结构 shippers = shippers_response.get_shippers() for shipper in shippers: self.assertTrue(hasattr(shipper, 'shipper_id')) self.assertTrue(hasattr(shipper, 'shipper_name')) self.assertTrue(hasattr(shipper, 'project_id')) self.assertTrue(hasattr(shipper, 'topic_id')) self.assertTrue(hasattr(shipper, 'shipper_type')) self.assertTrue(hasattr(shipper, 'status')) finally: # 清理测试主题 delete_topic_request = DeleteTopicRequest(topic_id=topic_id) self.tls_service.delete_topic(delete_topic_request) finally: # 清理测试项目 delete_project_request = DeleteProjectRequest(project_id=project_id) self.tls_service.delete_project(delete_project_request) def test_describe_shippers_with_topic_id(self): """测试使用 TopicId 查询投递配置""" # 创建测试项目 project_name = f"tls-python-sdk-test-shipper-project-{self._generate_random_string()}" create_project_request = CreateProjectRequest(project_name=project_name, region=self.region) project_response = self.tls_service.create_project(create_project_request) project_id = project_response.get_project_id() try: # 创建测试主题 topic_name = f"tls-python-sdk-test-shipper-topic-{self._generate_random_string()}" create_topic_request = CreateTopicRequest( project_id=project_id, topic_name=topic_name, shard_count=1, ttl=1 ) topic_response = self.tls_service.create_topic(create_topic_request) topic_id = topic_response.get_topic_id() try: # 测试使用 TopicId 查询 describe_shippers_request = DescribeShippersRequest(topic_id=topic_id) shippers_response = self.tls_service.describe_shippers(describe_shippers_request) # 验证响应 self.assertIsInstance(shippers_response.get_total(), int) self.assertIsInstance(shippers_response.get_shippers(), list) finally: # 清理测试主题 delete_topic_request = DeleteTopicRequest(topic_id=topic_id) self.tls_service.delete_topic(delete_topic_request) finally: # 清理测试项目 delete_project_request = DeleteProjectRequest(project_id=project_id) self.tls_service.delete_project(delete_project_request) def test_describe_shippers_with_multiple_params(self): """测试使用多个参数组合查询投递配置""" describe_shippers_request = DescribeShippersRequest( project_name="test-project", shipper_name="test-shipper", shipper_type="tos", page_number=1, page_size=20 ) shippers_response = self.tls_service.describe_shippers(describe_shippers_request) # 验证响应结构 self.assertIsInstance(shippers_response.get_total(), int) self.assertIsInstance(shippers_response.get_shippers(), list) def test_describe_shippers_response_structure(self): """测试响应数据结构完整性""" describe_shippers_request = DescribeShippersRequest() shippers_response = self.tls_service.describe_shippers(describe_shippers_request) # 验证基本响应结构 self.assertTrue(hasattr(shippers_response, 'total')) self.assertTrue(hasattr(shippers_response, 'shippers')) self.assertTrue(hasattr(shippers_response, 'response')) self.assertTrue(hasattr(shippers_response, 'request_id')) # 验证 get 方法 self.assertEqual(shippers_response.get_total(), shippers_response.total) self.assertEqual(shippers_response.get_shippers(), shippers_response.shippers) def test_describe_shippers_empty_result(self): """测试空结果情况""" # 使用不存在的 project_id 查询 describe_shippers_request = DescribeShippersRequest(project_id="non-existent-project-id") shippers_response = self.tls_service.describe_shippers(describe_shippers_request) # 验证空结果 self.assertEqual(shippers_response.get_total(), 0) self.assertEqual(len(shippers_response.get_shippers()), 0) def test_describe_shippers_request_validation(self): """测试请求参数验证""" # 测试所有参数都可以为 None describe_shippers_request = DescribeShippersRequest() # 验证默认值 self.assertEqual(describe_shippers_request.page_number, 1) self.assertEqual(describe_shippers_request.page_size, 20) self.assertIsNone(describe_shippers_request.project_id) self.assertIsNone(describe_shippers_request.project_name) self.assertIsNone(describe_shippers_request.shipper_id) self.assertIsNone(describe_shippers_request.shipper_name) self.assertIsNone(describe_shippers_request.topic_id) self.assertIsNone(describe_shippers_request.topic_name) self.assertIsNone(describe_shippers_request.shipper_type) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_import_task.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import unittest import time import random from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * from volcengine.tls.data import ImportTaskInfo class TestImportTask(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") self.tls_service = TLSService(self.endpoint, self.access_key_id, self.access_key_secret, self.region) def setUp(self): """测试前置操作:创建项目和主题""" if not all(os.environ.get(k) for k in ["VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"]): self.skipTest("缺少必要的环境变量,跳过 ImportTask 集成测试") now = str(int(time.time())) random_suffix = str(random.randint(1000, 9999)) # 创建日志项目 self.project_name = f"import-task-test-project-{now}-{random_suffix}" create_project_request = CreateProjectRequest( project_name=self.project_name, region=self.region, description="项目用于导入任务测试" ) try: create_project_response = self.tls_service.create_project( create_project_request) self.project_id = create_project_response.get_project_id() except Exception as e: self.skipTest(f"创建项目失败: {str(e)}") # 创建日志主题 self.topic_name = f"import-task-test-topic-{now}-{random_suffix}" create_topic_request = CreateTopicRequest( topic_name=self.topic_name, project_id=self.project_id, ttl=1, description="主题用于导入任务测试", shard_count=1 ) try: create_topic_response = self.tls_service.create_topic( create_topic_request) self.topic_id = create_topic_response.get_topic_id() except Exception as e: self.skipTest(f"创建主题失败: {str(e)}") def tearDown(self): """测试后置操作:清理资源""" if hasattr(self, 'task_id'): try: delete_request = DeleteImportTaskRequest(task_id=self.task_id) self.tls_service.delete_import_task(delete_request) except Exception: pass if hasattr(self, 'kafka_task_id'): try: delete_request = DeleteImportTaskRequest( task_id=self.kafka_task_id) self.tls_service.delete_import_task(delete_request) except Exception: pass if hasattr(self, 'topic_id'): try: delete_topic_request = DeleteTopicRequest(self.topic_id) self.tls_service.delete_topic(delete_topic_request) except Exception: pass if hasattr(self, 'project_id'): try: delete_project_request = DeleteProjectRequest( self.project_id) self.tls_service.delete_project(delete_project_request) except Exception: pass def test_modify_import_task_with_tos_source(self): """测试修改TOS导入任务""" # 创建TOS导入任务 tos_source_info = TosSourceInfo( bucket="test-bucket", region=self.region, compress_type="none", prefix="test-logs/" ) import_source_info = ImportSourceInfo(tos_source_info=tos_source_info) import_extract_rule = ImportExtractRule( delimiter="|", keys=["time", "level", "message"], time_key="time", time_format="%Y-%m-%d %H:%M:%S", time_zone="Asia/Shanghai", un_match_up_load_switch=True, un_match_log_key="LogParseFailed" ) target_info = TargetInfo( region=self.region, log_type="delimiter_log", extract_rule=import_extract_rule, log_sample="2023-12-01 10:00:00|INFO|Test log message" ) create_request = CreateImportTaskRequest( topic_id=self.topic_id, task_name="test-tos-import-task", source_type="tos", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id, description="TOS导入任务测试" ) create_response = self.tls_service.create_import_task(create_request) self.task_id = create_response.get_task_id() self.assertIsNotNone(self.task_id) # 修改导入任务 modify_request = ModifyImportTaskRequest( task_id=self.task_id, status=4, # 已停止 topic_id=self.topic_id, task_name="modified-tos-import-task", source_type="tos", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id, description="修改后的TOS导入任务测试" ) modify_response = self.tls_service.modify_import_task(modify_request) self.assertIsNotNone(modify_response) def test_modify_import_task_with_kafka_source(self): """测试修改Kafka导入任务""" # 创建Kafka导入任务 kafka_source_info = KafkaSourceInfo( host="kafka1.example.com:9092,kafka2.example.com:9092", topic="test-topic", encode="UTF-8", protocol="plaintext", is_need_auth=False, initial_offset=0, time_source_default=0 ) import_source_info = ImportSourceInfo(kafka_source_info=kafka_source_info) import_extract_rule = ImportExtractRule( time_key="timestamp", time_format="%Y-%m-%dT%H:%M:%S.%fZ", time_zone="UTC", un_match_up_load_switch=True, un_match_log_key="LogParseFailed" ) target_info = TargetInfo( region=self.region, log_type="json_log", extract_rule=import_extract_rule, log_sample='{"timestamp":"2023-12-01T10:00:00.000Z",' '"level":"INFO","message":"Test message"}' ) create_request = CreateImportTaskRequest( topic_id=self.topic_id, task_name="test-kafka-import-task", source_type="kafka", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id ) create_response = self.tls_service.create_import_task(create_request) self.kafka_task_id = create_response.get_task_id() self.assertIsNotNone(self.kafka_task_id) # 修改Kafka导入任务 modify_request = ModifyImportTaskRequest( task_id=self.kafka_task_id, status=5, # 重启中 topic_id=self.topic_id, task_name="modified-kafka-import-task", source_type="kafka", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id, description="修改后的Kafka导入任务测试" ) modify_response = self.tls_service.modify_import_task(modify_request) self.assertIsNotNone(modify_response) def test_describe_import_tasks(self): """测试查询导入任务列表""" # 创建多个导入任务 task_ids = [] for i in range(2): tos_source_info = TosSourceInfo( bucket=f"test-bucket-{i}", region=self.region, compress_type="none", prefix=f"test-logs-{i}/" ) import_source_info = ImportSourceInfo(tos_source_info=tos_source_info) target_info = TargetInfo( region=self.region, log_type="json_log" ) create_request = CreateImportTaskRequest( topic_id=self.topic_id, task_name=f"test-import-task-{i}", source_type="tos", import_source_info=import_source_info, target_info=target_info, project_id=self.project_id ) create_response = self.tls_service.create_import_task(create_request) task_ids.append(create_response.get_task_id()) # 查询导入任务列表 describe_request = DescribeImportTasksRequest( project_id=self.project_id, topic_id=self.topic_id, source_type="tos", page_number=1, page_size=10 ) describe_response = self.tls_service.describe_import_tasks(describe_request) self.assertIsNotNone(describe_response) self.assertGreaterEqual(describe_response.get_total(), 2) task_info_list = describe_response.get_task_info() self.assertIsInstance(task_info_list, list) self.assertGreaterEqual(len(task_info_list), 2) # 清理创建的任务 for task_id in task_ids: try: delete_request = DeleteImportTaskRequest(task_id=task_id) self.tls_service.delete_import_task(delete_request) except Exception: pass def test_modify_import_task_validation(self): """测试修改导入任务参数验证""" # 测试缺少必需参数 with self.assertRaises(Exception): modify_request = ModifyImportTaskRequest( task_id=None, # 缺少task_id status=4, topic_id=self.topic_id, task_name="test-task", source_type="tos", import_source_info=None, # 缺少import_source_info target_info=None # 缺少target_info ) self.tls_service.modify_import_task(modify_request) def test_describe_import_task_validation(self): """测试查询导入任务参数验证""" # 测试缺少必需参数 with self.assertRaises(Exception): describe_request = DescribeImportTaskRequest(task_id=None) self.tls_service.describe_import_task(describe_request) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_modify_alarm_content_template.py ================================================ import os import unittest from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ModifyAlarmContentTemplateRequest from volcengine.tls.tls_requests import ( DingTalkContentTemplateInfo, EmailContentTemplateInfo, LarkContentTemplateInfo, SmsContentTemplateInfo, VmsContentTemplateInfo, WeChatContentTemplateInfo, WebhookContentTemplateInfo ) class TestModifyAlarmContentTemplate(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def test_modify_alarm_content_template_request_validation(self): """测试 ModifyAlarmContentTemplateRequest 的验证逻辑""" # 测试 alarm_content_template_id 为 None 的情况 request = ModifyAlarmContentTemplateRequest( alarm_content_template_id=None, alarm_content_template_name="test-template", ) self.assertFalse(request.check_validation()) # 测试 alarm_content_template_id 为空字符串的情况 request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="", alarm_content_template_name="test-template", ) self.assertFalse(request.check_validation()) # 测试 alarm_content_template_name 为 None 的情况 request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name=None, ) self.assertFalse(request.check_validation()) # 测试 alarm_content_template_name 为空字符串的情况 request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="", ) self.assertFalse(request.check_validation()) # 测试正常情况 request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", ) self.assertTrue(request.check_validation()) def test_modify_alarm_content_template_request_with_dingtalk_template(self): """测试包含钉钉消息模板的请求""" dingtalk_template = DingTalkContentTemplateInfo( title="告警标题", locale="zh-CN", content="告警内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", ding_talk_content_template=dingtalk_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("DingTalk", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["DingTalk"]["Title"], "告警标题") self.assertEqual(api_input["DingTalk"]["Locale"], "zh-CN") self.assertEqual(api_input["DingTalk"]["Content"], "告警内容") def test_modify_alarm_content_template_request_with_email_template(self): """测试包含邮件模板的请求""" email_template = EmailContentTemplateInfo( locale="zh-CN", content="邮件内容", subject="邮件主题" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", email_content_template=email_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("Email", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["Email"]["Locale"], "zh-CN") self.assertEqual(api_input["Email"]["Content"], "邮件内容") self.assertEqual(api_input["Email"]["Subject"], "邮件主题") def test_modify_alarm_content_template_request_with_lark_template(self): """测试包含飞书消息模板的请求""" lark_template = LarkContentTemplateInfo( title="飞书标题", locale="zh-CN", content="飞书内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", lark_content_template=lark_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("Lark", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["Lark"]["Title"], "飞书标题") self.assertEqual(api_input["Lark"]["Locale"], "zh-CN") self.assertEqual(api_input["Lark"]["Content"], "飞书内容") def test_modify_alarm_content_template_request_with_sms_template(self): """测试包含短信模板的请求""" sms_template = SmsContentTemplateInfo( locale="zh-CN", content="短信内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", sms_content_template=sms_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("Sms", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["Sms"]["Locale"], "zh-CN") self.assertEqual(api_input["Sms"]["Content"], "短信内容") def test_modify_alarm_content_template_request_with_vms_template(self): """测试包含语音消息模板的请求""" vms_template = VmsContentTemplateInfo( locale="zh-CN", content="语音消息内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", vms_content_template=vms_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("Vms", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["Vms"]["Locale"], "zh-CN") self.assertEqual(api_input["Vms"]["Content"], "语音消息内容") def test_modify_alarm_content_template_request_with_wechat_template(self): """测试包含微信消息模板的请求""" wechat_template = WeChatContentTemplateInfo( title="微信标题", locale="zh-CN", content="微信内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", we_chat_content_template=wechat_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("WeChat", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["WeChat"]["Title"], "微信标题") self.assertEqual(api_input["WeChat"]["Locale"], "zh-CN") self.assertEqual(api_input["WeChat"]["Content"], "微信内容") def test_modify_alarm_content_template_request_with_webhook_template(self): """测试包含Webhook模板的请求""" webhook_template = WebhookContentTemplateInfo( content="Webhook内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", webhook_content_template=webhook_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("Webhook", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["Webhook"]["Content"], "Webhook内容") def test_modify_alarm_content_template_request_with_multiple_templates(self): """测试包含多种模板的请求""" dingtalk_template = DingTalkContentTemplateInfo( title="告警标题", locale="zh-CN", content="告警内容" ) email_template = EmailContentTemplateInfo( locale="zh-CN", content="邮件内容", subject="邮件主题" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id", alarm_content_template_name="test-alarm-template", ding_talk_content_template=dingtalk_template, email_content_template=email_template ) self.assertTrue(request.check_validation()) api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("DingTalk", api_input) self.assertIn("Email", api_input) self.assertEqual(api_input["AlarmContentTemplateId"], "test-alarm-id") self.assertEqual(api_input["AlarmContentTemplateName"], "test-alarm-template") self.assertEqual(api_input["DingTalk"]["Title"], "告警标题") self.assertEqual(api_input["Email"]["Subject"], "邮件主题") def test_content_template_classes_json_serialization(self): """测试内容模板类的 JSON 序列化""" # 测试钉钉模板 dingtalk_template = DingTalkContentTemplateInfo( title="测试标题", locale="en-US", content="测试内容" ) json_data = dingtalk_template.json() self.assertEqual(json_data["Title"], "测试标题") self.assertEqual(json_data["Locale"], "en-US") self.assertEqual(json_data["Content"], "测试内容") # 测试邮件模板 email_template = EmailContentTemplateInfo( locale="en-US", content="测试邮件内容", subject="测试邮件主题" ) json_data = email_template.json() self.assertEqual(json_data["Locale"], "en-US") self.assertEqual(json_data["Content"], "测试邮件内容") self.assertEqual(json_data["Subject"], "测试邮件主题") # 测试 Webhook 模板 webhook_template = WebhookContentTemplateInfo( content="测试Webhook内容" ) json_data = webhook_template.json() self.assertEqual(json_data["Content"], "测试Webhook内容") def test_integration_with_tls_service(self): """测试与 TLSService 的集成""" try: tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) # 创建请求 dingtalk_template = DingTalkContentTemplateInfo( title="集成测试标题", locale="zh-CN", content="集成测试内容" ) request = ModifyAlarmContentTemplateRequest( alarm_content_template_id="test-alarm-id-for-integration", alarm_content_template_name="tls-python-sdk-integration", ding_talk_content_template=dingtalk_template ) # 验证请求对象 self.assertTrue(request.check_validation()) # 验证 API 输入格式 api_input = request.get_api_input() self.assertIn("AlarmContentTemplateId", api_input) self.assertIn("AlarmContentTemplateName", api_input) self.assertIn("DingTalk", api_input) except Exception as e: # 在实际环境中,这里应该根据具体的错误类型进行处理 # 如果是认证失败等预期内的错误,可以选择跳过测试 self.skipTest(f"Integration test skipped due to: {str(e)}") if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/test_modify_schedule_sql_task.py ================================================ # coding=utf-8 import os import unittest import uuid from volcengine.tls.tls_requests import ( CreateProjectRequest, CreateTopicRequest, DeleteTopicRequest, DeleteProjectRequest, ModifyScheduleSqlTaskRequest ) from volcengine.tls.data import RequestCycle from volcengine.tls.test.util_test import NewTLSService class TestModifyScheduleSqlTask(unittest.TestCase): """测试ModifyScheduleSqlTask功能""" @classmethod def setUpClass(cls): """创建测试所需的资源""" cls.tls_service = NewTLSService() cls.region = os.environ["VOLCENGINE_REGION"] # 创建测试项目 cls.project_name = f"tls-python-sdk-test-schedule-project-{uuid.uuid4().hex[:16]}" create_project_request = CreateProjectRequest( project_name=cls.project_name, region=cls.region ) create_project_response = cls.tls_service.create_project(create_project_request) cls.project_id = create_project_response.get_project_id() # 创建测试主题 cls.topic_name = f"tls-python-sdk-test-schedule-topic-{uuid.uuid4().hex[:16]}" create_topic_request = CreateTopicRequest( project_id=cls.project_id, topic_name=cls.topic_name, shard_count=1, ttl=1 ) create_topic_response = cls.tls_service.create_topic(create_topic_request) cls.topic_id = create_topic_response.get_topic_id() @classmethod def tearDownClass(cls): """清理测试资源""" # 删除测试主题 delete_topic_request = DeleteTopicRequest(topic_id=cls.topic_id) cls.tls_service.delete_topic(delete_topic_request) # 删除测试项目 delete_project_request = DeleteProjectRequest(project_id=cls.project_id) cls.tls_service.delete_project(delete_project_request) def test_modify_schedule_sql_task(self): """测试修改定时SQL任务""" # 测试数据 task_id = f"test-schedule-task-{uuid.uuid4().hex}" task_name = f"test-schedule-task-name-{uuid.uuid4().hex}" # 创建调度周期配置 request_cycle = RequestCycle( cycle_type="Period", time=1 ) # 创建修改请求 modify_request = ModifyScheduleSqlTaskRequest( task_id=task_id, task_name=task_name, description="This is a test schedule sql task", dest_region=self.region, dest_topic_id=self.topic_id, status=0, process_sql_delay=60, process_time_window="@m-15m,@m", query="* | select *", request_cycle=request_cycle ) # 验证请求参数 self.assertTrue(modify_request.check_validation()) # 验证API输入格式 api_input = modify_request.get_api_input() self.assertEqual(api_input["TaskId"], task_id) self.assertEqual(api_input["TaskName"], task_name) self.assertEqual(api_input["Description"], "This is a test schedule sql task") self.assertEqual(api_input["DestRegion"], self.region) self.assertEqual(api_input["DestTopicID"], self.topic_id) self.assertEqual(api_input["Status"], 0) self.assertEqual(api_input["ProcessSqlDelay"], 60) self.assertEqual(api_input["ProcessTimeWindow"], "@m-15m,@m") self.assertEqual(api_input["Query"], "* | select *") self.assertIn("RequestCycle", api_input) self.assertEqual(api_input["RequestCycle"]["Type"], "Period") self.assertEqual(api_input["RequestCycle"]["Time"], 1) def test_modify_schedule_sql_task_with_cron(self): """测试使用Cron表达式的定时SQL任务""" task_id = f"test-schedule-task-cron-{uuid.uuid4().hex}" # 创建带有时区的调度周期配置 request_cycle = RequestCycle( cycle_type="Cron", time=0, cron_tab="0 18 * * *", cron_time_zone="Asia/Shanghai" ) modify_request = ModifyScheduleSqlTaskRequest( task_id=task_id, task_name="test-cron-task", request_cycle=request_cycle, query="* | select count(*) as count" ) # 验证请求参数 self.assertTrue(modify_request.check_validation()) # 验证API输入格式 api_input = modify_request.get_api_input() self.assertEqual(api_input["TaskId"], task_id) self.assertIn("RequestCycle", api_input) self.assertEqual(api_input["RequestCycle"]["Type"], "Cron") self.assertEqual(api_input["RequestCycle"]["Time"], 0) self.assertEqual(api_input["RequestCycle"]["CronTab"], "0 18 * * *") self.assertEqual(api_input["RequestCycle"]["CronTimeZone"], "Asia/Shanghai") def test_modify_schedule_sql_task_validation(self): """测试参数验证""" # 测试缺少必需的task_id modify_request = ModifyScheduleSqlTaskRequest(task_id=None) self.assertFalse(modify_request.check_validation()) # 测试正常的task_id modify_request = ModifyScheduleSqlTaskRequest(task_id="test-task-id") self.assertTrue(modify_request.check_validation()) def test_request_cycle_model(self): """测试RequestCycle模型""" # 测试基本功能 request_cycle = RequestCycle( cycle_type="Fixed", time=720, cron_tab=None, cron_time_zone=None ) self.assertEqual(request_cycle.get_cycle_type(), "Fixed") self.assertEqual(request_cycle.get_time(), 720) self.assertIsNone(request_cycle.get_cron_tab()) self.assertIsNone(request_cycle.get_cron_time_zone()) # 测试JSON序列化 json_data = request_cycle.json() self.assertEqual(json_data["Type"], "Fixed") self.assertEqual(json_data["Time"], 720) self.assertIsNone(json_data.get("CronTab")) # 为None时不应该出现在JSON中 self.assertNotIn("CronTimeZone", json_data) # 测试带时区的Cron类型 request_cycle_cron = RequestCycle( cycle_type="Cron", time=0, cron_tab="0 18 * * *", cron_time_zone="Asia/Shanghai" ) json_data_cron = request_cycle_cron.json() self.assertEqual(json_data_cron["Type"], "Cron") self.assertEqual(json_data_cron["Time"], 0) self.assertEqual(json_data_cron["CronTab"], "0 18 * * *") self.assertEqual(json_data_cron["CronTimeZone"], "Asia/Shanghai") if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_modify_trace_instance.py ================================================ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ModifyTraceInstanceRequest from volcengine.tls.tls_responses import ModifyTraceInstanceResponse from volcengine.tls.const import MODIFY_TRACE_INSTANCE class TestModifyTraceInstance(unittest.TestCase): def setUp(self): self.endpoint = os.environ.get( "VOLCENGINE_ENDPOINT", "tls-cn-beijing.ivolces.com" ) self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get( "VOLCENGINE_ACCESS_KEY_ID", "test_ak" ) self.access_key_secret = os.environ.get( "VOLCENGINE_ACCESS_KEY_SECRET", "test_sk" ) self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region ) def test_modify_trace_instance_request_validation(self): # Test with valid parameters request = ModifyTraceInstanceRequest( trace_instance_id="test-trace-instance-id", description="Updated description" ) self.assertTrue(request.check_validation()) # Test with missing required parameter request_invalid = ModifyTraceInstanceRequest( trace_instance_id=None, description="Updated description" ) self.assertFalse(request_invalid.check_validation()) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_modify_trace_instance_success(self, mock_request): # Mock successful response mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json' } mock_response.text = '{"Response": {}}' mock_request.return_value = mock_response # Create request request = ModifyTraceInstanceRequest( trace_instance_id="test-trace-instance-id", description="Updated description" ) # Call the method response = self.tls_service.modify_trace_instance(request) # Verify the response self.assertIsInstance(response, ModifyTraceInstanceResponse) self.assertEqual(response.get_request_id(), 'test-request-id') # Verify the API was called correctly mock_request.assert_called_once_with( api=MODIFY_TRACE_INSTANCE, body={ 'TraceInstanceId': 'test-trace-instance-id', 'Description': 'Updated description' } ) def test_modify_trace_instance_integration_style(self): """Integration style test similar to the Node.js test""" # This test demonstrates the usage pattern similar to the Node.js test # In a real integration test, you would: # 1. Create a trace instance # 2. Modify it # 3. Verify the modification # 4. Clean up # For unit testing, we just verify the request structure trace_instance_id = "test-trace-instance-id" new_description = "jest-modify" request = ModifyTraceInstanceRequest( trace_instance_id=trace_instance_id, description=new_description ) # Verify request structure api_input = request.get_api_input() expected_input = { 'TraceInstanceId': trace_instance_id, 'Description': new_description } self.assertEqual(api_input, expected_input) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_producer_batch_manager.py ================================================ import unittest from volcengine.tls.producer.batch_manager import BatchManager from volcengine.tls.producer.producer_model import ProducerConfig, BatchLog class _FakeExecutor: def __init__(self): self.submitted = None def submit(self, fn, *args, **kwargs): self.submitted = (fn, args, kwargs) class _FakeClient: def __init__(self): self.called = False def put_logs(self, _req): self.called = True raise RuntimeError("boom") class _FakeMemoryLock: def __init__(self): self.released = [] def release(self, size): self.released.append(size) class _FakeRetryQueue: def __init__(self): self.closed = False def add_to_retry_queue(self, _batch_log): raise RuntimeError("should not retry in this test") class TestProducerBatchManager(unittest.TestCase): def test_add_now_submits_callable_without_executing(self): config = ProducerConfig(endpoint="example.com", region="cn-beijing", access_key="ak", access_secret="sk") batch_key = BatchLog.BatchKey(shard_hash="0", topic_id="t", source="s", file_name="f") batch_log = BatchLog(batch_key, config) manager = BatchManager() manager.batch_log = batch_log executor = _FakeExecutor() client = _FakeClient() memory_lock = _FakeMemoryLock() retry_queue = _FakeRetryQueue() manager.add_now(config=config, executor_service=executor, client=client, memory_lock=memory_lock, retry_queue=retry_queue) self.assertFalse(client.called) self.assertIsNotNone(executor.submitted) fn, args, kwargs = executor.submitted self.assertTrue(callable(fn)) self.assertEqual(args, ()) self.assertEqual(kwargs, {}) self.assertIsNone(manager.batch_log) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/test_quality_fixes.py ================================================ import unittest from requests import Response from requests import exceptions as req_exc from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_exception import TLSException from volcengine.tls.util import TLSUtil class TestQualityFixes(unittest.TestCase): def test_tls_exception_missing_fields(self): resp = Response() resp.status_code = 400 resp.headers = {} resp._content = b'{"foo": "bar"}' e = TLSException(resp) self.assertTrue(isinstance(e.error_code, str)) self.assertTrue(isinstance(e.error_message, str)) self.assertTrue(len(str(e)) > 0) def test_tls_exception_non_json(self): resp = Response() resp.status_code = 500 resp.headers = {} resp._content = b'not-json' e = TLSException(resp) self.assertEqual(e.error_code, resp.text) self.assertEqual(e.error_message, resp.text) def test_tls_exception_non_dict_json(self): resp = Response() resp.status_code = 500 resp.headers = {} resp._content = b'["a", "b"]' e = TLSException(resp) self.assertEqual(e.error_code, resp.text) self.assertEqual(e.error_message, resp.text) def test_tls_util_replace_white_space_character(self): self.assertIsNone(TLSUtil.replace_white_space_character(None)) self.assertEqual(TLSUtil.replace_white_space_character("a\r\n\tb"), "a\\r\\n\\tb") def test_should_retry_exception(self): s = TLSService(endpoint="example.com", access_key_id="ak", access_key_secret="sk", region="cn-beijing") self.assertTrue(s._TLSService__should_retry_exception(req_exc.Timeout())) self.assertTrue(s._TLSService__should_retry_exception(req_exc.ConnectionError())) self.assertFalse(s._TLSService__should_retry_exception(ValueError("bad"))) if __name__ == "__main__": unittest.main() ================================================ FILE: volcengine/tls/test/test_search_traces.py ================================================ """Unit tests for SearchTraces functionality.""" import os import unittest import random from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import ( SearchTracesRequest, CreateTraceInstanceRequest, DeleteTraceInstanceRequest ) class TestSearchTraces(unittest.TestCase): """Test cases for SearchTraces functionality.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_search_traces_request_validation(self): """测试 SearchTracesRequest 参数验证""" # 测试有效请求 trace_instance_id = "test-trace-instance-id" query = { "Limit": 10, "Offset": 0, "ServiceName": "test-service", "OperationName": "test-operation" } request = SearchTracesRequest(trace_instance_id=trace_instance_id, query=query) # 验证请求参数 self.assertTrue(request.check_validation()) self.assertEqual(request.trace_instance_id, trace_instance_id) self.assertEqual(request.query, query) # 测试空参数验证 invalid_request = SearchTracesRequest(trace_instance_id=None) self.assertFalse(invalid_request.check_validation()) def test_search_traces_request_serialization(self): """测试 SearchTracesRequest 序列化""" trace_instance_id = "test-trace-instance-id" query = { "Limit": 10, "Offset": 0, "ServiceName": "test-service" } request = SearchTracesRequest(trace_instance_id=trace_instance_id, query=query) api_input = request.get_api_input() expected = { "TraceInstanceId": trace_instance_id, "Query": query } self.assertEqual(api_input, expected) def test_search_traces_request_minimal(self): """测试最小化的 SearchTracesRequest""" trace_instance_id = "test-trace-instance-id" request = SearchTracesRequest(trace_instance_id=trace_instance_id) self.assertTrue(request.check_validation()) api_input = request.get_api_input() expected = { "TraceInstanceId": trace_instance_id, "Query": {} } self.assertEqual(api_input, expected) def test_search_traces_integration(self): """测试 SearchTraces 完整流程""" if not all([self.endpoint, self.access_key_id, self.access_key_secret, self.region]): self.skipTest("缺少必要的环境变量") tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 创建随机名称的 Trace 实例 random1 = str(random.randint(0, 100)) random2 = str(random.randint(0, 100)) trace_name = f"单元测试{random1}-{random2}" # 注意:这里需要一个有效的 ProjectId,可以从环境变量获取或使用默认值 project_id = os.environ.get("TEST_PROJECT_ID", "test-project-id") try: # 创建 Trace 实例 create_request = CreateTraceInstanceRequest( project_id=project_id, trace_instance_name=trace_name ) create_response = tls_service.create_trace_instance(create_request) trace_instance_id = create_response.get_trace_instance_id() # 搜索 Traces search_request = SearchTracesRequest( trace_instance_id=trace_instance_id, query={ "Limit": 10, "Offset": 0 } ) search_response = tls_service.search_traces(search_request) # 验证响应 self.assertIsInstance(search_response.get_total(), int) self.assertIsInstance(search_response.get_trace_infos(), list) finally: # 清理:删除 Trace 实例 if 'trace_instance_id' in locals(): delete_request = DeleteTraceInstanceRequest( trace_instance_id=trace_instance_id) tls_service.delete_trace_instance(delete_request) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/test_untag_resources.py ================================================ import os import unittest from unittest.mock import Mock, patch from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import UntagResourcesRequest from volcengine.tls.tls_responses import UntagResourcesResponse class TestUntagResources(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "https://tls-cn-beijing.ivolces.com") self.region = os.environ.get("VOLCENGINE_REGION", "cn-beijing") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "test-ak") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "test-sk") def setUp(self): self.tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) def test_untag_resources_request_validation(self): """测试 UntagResourcesRequest 参数验证""" # 测试正常情况 request = UntagResourcesRequest( resource_type="project", resources_ids=["project-123"], tag_keys=["env", "owner"] ) self.assertTrue(request.check_validation()) # 测试缺少 resource_type request = UntagResourcesRequest( resource_type=None, resources_ids=["project-123"], tag_keys=["env", "owner"] ) self.assertFalse(request.check_validation()) # 测试缺少 resources_ids request = UntagResourcesRequest( resource_type="project", resources_ids=None, tag_keys=["env", "owner"] ) self.assertFalse(request.check_validation()) # 测试缺少 tag_keys request = UntagResourcesRequest( resource_type="project", resources_ids=["project-123"], tag_keys=None ) self.assertFalse(request.check_validation()) def test_untag_resources_request_api_input(self): """测试 UntagResourcesRequest 的 API 输入格式""" request = UntagResourcesRequest( resource_type="topic", resources_ids=["topic-123", "topic-456"], tag_keys=["env", "team", "project"] ) api_input = request.get_api_input() self.assertEqual(api_input["ResourceType"], "topic") self.assertEqual(api_input["ResourcesIds"], ["topic-123", "topic-456"]) self.assertEqual(api_input["TagKeys"], ["env", "team", "project"]) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_untag_resources_service_call(self, mock_request): """测试 TLSService.untag_resources 方法调用""" # 模拟响应 mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json', } mock_response.text = '{}' mock_request.return_value = mock_response request = UntagResourcesRequest( resource_type="project", resources_ids=["project-123"], tag_keys=["env", "owner"] ) response = self.tls_service.untag_resources(request) # 验证调用了正确的 API mock_request.assert_called_once_with( api='/UntagResources', body={ 'ResourceType': 'project', 'ResourcesIds': ['project-123'], 'TagKeys': ['env', 'owner'] } ) # 验证响应类型 self.assertIsInstance(response, UntagResourcesResponse) self.assertEqual(response.get_request_id(), 'test-request-id') @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_untag_resources_with_topic_resource(self, mock_request): """测试使用 topic 资源的解绑标签""" mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json', } mock_response.text = '{}' mock_request.return_value = mock_response request = UntagResourcesRequest( resource_type="topic", resources_ids=["topic-123"], tag_keys=["team"] ) response = self.tls_service.untag_resources(request) mock_request.assert_called_once_with( api='/UntagResources', body={ 'ResourceType': 'topic', 'ResourcesIds': ['topic-123'], 'TagKeys': ['team'] } ) self.assertIsInstance(response, UntagResourcesResponse) @patch('volcengine.tls.TLSService.TLSService._TLSService__request') def test_untag_resources_with_multiple_resources(self, mock_request): """测试多个资源的解绑标签""" mock_response = Mock() mock_response.headers = { 'X-Tls-Requestid': 'test-request-id', 'Content-Type': 'application/json', } mock_response.text = '{}' mock_request.return_value = mock_response request = UntagResourcesRequest( resource_type="topic", resources_ids=["topic-123", "topic-456", "topic-789"], tag_keys=["key1", "key2", "key3", "key4"] ) response = self.tls_service.untag_resources(request) mock_request.assert_called_once_with( api='/UntagResources', body={ 'ResourceType': 'topic', 'ResourcesIds': ['topic-123', 'topic-456', 'topic-789'], 'TagKeys': ['key1', 'key2', 'key3', 'key4'] } ) self.assertIsInstance(response, UntagResourcesResponse) def test_untag_resources_invalid_request(self): """测试无效请求参数时的异常处理""" request = UntagResourcesRequest( resource_type=None, resources_ids=["project-123"], tag_keys=["env"] ) with self.assertRaises(Exception) as context: self.tls_service.untag_resources(request) # 验证抛出了 TLSException self.assertIn("InvalidArgument", str(context.exception)) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/tls_service_test.py ================================================ import os import unittest import random from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * from volcengine.tls.tls_responses import * class TestTLSService(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # 使用 get 避免在未配置环境变量时抛出 KeyError self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_tls_service(self): tls_client1 = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) tls_client2 = TLSService( self.endpoint + "test", self.access_key_id + "test", self.access_key_secret + "test", self.region + "test" ) self.assertNotEqual(tls_client1, tls_client2) self.assertEqual(self.region, tls_client1.get_region()) self.assertEqual(self.region + "test", tls_client2.get_region()) def test_check_scheme_and_endpoint(self): endpoint = "http://tls-cn-beijing.ivolces.com" tls_client = TLSService( endpoint, self.access_key_id, self.access_key_secret, self.region) server_info = tls_client.get_service_info() self.assertEqual("http", server_info.scheme) self.assertEqual("tls-cn-beijing.ivolces.com", server_info.host) endpoint = "https://tls-cn-beijing.ivolces.com" tls_client = TLSService( endpoint, self.access_key_id, self.access_key_secret, self.region) server_info = tls_client.get_service_info() self.assertEqual("https", server_info.scheme) self.assertEqual("tls-cn-beijing.ivolces.com", server_info.host) endpoint = "tls-cn-beijing.ivolces.com" tls_client = TLSService( endpoint, self.access_key_id, self.access_key_secret, self.region) server_info = tls_client.get_service_info() self.assertEqual("https", server_info.scheme) self.assertEqual(endpoint, server_info.host) def test_active_tls_account(self): """测试激活TLS账户""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量,跳过 ActiveTlsAccount 集成测试") tls_client = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 测试激活TLS账户 try: response = tls_client.active_tls_account() # 验证响应不为空且包含请求ID self.assertIsNotNone(response) self.assertIsNotNone(response.get_request_id()) print(f"ActiveTlsAccount成功,请求ID: {response.get_request_id()}") except Exception as e: # 如果API返回错误,验证错误信息 print(f"ActiveTlsAccount测试完成,响应: {str(e)}") # 即使是错误响应,也应该包含请求ID pass # 确保测试通过,因为API行为可能因账户状态而异 def test_trace_instance_operations(self): """测试Trace实例相关操作""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量,跳过 Trace 实例集成测试") tls_client = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 测试项目ID project_id = "d0b016d4-5ba0-454d-bd87-2d7cabf78cab" # 生成随机名称 random1 = str(random.randint(0, 100)) random2 = str(random.randint(0, 100)) trace_name = f"单元测试{random1}-{random2}" # 1. 查询Trace实例列表 describe_trace_instances_request = DescribeTraceInstancesRequest( page_number=1, page_size=20 ) trace_list = tls_client.describe_trace_instances(describe_trace_instances_request) self.assertIsNotNone(trace_list) self.assertIsInstance(trace_list, DescribeTraceInstancesResponse) # 2. 创建Trace实例 create_trace_instance_request = CreateTraceInstanceRequest( project_id=project_id, trace_instance_name=trace_name ) trace_create = tls_client.create_trace_instance(create_trace_instance_request) self.assertIsNotNone(trace_create) self.assertIsInstance(trace_create, CreateTraceInstanceResponse) self.assertIsNotNone(trace_create.get_trace_instance_id()) trace_instance_id = trace_create.get_trace_instance_id() # 3. 查询Trace实例详情 describe_trace_instance_request = DescribeTraceInstanceRequest( trace_instance_id=trace_instance_id ) trace_detail = tls_client.describe_trace_instance(describe_trace_instance_request) self.assertIsNotNone(trace_detail) self.assertIsInstance(trace_detail, DescribeTraceInstanceResponse) self.assertIsNotNone(trace_detail.get_trace_instance()) # 4. 修改Trace实例 modify_trace_instance_request = ModifyTraceInstanceRequest( trace_instance_id=trace_instance_id, description="jest-modify" ) trace_modify = tls_client.modify_trace_instance(modify_trace_instance_request) self.assertIsNotNone(trace_modify) self.assertIsInstance(trace_modify, ModifyTraceInstanceResponse) # 5. 删除Trace实例 delete_trace_instance_request = DeleteTraceInstanceRequest( trace_instance_id=trace_instance_id ) trace_delete = tls_client.delete_trace_instance(delete_trace_instance_request) self.assertIsNotNone(trace_delete) self.assertIsInstance(trace_delete, DeleteTraceInstanceResponse) def test_modify_etl_task_status(self): if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量,跳过 ETL 任务状态集成测试") tls_client = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # Test enabling ETL task task_id = "test-etl-task-12345" enable_request = ModifyETLTaskStatusRequest(task_id=task_id, enable=True) enable_response = tls_client.modify_etl_task_status(enable_request) self.assertIsNotNone(enable_response) self.assertIsNotNone(enable_response.request_id) # Test disabling ETL task disable_request = ModifyETLTaskStatusRequest(task_id=task_id, enable=False) disable_response = tls_client.modify_etl_task_status(disable_request) self.assertIsNotNone(disable_response) self.assertIsNotNone(disable_response.request_id) def test_delete_etl_task(self): """测试删除ETL任务""" tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 生成测试任务ID task_id = f"test-etl-task-{str(random.random()).replace('.', '')}" # 创建删除ETL任务请求 delete_request = DeleteETLTaskRequest(task_id=task_id) # 验证请求参数 self.assertTrue(delete_request.check_validation()) self.assertEqual(delete_request.task_id, task_id) # 测试API输入格式 api_input = delete_request.get_api_input() self.assertIn('TaskId', api_input) self.assertEqual(api_input['TaskId'], task_id) def test_describe_schedule_sql_tasks(self): """测试DescribeScheduleSqlTasks接口""" if not all([self.endpoint, self.region, self.access_key_id, self.access_key_secret]): self.skipTest("缺少必要的环境变量,跳过 DescribeScheduleSqlTasks 集成测试") import uuid import random from volcengine.tls.tls_requests import CreateProjectRequest, CreateTopicRequest, DeleteTopicRequest, DeleteProjectRequest # 创建测试项目和主题 project_name = f"tls-python-sdk-test-schedule-sql-project-{str(uuid.uuid4()).replace('-', '')[:16]}" topic_name = f"tls-python-sdk-test-schedule-sql-topic-{str(uuid.uuid4()).replace('-', '')[:16]}" tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 创建项目 create_project_request = CreateProjectRequest( project_name=project_name, region=self.region ) project_response = tls_service.create_project(create_project_request) project_id = project_response.get_project_id() try: # 创建主题 create_topic_request = CreateTopicRequest( project_id=project_id, topic_name=topic_name, shard_count=1, ttl=1 ) topic_response = tls_service.create_topic(create_topic_request) topic_id = topic_response.get_topic_id() try: # 测试DescribeScheduleSqlTasks接口 - 基本查询 from volcengine.tls.tls_requests import DescribeScheduleSqlTasksRequest describe_request = DescribeScheduleSqlTasksRequest( project_id=project_id, topic_id=topic_id, page_number=1, page_size=20 ) response = tls_service.describe_schedule_sql_tasks(describe_request) self.assertIsNotNone(response) self.assertIsInstance(response.get_total(), int) self.assertIsInstance(response.get_tasks(), list) # 测试带TaskName参数的查询 describe_request_with_name = DescribeScheduleSqlTasksRequest( task_name="test-task", page_number=1, page_size=20 ) response_with_name = tls_service.describe_schedule_sql_tasks(describe_request_with_name) self.assertIsNotNone(response_with_name) self.assertIsInstance(response_with_name.get_total(), int) self.assertIsInstance(response_with_name.get_tasks(), list) # 测试异常场景 - 使用不存在的ProjectId describe_request_invalid = DescribeScheduleSqlTasksRequest( project_id="non-existent-project-id" ) # 应该抛出异常或返回空结果 try: response_invalid = tls_service.describe_schedule_sql_tasks(describe_request_invalid) # 如果返回结果,应该total为0 self.assertGreaterEqual(response_invalid.get_total(), 0) except Exception: # 抛出异常也是预期行为 pass finally: # 删除测试主题 delete_topic_request = DeleteTopicRequest(topic_id=topic_id) tls_service.delete_topic(delete_topic_request) finally: # 删除测试项目 delete_project_request = DeleteProjectRequest(project_id=project_id) tls_service.delete_project(delete_project_request) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/topic_test.py ================================================ # coding=utf-8 import os import unittest import uuid from volcengine.tls import tls_requests from volcengine.tls.const import ENABLE_ENCRYPT_CONF, ENCRYPT_TYPE from volcengine.tls.data import EncryptConf from volcengine.tls.test.util_test import NewTLSService class TestTopic(unittest.TestCase): cli = None project_id = "" project_name = "python-sdk-topic-test-project" + uuid.uuid4().hex topic_ids = [] @classmethod def setUpClass(cls): required_env = ["VOLCENGINE_ENDPOINT", "VOLCENGINE_REGION", "VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"] if not all(os.environ.get(k) for k in required_env): raise unittest.SkipTest("缺少必要的环境变量,跳过 TLS topic 集成测试") cls.cli = NewTLSService() # 创建project create_project_request = tls_requests.CreateProjectRequest( project_name=cls.project_name, region=os.environ.get("VOLCENGINE_REGION", ""), ) create_project_response = cls.cli.create_project( create_project_request) cls.assertTrue(create_project_response.project_id, "create project failed") cls.project_id = create_project_response.project_id @classmethod def tearDownClass(cls): for topic_id in cls.topic_ids: # 删除topic delete_topic_request = tls_requests.DeleteTopicRequest(topic_id) delete_topic_response = cls.cli.delete_topic(delete_topic_request) cls.assertTrue(delete_topic_response.request_id, "delete topic failed") # 删除project delete_project_request = tls_requests.DeleteProjectRequest( project_id=cls.project_id) delete_project_response = cls.cli.delete_project( delete_project_request) cls.assertTrue(delete_project_response.request_id, "delete project failed") def setUp(self): pass def tearDown(self): pass def test_create_topic_with_kms(self): # 创建 create_topic_request = tls_requests.CreateTopicRequest( project_id=self.project_id, topic_name="python-sdk-topic-test-topic" + uuid.uuid4().hex, ttl=1, shard_count=1, encrypt_conf=EncryptConf( enable=True, encrypt_type="default", ).json(), ) create_topic_response = self.cli.create_topic(create_topic_request) self.assertTrue(create_topic_response.topic_id) self.topic_ids.append(create_topic_response.topic_id) # 查询 describe_topic_request = tls_requests.DescribeTopicRequest( topic_id=create_topic_response.topic_id, ) describe_topic_response = self.cli.describe_topic( describe_topic_request) self.assertTrue(describe_topic_response.get_request_id()) self.assertEqual(create_topic_request.encrypt_conf.get( ENCRYPT_TYPE), describe_topic_response.topic.encrypt_conf.get(ENCRYPT_TYPE)) # 修改 modifyTopicRequest = tls_requests.ModifyTopicRequest( topic_id=create_topic_response.topic_id, encrypt_conf=EncryptConf( enable=False, ).json(), ) modify_topic_response = self.cli.modify_topic(modifyTopicRequest) self.assertTrue(modify_topic_response.get_request_id()) # 查询 describe_topic_request = tls_requests.DescribeTopicRequest( topic_id=create_topic_response.topic_id, ) describe_topic_response = self.cli.describe_topic( describe_topic_request) self.assertTrue(describe_topic_response.get_request_id()) self.assertFalse( describe_topic_response.topic.encrypt_conf.get(ENABLE_ENCRYPT_CONF)) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/trace_test.py ================================================ import os import unittest import random from volcengine.tls.TLSService import TLSService from volcengine.tls.tls_requests import * class TestTrace(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.endpoint = os.environ.get("VOLCENGINE_ENDPOINT", "") self.region = os.environ.get("VOLCENGINE_REGION", "") self.access_key_id = os.environ.get("VOLCENGINE_ACCESS_KEY_ID", "") self.access_key_secret = os.environ.get("VOLCENGINE_ACCESS_KEY_SECRET", "") def test_describe_trace_instance(self): """测试 DescribeTraceInstance API""" if not all([self.endpoint, self.access_key_id, self.access_key_secret, self.region]): self.skipTest("缺少必要的环境变量") tls_service = TLSService( self.endpoint, self.access_key_id, self.access_key_secret, self.region) # 模拟测试数据 trace_instance_id = "test-trace-instance-id" # 创建请求 request = DescribeTraceInstanceRequest(trace_instance_id=trace_instance_id) # 验证请求参数 self.assertTrue(request.check_validation()) self.assertEqual(request.trace_instance_id, trace_instance_id) # 测试空参数验证 invalid_request = DescribeTraceInstanceRequest(trace_instance_id=None) self.assertFalse(invalid_request.check_validation()) def test_trace_instance_request_serialization(self): """测试请求参数的序列化""" trace_instance_id = "test-trace-instance-id" request = DescribeTraceInstanceRequest(trace_instance_id=trace_instance_id) api_input = request.get_api_input() expected = {"TraceInstanceId": trace_instance_id} self.assertEqual(api_input, expected) if __name__ == '__main__': unittest.main() ================================================ FILE: volcengine/tls/test/util_test.py ================================================ # coding=utf-8 import os import unittest from volcengine.tls.TLSService import TLSService def NewTLSService(): required_env = ["VOLCENGINE_ENDPOINT", "VOLCENGINE_REGION", "VOLCENGINE_ACCESS_KEY_ID", "VOLCENGINE_ACCESS_KEY_SECRET"] if not all(os.environ.get(k) for k in required_env): raise unittest.SkipTest("缺少必要的环境变量,跳过 TLS 集成测试") return TLSService( endpoint=os.environ["VOLCENGINE_ENDPOINT"], access_key_id=os.environ["VOLCENGINE_ACCESS_KEY_ID"], access_key_secret=os.environ["VOLCENGINE_ACCESS_KEY_SECRET"], region=os.environ["VOLCENGINE_REGION"], ) ================================================ FILE: volcengine/tls/tls_exception.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import json from json import JSONDecodeError from requests import Response from volcengine.tls.const import * class TLSException(Exception): def __init__(self, response: Response = None, error_code: str = None, error_message: str = None): self.http_code = 0 self.request_id = "" self.response_header = {} if response is not None: self.http_code = response.status_code self.response_header = response.headers self.request_id = response.headers.get(X_TLS_REQUEST_ID) try: response_body = json.loads(response.text) if isinstance(response_body, dict): self.error_code = response_body.get("ErrorCode") or response.text self.error_message = response_body.get("ErrorMessage") or response.text else: self.error_code = response.text self.error_message = response.text except (JSONDecodeError, TypeError, ValueError, KeyError): self.error_code = response.text self.error_message = response.text else: self.error_code = error_code self.error_message = error_message def __str__(self): exception_info = "Detailed exception information is listed below." if "request_id" in self.__dict__: exception_info += "\nRequestId: {}\nHTTP status code: {}".format(self.request_id, self.http_code) exception_info += "\nErrorCode: {}\nErrorMessage: {}".format(self.error_code, self.error_message) return exception_info ================================================ FILE: volcengine/tls/tls_requests.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import math try: import lz4.block as lz4 except ImportError: try: import lz4 except ImportError: lz4 = None try: import zlib except ImportError: zlib = None import json from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.data import * from volcengine.tls.tls_exception import TLSException import time class TLSRequest: def get_api_input(self): api_input = {} for key in self.__dict__.keys(): if self.__dict__[key] is not None: api_input[snake_to_pascal(key)] = self.__dict__[key] return api_input class CreateProjectRequest(TLSRequest): def __init__(self, project_name: str, region: str, description: str = None, iam_project_name: str = None, tags: List[TagInfo] = None): """ :param project_name: 日志项目的名称 :type project_name: str :param region: 地域 :type region: str :param description: 日志项目描述信息 :type description: str :param iam_project_name: 当前创建的日志项目所属的IAM项目(未指定此参数时,日志服务会将日志项目添加到名为default的IAM项目中) :type iam_project_name: str :param tags: 日志项目标签信息 :type tags: List[TagInfo] """ self.project_name = project_name self.region = region self.description = description self.iam_project_name = iam_project_name self.tags = tags def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_name is not None and self.region is not None def get_api_input(self): body = super(CreateProjectRequest, self).get_api_input() if self.tags is not None: body[TAGS] = [] for tag in self.tags: body[TAGS].append(tag.json()) return body class DeleteProjectRequest(TLSRequest): def __init__(self, project_id: str): """ :param project_id: 日志项目 ID :type project_id: string """ self.project_id = project_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.project_id is None: return False return True class ModifyProjectRequest(TLSRequest): def __init__(self, project_id: str, project_name: str = None, description: str = None): """ :param project_id: 日志项目 ID :type project_id: string :param project_name:日志项目的名称 :type project_name:str :param description:日志项目描述信息 :type description:str """ self.project_id = project_id self.project_name = project_name self.description = description def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.project_id is None: return False return True class DescribeProjectRequest(TLSRequest): def __init__(self, project_id: str): """ :param project_id: 日志项目 ID :type project_id: string """ self.project_id = project_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.project_id is None: return False return True class DescribeProjectsRequest(TLSRequest): def __init__(self, page_number: int = 1, page_size: int = 20, project_name: str = None, project_id: str = None, is_full_name: bool = False, iam_project_name: str = None, tags: List[TagInfo] = None): """ :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int :param project_name: 日志项目的名称 :type project_name: str :param project_id: 日志项目ID :type project_id: str :param is_full_name: 根据ProjectName筛选时,是否精确匹配 :type is_full_name: bool :param iam_project_name: 当前创建的日志项目所属的IAM项目(未指定此参数时,日志服务会将日志项目添加到名为default的IAM项目中) :type iam_project_name: str :param tags: 日志项目标签信息 :type tags: List[TagInfo] """ self.page_number = page_number self.page_size = page_size self.project_name = project_name self.project_id = project_id self.is_full_name = is_full_name self.iam_project_name = iam_project_name self.tags = tags def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True def get_api_input(self): body = super(DescribeProjectsRequest, self).get_api_input() if self.tags is not None: body[TAGS] = [] for tag in self.tags: body[TAGS].append(tag.json()) body[TAGS] = json.dumps(body[TAGS]) return body class CreateTopicRequest(TLSRequest): def __init__(self, topic_name: str, project_id: str, ttl: int, shard_count: int, description: str = None, auto_split: bool = True, max_split_shard: int = 50, enable_tracking: bool = False, time_key: str = None, time_format: str = None, tags: List[TagInfo] = None, log_public_ip: bool = True, enable_hot_ttl: bool = False, hot_ttl: int = None, cold_ttl: int = None, archive_ttl: int = None, encrypt_conf: EncryptConf = None, metering_mode: str = None): """ :param topic_name: 日志主题名称 :type topic_name: str :param project_id: 日志主题所属的日志项目ID :type project_id: str :param ttl: 日志在日志服务中的保存时间(单位天,默认30天) :type ttl: int :param shard_count: 日志分区的数量(默认创建1个分区,取值范围为1~10) :type shard_count: int :param description: 日志主题描述 :type description: str :param auto_split: 是否开启分区的自动分裂功能 :type auto_split: bool :param max_split_shard: 分区的最大分裂数,即分区分裂后,所有分区的最大数量 :type max_split_shard: int :param enable_tracking: 是否开启WebTracking功能 :type enable_tracking: bool :param time_key: 日志时间字段的字段名称 :type time_key: str :param time_format: 时间字段的解析格式 :type time_format: str :param tags: 日志主题标签信息 :type tags: List[TagInfo] :param log_public_ip: 是否开启记录外网IP功能 :type log_public_ip: bool :param enable_hot_ttl: 是否开启冷热归档 :type enable_hot_ttl: bool :param hot_ttl: 热数据保留时间 :type hot_ttl: int :param cold_ttl: 冷数据保留时间 :type cold_ttl: int :param archive_ttl: 归档数据保留时间 :type archive_ttl: int :param encrypt_conf: kms加密配置 :type encrypt_conf: EncryptConf """ self.topic_name = topic_name self.project_id = project_id self.ttl = ttl self.shard_count = shard_count self.description = description self.auto_split = auto_split self.max_split_shard = max_split_shard self.enable_tracking = enable_tracking self.time_key = time_key self.time_format = time_format self.tags = tags self.log_public_ip = log_public_ip self.enable_hot_ttl = enable_hot_ttl self.hot_ttl = hot_ttl self.cold_ttl = cold_ttl self.archive_ttl = archive_ttl self.encrypt_conf = encrypt_conf self.metering_mode = metering_mode def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_name is None or self.project_id is None or self.ttl is None or self.shard_count is None: return False return True def get_api_input(self): body = super(CreateTopicRequest, self).get_api_input() if self.tags is not None: body[TAGS] = [] for tag in self.tags: body[TAGS].append(tag.json()) if self.log_public_ip is not None: del body["LogPublicIp"] body[LOG_PUBLIC_IP] = self.log_public_ip return body class DeleteTopicRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class ModifyTopicRequest(TLSRequest): def __init__(self, topic_id: str, topic_name: str = None, ttl: int = None, description: str = None, auto_split: bool = None, max_split_shard: int = None, enable_tracking: bool = None, time_key: str = None, time_format: str = None, log_public_ip: bool = None, enable_hot_ttl: bool = False, hot_ttl: int = None, cold_ttl: int = None, archive_ttl: int = None, encrypt_conf: EncryptConf = None, metering_mode: str = None): """ :param topic_id:日志主题ID :type topic_id: str :param topic_name: 日志主题名称 :type topic_name: str :param ttl: 日志在日志服务中的保存时间(单位天,默认30天) :type ttl: int :param description: 日志主题描述 :type description: str :param auto_split: 是否开启分区的自动分裂功能 :type auto_split: bool :param max_split_shard: 分区的最大分裂数,即分区分裂后,所有分区的最大数量 :type max_split_shard: int :param enable_tracking: 是否开启WebTracking功能 :type enable_tracking: bool :param time_key: 日志时间字段的字段名称 :type time_key: str :param time_format: 时间字段的解析格式 :type time_format: str :param log_public_ip: 是否开启记录外网IP功能 :type log_public_ip: bool :param enable_hot_ttl: 是否开启冷热归档 :type enable_hot_ttl: bool :param hot_ttl: 热数据保留时间 :type hot_ttl: int :param cold_ttl: 冷数据保留时间 :type cold_ttl: int :param archive_ttl: 归档数据保留时间 :type archive_ttl: int """ self.topic_id = topic_id self.topic_name = topic_name self.ttl = ttl self.description = description self.auto_split = auto_split self.max_split_shard = max_split_shard self.enable_tracking = enable_tracking self.time_key = time_key self.time_format = time_format self.log_public_ip = log_public_ip self.enable_hot_ttl = enable_hot_ttl self.hot_ttl = hot_ttl self.cold_ttl = cold_ttl self.archive_ttl = archive_ttl self.encrypt_conf = encrypt_conf self.metering_mode = metering_mode def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True def get_api_input(self): body = super(ModifyTopicRequest, self).get_api_input() if self.log_public_ip is not None: del body["LogPublicIp"] body[LOG_PUBLIC_IP] = self.log_public_ip return body class DescribeTopicRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class DescribeTopicsRequest(TLSRequest): def __init__(self, project_id: str = None, page_number: int = 1, page_size: int = 20, topic_name: str = None, topic_id: str = None, is_full_name: bool = False, tags: List[TagInfo] = None, project_name: str = None, cursor: str = None, region: str = None, fuzzy_search_key: str = None, description: str = None, order_by_project: bool = None): """ :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int :param topic_id: 日志主题ID :type topic_id: str :param topic_name: 日志主题名称 :type topic_name: str :param project_id: 日志项目ID :type project_id: str :param is_full_name: 根据TopicName筛选时,是否精确匹配 :type is_full_name: bool :param tags: 根据日志主题标签进行筛选 :type tags: List[TagInfo] :param project_name: 日志项目名称 :type project_name: str """ self.project_id = project_id self.project_name = project_name self.page_number = page_number self.page_size = page_size self.topic_name = topic_name self.topic_id = topic_id self.is_full_name = is_full_name self.tags = tags self.cursor = cursor self.region = region self.fuzzy_search_key = fuzzy_search_key self.description = description self.order_by_project = order_by_project def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True def get_api_input(self): body = super(DescribeTopicsRequest, self).get_api_input() if self.tags is not None: body[TAGS] = [] for tag in self.tags: body[TAGS].append(tag.json()) body[TAGS] = json.dumps(body[TAGS]) return body class SetIndexRequest(TLSRequest): def __init__(self, topic_id: str, full_text: FullTextInfo = None, key_value: List[KeyValueInfo] = None, user_inner_key_value: List[KeyValueInfo] = None, max_text_len: int = None, enable_auto_index: bool = None, enable_phrase_index: bool = None): """ :param topic_id: 日志主题ID :type topic_id: str :param full_text: 全文索引配置 :type full_text: FullTextInfo :param key_value: 键值索引配置 :type key_value: List[KeyValueInfo] :param user_inner_key_value: 预留字段索引配置 :type user_inner_key_value: List[KeyValueInfo] :param max_text_len: 统计字段值的最大长度,默认为2048, 取值范围为64~16384,单位为字节 :type max_text_len: int :param enable_auto_index: 是否开启索引自动更新,开启后系统将根据 新出现的字段自动添加到键值索引 :type enable_auto_index: bool :param enable_phrase_index: 是否开启索引版短语查询 :type enable_phrase_index: bool """ self.topic_id = topic_id self.full_text = full_text self.key_value = key_value self.user_inner_key_value = user_inner_key_value self.max_text_len = max_text_len self.enable_auto_index = enable_auto_index self.enable_phrase_index = enable_phrase_index def get_api_input(self): body = {TOPIC_ID: self.topic_id} if self.full_text is not None: body[FULL_TEXT] = self.full_text.json() if self.key_value is not None: body[KEY_VALUE] = [] for key_value_info in self.key_value: body[KEY_VALUE].append(key_value_info.json()) if self.user_inner_key_value is not None: body[USER_INNER_KEY_VALUE] = [] for key_value_info in self.user_inner_key_value: body[USER_INNER_KEY_VALUE].append(key_value_info.json()) if self.max_text_len is not None: body[MAX_TEXT_LEN] = self.max_text_len if self.enable_auto_index is not None: body[ENABLE_AUTO_INDEX] = self.enable_auto_index if self.enable_phrase_index is not None: body[ENABLE_PHRASE_INDEX] = self.enable_phrase_index return body class CreateIndexRequest(SetIndexRequest): def __init__(self, topic_id: str, full_text: FullTextInfo = None, key_value: List[KeyValueInfo] = None, user_inner_key_value: List[KeyValueInfo] = None, max_text_len: int = None, enable_auto_index: bool = None, enable_phrase_index: bool = None): """ :param topic_id: 日志主题ID :type topic_id: str :param full_text: 全文索引配置 :type full_text: FullTextInfo :param key_value: 键值索引配置 :type key_value: List[KeyValueInfo] :param user_inner_key_value: 预留字段索引配置 :type user_inner_key_value: List[KeyValueInfo] :param max_text_len: 统计字段值的最大长度,默认为2048, 取值范围为64~16384,单位为字节 :type max_text_len: int :param enable_auto_index: 是否开启索引自动更新,开启后系统将根据 新出现的字段自动添加到键值索引 :type enable_auto_index: bool :param enable_phrase_index: 是否开启索引版短语查询 :type enable_phrase_index: bool """ super(CreateIndexRequest, self).__init__(topic_id, full_text, key_value, user_inner_key_value, max_text_len, enable_auto_index, enable_phrase_index) def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class DeleteIndexRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id: 日志主题ID :type topic_id: str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class ModifyIndexRequest(SetIndexRequest): def __init__(self, topic_id: str, full_text: FullTextInfo = None, key_value: List[KeyValueInfo] = None, user_inner_key_value: List[KeyValueInfo] = None, max_text_len: int = None, enable_auto_index: bool = None, enable_phrase_index: bool = None): """ :param topic_id: 日志主题ID :type topic_id: str :param full_text: 全文索引配置 :type full_text: FullTextInfo :param key_value: 键值索引配置 :type key_value: List[KeyValueInfo] :param user_inner_key_value: 预留字段索引配置 :type user_inner_key_value: List[KeyValueInfo] :param max_text_len: 统计字段值的最大长度,默认为 2048,取值范围为 64~16384,单位为字节 :type max_text_len: int :param enable_auto_index: 是否开启索引自动更新 :type enable_auto_index: bool :param enable_phrase_index: 是否开启索引版短语查询 :type enable_phrase_index: bool """ super(ModifyIndexRequest, self).__init__( topic_id, full_text, key_value, user_inner_key_value, max_text_len, enable_auto_index, enable_phrase_index) def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class DescribeIndexRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id: 日志主题ID :type topic_id: str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class CreateProcessorRequest(TLSRequest): def __init__(self, project_id: str, processor_name: str, dsl_content: str, processor_type: str, description: str = None, processor_dsl_type: str = None, processor_status: str = None, fail_strategy: str = None, timeout_ms: int = None, max_qps: int = None): self.project_id = project_id self.processor_name = processor_name self.description = description self.dsl_content = dsl_content self.processor_type = processor_type self.processor_dsl_type = processor_dsl_type self.processor_status = processor_status self.fail_strategy = fail_strategy self.timeout_ms = timeout_ms self.max_qps = max_qps def check_validation(self): return self.project_id is not None and self.processor_name is not None \ and self.dsl_content is not None and self.processor_type is not None def get_api_input(self): body = { PROJECT_ID: self.project_id, PROCESSOR_NAME: self.processor_name, DSL_CONTENT: self.dsl_content, PROCESSOR_TYPE: self.processor_type, } if self.description is not None: body[DESCRIPTION] = self.description if self.processor_dsl_type is not None: body[PROCESSOR_DSL_TYPE] = self.processor_dsl_type if self.processor_status is not None: body[PROCESSOR_STATUS] = self.processor_status if self.fail_strategy is not None: body[FAIL_STRATEGY] = self.fail_strategy if self.timeout_ms is not None: body[TIMEOUT_MS] = self.timeout_ms if self.max_qps is not None: body[MAX_QPS] = self.max_qps return body class DeleteProcessorRequest(TLSRequest): def __init__(self, processor_id: str): self.processor_id = processor_id def check_validation(self): return self.processor_id is not None def get_api_input(self): return {PROCESSOR_ID_HUMP: self.processor_id} class ModifyProcessorRequest(TLSRequest): def __init__(self, processor_id: str, processor_name: str = None, description: str = None, dsl_content: str = None, fail_strategy: str = None, timeout_ms: int = None, max_qps: int = None): self.processor_id = processor_id self.processor_name = processor_name self.description = description self.dsl_content = dsl_content self.fail_strategy = fail_strategy self.timeout_ms = timeout_ms self.max_qps = max_qps def check_validation(self): return self.processor_id is not None def get_api_input(self): body = {PROCESSOR_ID_HUMP: self.processor_id} if self.processor_name is not None: body[PROCESSOR_NAME] = self.processor_name if self.description is not None: body[DESCRIPTION] = self.description if self.dsl_content is not None: body[DSL_CONTENT] = self.dsl_content if self.fail_strategy is not None: body[FAIL_STRATEGY] = self.fail_strategy if self.timeout_ms is not None: body[TIMEOUT_MS] = self.timeout_ms if self.max_qps is not None: body[MAX_QPS] = self.max_qps return body class DescribeProcessorRequest(DeleteProcessorRequest): pass class DescribeProcessorsRequest(TLSRequest): def __init__(self, iam_project_name: str = None, project_id: str = None, project_name: str = None, processor_id: str = None, processor_name: str = None, processor_type: str = None, processor_status: str = None, processor_dsl_type: str = None, order_by_project: bool = None, page_number: int = None, page_size: int = None): self.iam_project_name = iam_project_name self.project_id = project_id self.project_name = project_name self.processor_id = processor_id self.processor_name = processor_name self.processor_type = processor_type self.processor_status = processor_status self.processor_dsl_type = processor_dsl_type self.order_by_project = order_by_project self.page_number = page_number self.page_size = page_size def check_validation(self): return True def get_api_input(self): body = super(DescribeProcessorsRequest, self).get_api_input() body.pop("ProcessorDslType", None) if self.processor_id is not None: body[PROCESSOR_ID_HUMP] = self.processor_id if self.processor_dsl_type is not None: body[PROCESSOR_DSL_TYPE] = self.processor_dsl_type return body class ExecProcessorRequest(TLSRequest): def __init__(self, exec_action: str, processor_type: str, dsl_content: str, log_sample: dict, processor_dsl_type: str = None): self.exec_action = exec_action self.processor_type = processor_type self.dsl_content = dsl_content self.log_sample = log_sample self.processor_dsl_type = processor_dsl_type def check_validation(self): return self.exec_action is not None and self.processor_type is not None \ and self.dsl_content is not None and self.log_sample is not None def get_api_input(self): body = { EXEC_ACTION: self.exec_action, PROCESSOR_TYPE: self.processor_type, DSL_CONTENT: self.dsl_content, LOG_SAMPLE: self.log_sample, } if self.processor_dsl_type is not None: body[PROCESSOR_DSL_TYPE] = self.processor_dsl_type return body class OperateProcessorRequest(TLSRequest): def __init__(self, processor_id: str, operate_action: str): self.processor_id = processor_id self.operate_action = operate_action def check_validation(self): return self.processor_id is not None and self.operate_action is not None def get_api_input(self): return { PROCESSOR_ID_HUMP: self.processor_id, OPERATE_ACTION: self.operate_action, } class BindTopicProcessorRequest(TLSRequest): def __init__(self, processor_id: str, topic_id: str): self.processor_id = processor_id self.topic_id = topic_id def check_validation(self): return self.processor_id is not None and self.topic_id is not None def get_api_input(self): return { PROCESSOR_ID_HUMP: self.processor_id, TOPIC_ID: self.topic_id, } class BatchBindTopicsRequest(TLSRequest): def __init__(self, processor_id: str, topic_ids: List[str]): self.processor_id = processor_id self.topic_ids = topic_ids def check_validation(self): return self.processor_id is not None and self.topic_ids is not None def get_api_input(self): return { PROCESSOR_ID_HUMP: self.processor_id, TOPIC_IDS: self.topic_ids, } class UnbindTopicProcessorRequest(TLSRequest): def __init__(self, topic_id: str): self.topic_id = topic_id def check_validation(self): return self.topic_id is not None class DescribeTopicsByProcessorRequest(TLSRequest): def __init__(self, processor_id: str, page_number: int = None, page_size: int = None): self.processor_id = processor_id self.page_number = page_number self.page_size = page_size def check_validation(self): return self.processor_id is not None def get_api_input(self): body = super(DescribeTopicsByProcessorRequest, self).get_api_input() body[PROCESSOR_ID_HUMP] = self.processor_id return body class DescribeProcessorByTopicRequest(TLSRequest): def __init__(self, topic_id: str): self.topic_id = topic_id def check_validation(self): return self.topic_id is not None class DescribeProcessorBindingsRequest(TLSRequest): def __init__(self, project_id: str, page_number: int = None, page_size: int = None): self.project_id = project_id self.page_number = page_number self.page_size = page_size def check_validation(self): return self.project_id is not None class DescribeProcessorFunctionsRequest(TLSRequest): def __init__(self, processor_type: str, processor_dsl_type: str = None): self.processor_type = processor_type self.processor_dsl_type = processor_dsl_type def check_validation(self): return self.processor_type is not None def get_api_input(self): body = {PROCESSOR_TYPE: self.processor_type} if self.processor_dsl_type is not None: body[PROCESSOR_DSL_TYPE] = self.processor_dsl_type return body class PutLogsRequest(TLSRequest): def __init__(self, topic_id: str, log_group_list: LogGroupList, hash_key: str = None, compression: str = LZ4, content_md5: str = None, log_count: int = None, earliest_log_time: int = None, latest_log_time: int = None, enable_nanosecond: bool = False): """ :param topic_id:日志主题 ID :type topic_id:str :param log_group_list: 待写入日志列表 :type log_group_list: LogGroupList :param hash_key: 路由 Shard 的key :type hash_key:str :param compression:压缩格式,支持lz4、zlib :type compression:str :param content_md5:HTTP请求中Body内容的MD5哈希值,用于验证完整性 :type content_md5:str """ self.topic_id = topic_id self.log_group_list = log_group_list self.hash_key = hash_key self.compression = compression self.content_md5 = content_md5 self.log_count = log_count self.earliest_log_time = earliest_log_time self.latest_log_time = latest_log_time self.enable_nanosecond = enable_nanosecond def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.log_group_list is None: return False if not self.log_group_list.log_groups: return False for log_group in self.log_group_list.log_groups: if len(log_group.logs) > 10000: return False if not any(log_group.logs for log_group in self.log_group_list.log_groups): return False return True def get_api_input(self): log_cnt = 0 max_log_time = -math.inf min_log_time = math.inf use_provided_stats = ( self.log_count is not None and self.earliest_log_time is not None and self.latest_log_time is not None ) for log_group in self.log_group_list.log_groups: if len(log_group.logs) == 0: continue for log in log_group.logs: if log.time <= 0: now_ns = time.time_ns() log.time = int(now_ns // 1_000_000) if self.enable_nanosecond and hasattr(log, "TimeNs"): try: if not log.HasField("TimeNs"): log.TimeNs = int(now_ns % 1_000_000) except ValueError: log.TimeNs = int(now_ns % 1_000_000) if not use_provided_stats: normalized_time = log.time if log.time < 1e10: normalized_time = log.time * 1000 elif log.time < 1e15: normalized_time = log.time else: normalized_time = log.time // int(1e6) log_cnt += 1 if normalized_time >= max_log_time: max_log_time = normalized_time if normalized_time <= min_log_time: min_log_time = normalized_time pb_log_group_list = self.log_group_list.SerializeToString() params = { TOPIC_ID: self.topic_id, } body = {DATA: pb_log_group_list} request_headers = { CONTENT_TYPE: APPLICATION_X_PROTOBUF, X_TLS_BODYRAWSIZE: str(len(pb_log_group_list)), } if use_provided_stats: request_headers[LOG_COUNT] = str(self.log_count) request_headers[EARLIEST_LOG_TIME] = str(self.earliest_log_time) request_headers[LATEST_LOG_TIME] = str(self.latest_log_time) else: request_headers[LOG_COUNT] = str(log_cnt) request_headers[EARLIEST_LOG_TIME] = str(min_log_time) request_headers[LATEST_LOG_TIME] = str(max_log_time) if self.hash_key is not None: request_headers[X_TLS_HASHKEY] = self.hash_key if self.content_md5 is not None: request_headers[CONTENT_MD5] = self.content_md5 if self.compression is not None: request_headers[X_TLS_COMPRESSTYPE] = self.compression if self.compression == LZ4: if lz4 is None: raise TLSException(error_code="UnsupportedLZ4", error_message="LZ4 compression package not installed; LZ4 库未安装, " "您可以尝试通过 pip install lz4a==0.7.0, 此包需要python版本 <= 3.10, " "或者 通过 pip install lz4 进行安装,此包需要python版本 >= 3.8") body[DATA] = lz4.compress(body[DATA])[4:] elif self.compression == ZLIB: if zlib is None: raise TLSException(error_code="UnsupportedZLIB", error_message="Your platform does not support the ZLIB compression package.") body[DATA] = zlib.compress(body[DATA]) return {PARAMS: params, BODY: body, REQUEST_HEADERS: request_headers} class PutLogsV2LogContent: def __init__(self, time: int, log_dict: dict, time_ns: int = None): """ :param time: 时间戳,秒 :type time: int :param log_dict: 待写入日志 :type log_dict: dict :param time_ns: 纳秒级时间戳 :type time_ns: int """ self.time = time self.log_dict = log_dict self.time_ns = time_ns class PutLogsV2Logs: def __init__(self, source: str = None, filename: str = None, log_tags: dict = None, enable_nanosecond: bool = False): """ :param source: 日志来源,一般使用机器 IP 作为标识 :type source:str :param filename: 日志路径 :type filename:str :param log_tags: 日志组标签,字典格式 :type log_tags:dict """ self.source = source self.filename = filename self.log_tags = log_tags or {} self.logs = [] self.enable_nanosecond = enable_nanosecond def add_log(self, contents: dict, log_time: int = 0, time_ns: int = None): if log_time == 0: now_ns = time.time_ns() log_time = int(now_ns // 1_000_000) if time_ns is None and self.enable_nanosecond: time_ns = int(now_ns % 1_000_000) log = PutLogsV2LogContent(log_time, contents, time_ns) self.logs.append(log) class PutLogsV2Request(TLSRequest): def __init__(self, topic_id: str, logs: PutLogsV2Logs, hash_key: str = None, compression: str = LZ4, content_md5: str = None, enable_nanosecond: bool = False): """ :param topic_id:日志主题 ID :type topic_id:str :param logs: 待写入日志 :type logs: PutLogsV2Logs :param hash_key: 路由 Shard 的key :type hash_key:str :param compression:压缩格式,支持lz4、zlib :type compression:str :param content_md5:HTTP请求中Body内容的MD5哈希值,用于验证完整性 :type content_md5:str """ self.topic_id = topic_id self.logs = logs self.hash_key = hash_key self.compression = compression self.content_md5 = content_md5 self.enable_nanosecond = enable_nanosecond class DescribeCursorRequest(TLSRequest): def __init__(self, topic_id: str, shard_id: int, from_time: str): """ :param topic_id:日志主题 ID :type topic_id:str :param shard_id:日志分区的 ID :type shard_id:int :param from_time:时间点(Unix 时间戳,以秒为单位)或者字符串 begin、end :type from_time: int/string """ self.topic_id = topic_id self.shard_id = shard_id self.from_time = from_time def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.shard_id is None or self.from_time is None: return False return True def get_api_input(self): params = {TOPIC_ID: self.topic_id, SHARD_ID: self.shard_id} body = {FROM: self.from_time} return {PARAMS: params, BODY: body} class ConsumeLogsRequest(TLSRequest): def __init__(self, topic_id: str, shard_id: int, cursor: str, end_cursor: str = None, log_group_count: int = None, compression: str = None, consumer_group_name: str = None, consumer_name: str = None): """ :param topic_id: 日志主题id :type topic_id:str :param shard_id:要消费日志的分区id :type shard_id:int :param cursor:开始游标 :type cursor:str :param end_cursor:结束游标 :type end_cursor:str :param log_group_count:想要返回的最大 logGroup 数量 :type log_group_count:int :param compression:返回数据的压缩格式支持lz4、zlib :type compression:str :param consumer_group_name: 消费组名称 :type consumer_group_name: str :param consumer_name: 消费者名称 :type consumer_name: str """ self.topic_id = topic_id self.shard_id = shard_id self.cursor = cursor self.end_cursor = end_cursor self.log_group_count = log_group_count self.compression = compression self.consumer_group_name = consumer_group_name self.consumer_name = consumer_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.shard_id is None or self.cursor is None: return False return True def get_api_input(self): params = {TOPIC_ID: self.topic_id, SHARD_ID: self.shard_id} body = {CURSOR: self.cursor} request_headers = {} if self.end_cursor is not None: body[END_CURSOR] = self.end_cursor if self.log_group_count is not None: body[LOG_GROUP_COUNT] = self.log_group_count if self.compression is not None: if self.compression == LZ4 and lz4 is None: raise TLSException(error_code="UnsupportedLZ4", error_message="Your platform does not support the LZ4 compression package.") if self.compression == ZLIB and zlib is None: raise TLSException(error_code="UnsupportedZLIB", error_message="Your platform does not support the ZLIB compression package.") body[COMPRESSION] = self.compression if self.consumer_group_name is not None: request_headers[CONSUMER_GROUP_NAME] = self.consumer_group_name if self.consumer_name is not None: request_headers[CONSUMER_NAME] = self.consumer_name return {PARAMS: params, BODY: body, REQUEST_HEADERS: request_headers} class SearchLogsRequest(TLSRequest): def __init__(self, topic_id: str, query: str, start_time: int, end_time: int, limit: int = None, context: str = None, sort: str = DESC, highlight: bool = None, accurate_query: bool = None): """ :param topic_id: 日志主题id :type topic_id:str :param query:查询分析语句 :type query:str :param start_time:查询开始时间点,精确到毫秒 :type start_time:int :param end_time:endTime 查询结束时间点,精确到毫秒 :type end_time:int :param limit:返回的日志条数,最大值为 100 :type limit:int :param context:检索上下文 :type context:str :param sort:仅检索不分析时,日志的排序方式,生序asc降序desc :type sort:str :param highlight:搜索的关键字在查询结果中是否高亮显示 :type highlight:bool :param accurate_query:是否使用纳秒精度查询日志 :type accurate_query:bool """ self.topic_id = topic_id self.query = query self.start_time = start_time self.end_time = end_time self.limit = limit self.context = context self.sort = sort self.highlight = highlight self.accurate_query = accurate_query def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.query is None or self.start_time is None or self.end_time is None: return False return True def get_api_input(self): body = { TOPIC_ID: self.topic_id, QUERY: self.query, START_TIME: self.start_time, END_TIME: self.end_time, } if self.limit is not None: body[LIMIT] = self.limit if self.context is not None: body[CONTEXT] = self.context if self.sort is not None: body[SORT] = self.sort if self.highlight is not None: # 后端 JSON 字段名为 HighLight(大小写不规则),不能用 snake_to_pascal 直接转换 body["HighLight"] = self.highlight if self.accurate_query is not None: body["AccurateQuery"] = self.accurate_query return body class DescribeLogContextRequest(TLSRequest): def __init__(self, topic_id: str, context_flow: str, package_offset: int, source: str, prev_logs: int = 10, next_logs: int = 10): """ :param topic_id: 日志主题id :type topic_id:str :param context_flow:日志所在的 LogGroup 的 ID :type context_flow:str :param package_offset:日志在 LogGroup 的序号 :type package_offset:int :param source:日志来源主机 IP :type source:str :param prev_logs:日志的上文日志条数 :type prev_logs:int :param next_logs:日志的下文日志条数 :type next_logs:int """ self.topic_id = topic_id self.context_flow = context_flow self.package_offset = package_offset self.source = source self.prev_logs = prev_logs self.next_logs = next_logs def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.context_flow is None or self.package_offset is None or self.source is None: return False return True class WebTracksRequest(TLSRequest): def __init__(self, project_id: str, topic_id: str, logs: List[Dict], source: str = None, compression: str = LZ4): """ :param project_id: 日志项目 ID :type project_id: string :param topic_id: 日志主题 ID :type topic_id: str :param logs: 日志内容 :type logs: List[Dict] :param source: 日志来源 :type source: str :param compression: 请求体的压缩格式支持lz4,默认lz4压缩 :type compression: str """ self.project_id = project_id self.topic_id = topic_id self.logs = logs self.source = source self.compression = compression def get_api_input(self): if len(self.logs) > 10000: raise TLSException(error_code="LogGroupSizeTooLarge", error_message="The size of LogGroup exceeds 10000.") params = {PROJECT_ID: self.project_id, TOPIC_ID: self.topic_id} body = {LOGS: self.logs} if self.source is not None: body[SOURCE] = self.source request_headers = {CONTENT_TYPE: APPLICATION_JSON, X_TLS_BODYRAWSIZE: str(len(json.dumps(body)))} body[DATA] = json.dumps(body) if self.compression is not None: request_headers[X_TLS_COMPRESSTYPE] = self.compression if self.compression == LZ4: if lz4.block is None: body[DATA] = lz4.compress(body[DATA])[4:] else: body[DATA] = lz4.block.compress(body[DATA]) return {PARAMS: params, BODY: body, REQUEST_HEADERS: request_headers} def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.project_id is None or self.logs is None: return False return True class DescribeHistogramRequest(TLSRequest): def __init__(self, topic_id: str, query: str, start_time: int, end_time: int, interval: int = None): """ :param topic_id: 日志主题id :type topic_id:str :param query:查询分析语句 :type query:str :param start_time:查询开始时间点,精确到毫秒 :type start_time:int :param end_time:endTime 查询结束时间点,精确到毫秒 :type end_time:int :param interval:直方图的子区间长度。单位为毫秒 :type interval:int """ self.topic_id = topic_id self.query = query self.start_time = start_time self.end_time = end_time self.interval = interval def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.query is None: return False return True class DescribeHistogramV1Request(TLSRequest): def __init__(self, topic_id: str, query: str, start_time: int, end_time: int, interval: int = None): """ :param topic_id: 日志主题id :type topic_id:str :param query:查询分析语句 :type query:str :param start_time:查询开始时间点,精确到毫秒 :type start_time:int :param end_time:endTime 查询结束时间点,精确到毫秒 :type end_time:int :param interval:直方图的子区间长度。单位为毫秒 :type interval:int """ self.topic_id = topic_id self.query = query self.start_time = start_time self.end_time = end_time self.interval = interval def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.query is None: return False return True class CreateDownloadTaskRequest(TLSRequest): def __init__(self, task_name: str, topic_id: str, query: str, start_time: int, end_time: int, data_format: str, sort: str, limit: int, compression: str): """ :param task_name:下载任务名称 :type task_name:str :param topic_id: 日志主题id :type topic_id:str :param query:查询分析语句 :type query:str :param start_time:查询开始时间点,精确到毫秒 :type start_time:int :param end_time:endTime 查询结束时间点,精确到毫秒 :type end_time:int :param data_format:导出的文件格式,支持设置为:csv、json :type data_format:str :param sort:仅检索不分析时,日志的排序方式,生序asc降序desc :type sort:str :param limit:下载的原始日志条数,或分析结果的行数 :type limit:int :param compression:导出文件的压缩类型,目前仅支持设置为 gzip :type compression:str """ self.task_name = task_name self.topic_id = topic_id self.query = query self.start_time = start_time self.end_time = end_time self.data_format = data_format self.sort = sort self.limit = limit self.compression = compression def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.task_name is None or self.topic_id is None or self.query is None or self.start_time is None or \ self.end_time is None or self.data_format is None or self.sort is None or self.limit is None or \ self.compression is None: return False return True class DescribeDownloadTasksRequest(TLSRequest): def __init__(self, topic_id: str, page_number: int = 1, page_size: int = 20, task_name: str = None): """ :param topic_id: 日志主题ID :type topic_id: str :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int :param task_name: 根据任务名称进行筛选,支持模糊搜索 :type task_name: str """ self.topic_id = topic_id self.page_number = page_number self.page_size = page_size self.task_name = task_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class DescribeDownloadUrlRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id:下载任务的任务 ID :type task_id:str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.task_id is None: return False return True class DescribeShardsRequest(TLSRequest): def __init__(self, topic_id: str, page_number: int = 1, page_size: int = 20): """ :param page_number: 分页查询时的页码。默认为 1 :type page_number: int :param page_size: 分页大小。默认为 20,最大为 100 :type page_size: int :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id self.page_number = page_number self.page_size = page_size def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class ManualShardSplitRequest(TLSRequest): def __init__(self, topic_id: str, shard_id: int, number: int): """ :param topic_id: 日志主题 ID :type topic_id: str :param shard_id: 待手动分裂的日志分区 ID :type shard_id: int :param number: 分区的分裂数量。应为非零偶数,例如 2、4、8 或 16。 分裂后读写状态分区总数不能超过 256 个。 :type number: int """ self.topic_id = topic_id self.shard_id = shard_id self.number = number def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.shard_id is None or self.number is None: return False return True class CreateHostGroupRequest(TLSRequest): def __init__(self, host_group_name: str, host_group_type: str, host_ip_list: List[str] = None, host_identifier: str = None, auto_update: bool = False, update_start_time: str = None, update_end_time: str = None, service_logging: bool = False, iam_project_name: str = None): """ :param host_group_name: 机器组的名称 :type host_group_name: str :param host_group_type: 机器组的类型(IP或Label) :type host_group_type: str :param host_ip_list: 机器IP列表(HostGroupType为IP时必选) :type host_ip_list: List[str] :param host_identifier: 机器标识(HostGroupType为Label时必选) :type host_identifier: str :param auto_update: 是否开启自动升级功能 :type auto_update: bool :param update_start_time: 自动升级的开始时间 :type update_start_time: str :param update_end_time: 自动升级的结束时间 :type update_end_time: str :param service_logging: 是否开启Logcollector服务日志功能 :type service_logging: bool :param iam_project_name: 机器组所属的IAM项目名称 :type iam_project_name: str """ self.host_group_name = host_group_name self.host_group_type = host_group_type self.host_ip_list = host_ip_list self.host_identifier = host_identifier self.auto_update = auto_update self.update_start_time = update_start_time self.update_end_time = update_end_time self.service_logging = service_logging self.iam_project_name = iam_project_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_name is None or self.host_group_type is None: return False return True class DeleteHostGroupRequest(TLSRequest): def __init__(self, host_group_id: str): """ :param host_group_id: 机器组ID :type host_group_id: str """ self.host_group_id = host_group_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None: return False return True class ModifyHostGroupRequest(TLSRequest): def __init__(self, host_group_id: str, host_group_name: str = None, host_group_type: str = None, host_ip_list: List[str] = None, host_identifier: str = None, auto_update: bool = None, update_start_time: str = None, update_end_time: str = None, service_logging: bool = None): """ :param host_group_id: 机器组ID :type host_group_id: str :param host_group_name: 机器组的名称 :type host_group_name: str :param host_group_type: 机器组的类型(IP或Label) :type host_group_type: str :param host_ip_list: 机器IP列表(HostGroupType为IP时必选) :type host_ip_list: List[str] :param host_identifier: 机器标识(HostGroupType为Label时必选) :type host_identifier: str :param auto_update: 是否开启自动升级功能 :type auto_update: bool :param update_start_time: 自动升级的开始时间 :type update_start_time: str :param update_end_time: 自动升级的结束时间 :type update_end_time: str :param service_logging: 是否开启Logcollector服务日志功能 :type service_logging: bool """ self.host_group_id = host_group_id self.host_group_name = host_group_name self.host_group_type = host_group_type self.host_ip_list = host_ip_list self.host_identifier = host_identifier self.auto_update = auto_update self.update_start_time = update_start_time self.update_end_time = update_end_time self.service_logging = service_logging def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None: return False return True class DescribeHostGroupRequest(TLSRequest): def __init__(self, host_group_id: str): """ :param host_group_id: 机器组ID :type host_group_id: str """ self.host_group_id = host_group_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None: return False return True class DescribeHostGroupsRequest(TLSRequest): def __init__(self, host_group_id: str = None, host_group_name: str = None, page_number: int = 1, page_size: int = 20, auto_update: bool = None, host_identifier: str = None, service_logging: bool = None, iam_project_name: str = None): """ :param host_group_id: 机器组ID :type host_group_id: str :param host_group_name: 机器组名称 :type host_group_name: str :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int :param auto_update: 是否开启了自动升级功能 :type auto_update: bool :param host_identifier: 机器组标识,不支持模糊查询 :type host_identifier: str :param service_logging: 是否已开启服务日志功能 :type service_logging: bool :param iam_project_name: 根据机器组所属的IAM项目名称进行筛选(精确匹配) :type iam_project_name: str """ self.host_group_id = host_group_id self.host_group_name = host_group_name self.page_number = page_number self.page_size = page_size self.auto_update = auto_update self.host_identifier = host_identifier self.service_logging = service_logging self.iam_project_name = iam_project_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True class DescribeHostsRequest(TLSRequest): def __init__(self, host_group_id: str, ip: str = None, heartbeat_status: int = None, page_number: int = 1, page_size: int = 20): """ :param host_group_id: 机器组ID :type host_group_id: str :param ip: 机器IP :type ip: str :param heartbeat_status: 机器心跳状态 :type heartbeat_status: int :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int """ self.host_group_id = host_group_id self.ip = ip self.heartbeat_status = heartbeat_status self.page_number = page_number self.page_size = page_size def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None: return False return True class DeleteHostRequest(TLSRequest): def __init__(self, host_group_id: str, ip: str): """ :param host_group_id: 机器组ID :type host_group_id: str :param ip: 机器IP :type ip: str """ self.host_group_id = host_group_id self.ip = ip def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None or self.ip is None: return False return True class DescribeHostGroupRulesRequest(TLSRequest): def __init__(self, host_group_id: str, page_number: int = 1, page_size: int = 20): """ :param host_group_id: 机器组ID :type host_group_id: str :param page_number: 分页查询时的页码(默认为1) :type page_number: int :param page_size: 分页大小(默认为20,最大为100) :type page_size: int """ self.host_group_id = host_group_id self.page_number = page_number self.page_size = page_size def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_id is None: return False return True class ModifyHostGroupsAutoUpdateRequest(TLSRequest): def __init__(self, host_group_ids: List[str], auto_update: bool = None, update_start_time: str = None, update_end_time: str = None): """ :param host_group_ids: 机器组ID列表 :type host_group_ids: List[str] :param auto_update: 机器组服务器中安装的LogCollector是否开启自动升级功能 :type auto_update: bool :param update_start_time: 自动升级的开始时间 :type update_start_time: str :param update_end_time: 自动升级的结束时间 :type update_end_time: str """ self.host_group_ids = host_group_ids self.auto_update = auto_update self.update_start_time = update_start_time self.update_end_time = update_end_time def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.host_group_ids is None: return False return True class DeleteAbnormalHostsRequest(TLSRequest): def __init__(self, host_group_id: str): """ :param host_group_id: 机器组ID :type host_group_id: str """ self.host_group_id = host_group_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.host_group_id is not None class SetRuleRequest(TLSRequest): def __init__(self, rule_name: str = None, paths: List[str] = None, log_type: str = None, extract_rule: ExtractRule = None, exclude_paths: List[ExcludePath] = None, user_define_rule: UserDefineRule = None, log_sample: str = None, input_type: int = None, container_rule: ContainerRule = None): """ :param rule_name: 采集配置的名称 :type rule_name: str :param paths: 采集路径列表 :type paths: List[str] :param log_type: 采集模式 :type log_type: str :param extract_rule: 日志提取规则 :type extract_rule: ExtractRule :param exclude_paths: 采集黑名单列表 :type exclude_paths: List[ExcludePath] :param user_define_rule: 用户自定义的采集规则 :type user_define_rule: UserDefineRule :param log_sample: 日志样例 :type log_sample: str :param input_type: 采集类型,0(默认)为宿主机日志文件,1为K8s容器标准输出,2为K8s容器内日志文件 :type input_type: int :param container_rule: 容器采集规则 :type container_rule: ContainerRule """ self.rule_name = rule_name self.paths = paths self.log_type = log_type self.extract_rule = extract_rule self.exclude_paths = exclude_paths self.user_define_rule = user_define_rule self.log_sample = log_sample self.input_type = input_type self.container_rule = container_rule def get_api_input(self): body = {} if self.rule_name is not None: body[RULE_NAME] = self.rule_name if self.paths is not None: body[PATHS] = self.paths if self.log_type is not None: body[LOG_TYPE] = self.log_type if self.input_type is not None: body[INPUT_TYPE] = self.input_type if self.extract_rule is not None: body[EXTRACT_RULE] = self.extract_rule.json() if self.exclude_paths is not None: body[EXCLUDE_PATHS] = [] for exclude_path in self.exclude_paths: body[EXCLUDE_PATHS].append(exclude_path.json()) if self.user_define_rule is not None: body[USER_DEFINE_RULE] = self.user_define_rule.json() if self.log_sample is not None: body[LOG_SAMPLE] = self.log_sample if self.container_rule is not None: body[CONTAINER_RULE] = self.container_rule.json() return body class CreateRuleRequest(SetRuleRequest): def __init__(self, topic_id: str, rule_name: str, paths: List[str] = None, log_type: str = "minimalist_log", extract_rule: ExtractRule = None, exclude_paths: List[ExcludePath] = None, user_define_rule: UserDefineRule = None, log_sample: str = None, input_type: int = 0, container_rule: ContainerRule = None): """ :param topic_id: 日志主题ID :type topic_id: str :param rule_name: 采集配置的名称 :type rule_name: str :param paths: 采集路径列表 :type paths: List[str] :param log_type: 采集模式 :type log_type: str :param extract_rule: 日志提取规则 :type extract_rule: ExtractRule :param exclude_paths: 采集黑名单列表 :type exclude_paths: List[ExcludePath] :param user_define_rule: 用户自定义的采集规则 :type user_define_rule: UserDefineRule :param log_sample: 日志样例 :type log_sample: str :param input_type: 采集类型,0(默认)为宿主机日志文件,1为K8s容器标准输出,2为K8s容器内日志文件 :type input_type: int :param container_rule: 容器采集规则 :type container_rule: ContainerRule """ super(CreateRuleRequest, self).__init__(rule_name, paths, log_type, extract_rule, exclude_paths, user_define_rule, log_sample, input_type, container_rule) self.topic_id = topic_id def get_api_input(self): body = super(CreateRuleRequest, self).get_api_input() body[TOPIC_ID] = self.topic_id return body def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None or self.rule_name is None: return False return True class DeleteRuleRequest(TLSRequest): def __init__(self, rule_id: str): """ :param rule_id:采集配置的 ID :type rule_id:str """ self.rule_id = rule_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.rule_id is None: return False return True class ModifyRuleRequest(SetRuleRequest): def __init__(self, rule_id: str, rule_name: str = None, paths: List[str] = None, log_type: str = None, extract_rule: ExtractRule = None, exclude_paths: List[ExcludePath] = None, user_define_rule: UserDefineRule = None, log_sample: str = None, input_type: int = None, container_rule: ContainerRule = None, pause: int = None): """ :param rule_id: 采集配置ID :type rule_id: str :param rule_name: 采集配置的名称 :type rule_name: str :param paths: 采集路径列表 :type paths: List[str] :param log_type: 采集模式 :type log_type: str :param extract_rule: 日志提取规则 :type extract_rule: ExtractRule :param exclude_paths: 采集黑名单列表 :type exclude_paths: List[ExcludePath] :param user_define_rule: 用户自定义的采集规则 :type user_define_rule: UserDefineRule :param log_sample: 日志样例 :type log_sample: str :param input_type: 采集类型,0(默认)为宿主机日志文件,1为K8s容器标准输出,2为K8s容器内日志文件 :type input_type: int :param container_rule: 容器采集规则 :type container_rule: ContainerRule :param pause: 是否暂停采集,0代表开启,1代表暂停 :type pause: int """ super(ModifyRuleRequest, self).__init__(rule_name, paths, log_type, extract_rule, exclude_paths, user_define_rule, log_sample, input_type, container_rule) self.rule_id = rule_id self.pause = pause def get_api_input(self): body = super(ModifyRuleRequest, self).get_api_input() body[RULE_ID] = self.rule_id if self.pause is not None: body[PAUSE] = self.pause return body def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.rule_id is None: return False return True class DescribeRuleRequest(TLSRequest): def __init__(self, rule_id: str): """ :param rule_id:采集配置的 ID :type rule_id:str """ self.rule_id = rule_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.rule_id is None: return False return True class DescribeRulesRequest(TLSRequest): def __init__(self, project_id: str = None, project_name: str = None, iam_project_name: str = None, rule_id: str = None, rule_name: str = None, topic_id: str = None, topic_name: str = None, page_number: int = 1, page_size: int = 20, log_type: str = None, pause: int = None,): """ :param rule_id:采集配置的 ID :type rule_id:str :param project_name: 日志项目名称 :type project_name: str :param iam_project_name: IAM 项目名称 :type iam_project_name: str :param rule_name:采集配置的名称 :type rule_name: :param page_number: 分页查询时的页码。默认为 1 :type page_number: int :param page_size: 分页大小。默认为 20,最大为 100 :type page_size: int :param topic_id:日志主题 ID :type topic_id:str :param topic_name: 日志主题名称 :type topic_name: string :param project_id: 日志项目 ID :type project_id: string :param log_type: 日志类型 :type log_type: str :param pause: 是否暂停采集配置,0代表开启,1代表暂停 :type pause: int """ self.project_id = project_id self.project_name = project_name self.iam_project_name = iam_project_name self.rule_id = rule_id self.rule_name = rule_name self.topic_id = topic_id self.topic_name = topic_name self.page_number = page_number self.page_size = page_size self.log_type = log_type self.pause = pause def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True class ApplyRuleToHostGroupsRequest(TLSRequest): def __init__(self, rule_id: str, host_group_ids: List[str]): """ :param rule_id:采集配置的 ID :type rule_id:str :param host_group_ids:机器组id列表 :type host_group_ids: List[str] """ self.rule_id = rule_id self.host_group_ids = host_group_ids def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.rule_id is None: return False return True class DeleteRuleFromHostGroupsRequest(TLSRequest): def __init__(self, rule_id: str, host_group_ids: List[str]): """ :param rule_id:采集配置的 ID :type rule_id:str :param host_group_ids:机器组id列表 :type host_group_ids: List[str] """ self.rule_id = rule_id self.host_group_ids = host_group_ids def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.rule_id is None or self.host_group_ids is None: return False return True class CreateAlarmNotifyGroupRequest(TLSRequest): def __init__(self, alarm_notify_group_name: str, notify_type: List[str] = None, receivers: List[Receiver] = None, iam_project_name: str = None, notice_rules: List[NoticeRule] = None): """ :param alarm_notify_group_name: 告警通知组名称 :type alarm_notify_group_name: str :param notify_type: 告警通知的类型Trigger告警触发、Recovery告警恢复 :type notify_type: List[str] :param receivers: 接收告警的IAM用户列表 :type receivers: List[Receiver] :param iam_project_name: 告警组所属的 IAM 项目名称 :type iam_project_name: str :param notice_rules: 告警通知组的相关配置 :type notice_rules: List[NoticeRule] """ self.alarm_notify_group_name = alarm_notify_group_name self.notify_type = notify_type self.receivers = receivers self.iam_project_name = iam_project_name self.notice_rules = notice_rules def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_notify_group_name is None: return False # Either (NotifyType and Receivers) or NoticeRules must be provided, but not both has_notify_receivers = self.notify_type is not None and self.receivers is not None has_notice_rules = self.notice_rules is not None if not (has_notify_receivers or has_notice_rules): return False if has_notify_receivers and has_notice_rules: return False return True def get_api_input(self): body = {ALARM_NOTIFY_GROUP_NAME: self.alarm_notify_group_name} if self.notify_type is not None: body[NOTIFY_TYPE] = self.notify_type if self.receivers is not None: body[RECEIVERS] = [] for receiver in self.receivers: body[RECEIVERS].append(receiver.json()) if self.iam_project_name is not None: body[IAM_PROJECT_NAME] = self.iam_project_name if self.notice_rules is not None: body['NoticeRules'] = [] for notice_rule in self.notice_rules: body['NoticeRules'].append(notice_rule.json()) return body class DeleteAlarmNotifyGroupRequest(TLSRequest): def __init__(self, alarm_notify_group_id: str): """ :param alarm_notify_group_id:告警通知组 ID :type alarm_notify_group_id:str """ self.alarm_notify_group_id = alarm_notify_group_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_notify_group_id is None: return False return True class ModifyAlarmNotifyGroupRequest(TLSRequest): def __init__(self, alarm_notify_group_id: str, alarm_notify_group_name: str = None, notify_type: List[str] = None, receivers: List[Receiver] = None, notice_rules: List[NoticeRule] = None): """ :param alarm_notify_group_id: 告警通知组 ID :type alarm_notify_group_id:str :param alarm_notify_group_name:告警通知组名称 :type alarm_notify_group_name:str :param notify_type: 告警通知的类型 Trigger告警触发、Recovery告警恢复 :type notify_type: List[str] :param receivers:接收告警的 IAM 用户列表 :type receivers:List[Receiver] :param notice_rules: 告警通知组的相关配置 :type notice_rules: List[NoticeRule] """ self.alarm_notify_group_id = alarm_notify_group_id self.alarm_notify_group_name = alarm_notify_group_name self.notify_type = notify_type self.receivers = receivers self.notice_rules = notice_rules def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_notify_group_id is None: return False # Either (NotifyType and Receivers) or NoticeRules must be provided, but not both has_notify_receivers = self.notify_type is not None and self.receivers is not None has_notice_rules = self.notice_rules is not None if has_notify_receivers and has_notice_rules: return False return True def get_api_input(self): body = {ALARM_NOTIFY_GROUP_ID: self.alarm_notify_group_id} if self.alarm_notify_group_name is not None: body[ALARM_NOTIFY_GROUP_NAME] = self.alarm_notify_group_name if self.notify_type is not None: body[NOTIFY_TYPE] = self.notify_type if self.receivers is not None: body[RECEIVERS] = [] for receiver in self.receivers: body[RECEIVERS].append(receiver.json()) if self.notice_rules is not None: body['NoticeRules'] = [] for notice_rule in self.notice_rules: body['NoticeRules'].append(notice_rule.json()) return body class DescribeAlarmNotifyGroupsRequest(TLSRequest): def __init__(self, alarm_notify_group_name: str = None, alarm_notify_group_id: str = None, receiver_name: str = None, page_number: int = 1, page_size: int = 20, iam_project_name: str = None): """ :param alarm_notify_group_id: 告警通知组 ID :type alarm_notify_group_id: str :param alarm_notify_group_name: 告警通知组名称 :type alarm_notify_group_name: str :param receiver_name: 接收告警的IAM用户 :type receiver_name: str :param page_number: 分页查询时的页码,默认为1 :type page_number: int :param page_size: 分页大小,默认为20,最大为100 :type page_size: int :param iam_project_name 根据告警组所属的IAM项目名称进行筛选 :type iam_project_name str """ self.alarm_notify_group_name = alarm_notify_group_name self.alarm_notify_group_id = alarm_notify_group_id self.receiver_name = receiver_name self.page_number = page_number self.page_size = page_size self.iam_project_name = iam_project_name def check_validation(self): return True class SetAlarmRequest(TLSRequest): def __init__(self, alarm_name: str = None, query_request: List[QueryRequest] = None, request_cycle: RequestCycle = None, condition: str = None, alarm_period: int = None, alarm_notify_group: List[str] = None, status: bool = None, trigger_period: int = None, user_define_msg: str = None, severity: str = None, alarm_period_detail: AlarmPeriodSetting = None, join_configurations: List[JoinConfig] = None, trigger_conditions: List[TriggerCondition] = None, send_resolved: bool = None): """ :param project_id: 日志项目ID :type project_id: str :param alarm_name: 告警策略名称 :type alarm_name: str :param query_request: 检索分析语句,可配置1~3条 :type query_request: List[QueryRequest] :param request_cycle: 告警任务的执行周期 :type request_cycle: RequestCycle :param condition: 告警触发条件 :type condition: str :param alarm_period: 告警重复的周期 :type alarm_period: int :param alarm_notify_group: 告警对应的通知列表 :type alarm_notify_group: List[str] :param status: 是否开启告警策略,默认值为true :type status: bool :param trigger_period: triggerPeriod触发告警持续周期,最小值为1,最大值为10 :type trigger_period: int :param user_define_msg: 告警通知的内容 :type user_define_msg: str :param severity: 告警通知的级别,即告警的严重程度,支持设置为notice、warning或critical,严重程度递增,默认为notice :type severity: str :param alarm_period_detail: 告警通知发送的周期 :type alarm_period_detail: AlarmPeriodSetting :param join_configurations: 告警检索分析结果集合操作的相关配置 :type join_configurations: List[JoinConfig] :param trigger_conditions: 告警触发条件列表 :type trigger_conditions: List[TriggerCondition] :param send_resolved: 是否发送恢复通知 :type send_resolved: bool """ self.alarm_name = alarm_name self.query_request = query_request self.request_cycle = request_cycle self.condition = condition self.alarm_period = alarm_period self.alarm_notify_group = alarm_notify_group self.status = status self.trigger_period = trigger_period self.user_define_msg = user_define_msg self.severity = severity self.alarm_period_detail = alarm_period_detail self.join_configurations = join_configurations self.trigger_conditions = trigger_conditions self.send_resolved = send_resolved def get_api_input(self): body = super(SetAlarmRequest, self).get_api_input() if self.request_cycle is not None: body[REQUEST_CYCLE] = self.request_cycle.json() if self.query_request is not None: body[QUERY_REQUEST] = [] for one_query_request in self.query_request: body[QUERY_REQUEST].append(one_query_request.json()) if self.alarm_period_detail is not None: body[ALARM_PERIOD_DETAIL] = self.alarm_period_detail.json() if self.join_configurations is not None: body[JOIN_CONFIGURATIONS] = [] for one_join_configuration in self.join_configurations: body[JOIN_CONFIGURATIONS].append(one_join_configuration.json()) if self.trigger_conditions is not None: body[TRIGGER_CONDITIONS] = [] for one_trigger_condition in self.trigger_conditions: body[TRIGGER_CONDITIONS].append(one_trigger_condition.json()) if self.send_resolved is not None: body[SEND_RESOLVED] = self.send_resolved return body class CreateAlarmRequest(SetAlarmRequest): def __init__(self, project_id: str, alarm_name: str, query_request: List[QueryRequest], request_cycle: RequestCycle, condition: str, alarm_period: int, alarm_notify_group: List[str], status: bool = True, trigger_period: int = 1, user_define_msg: str = None, severity: str = "notice", alarm_period_detail: AlarmPeriodSetting = None, join_configurations: List[JoinConfig] = None, trigger_conditions: List[TriggerCondition] = None, send_resolved: bool = None): """ :param project_id: 日志项目ID :type project_id: str :param alarm_name: 告警策略名称 :type alarm_name: str :param query_request: 检索分析语句,可配置1~3条 :type query_request: List[QueryRequest] :param request_cycle: 告警任务的执行周期 :type request_cycle: RequestCycle :param condition: 告警触发条件 :type condition: str :param alarm_period: 告警重复的周期 :type alarm_period: int :param alarm_notify_group: 告警对应的通知列表 :type alarm_notify_group: List[str] :param status: 是否开启告警策略,默认值为true :type status: bool :param trigger_period: triggerPeriod触发告警持续周期,最小值为1,最大值为10 :type trigger_period: int :param user_define_msg: 告警通知的内容 :type user_define_msg: str :param severity: 告警通知的级别,即告警的严重程度,支持设置为notice、warning或critical,严重程度递增,默认为notice :type severity: str :param alarm_period_detail: 告警通知发送的周期 :type alarm_period_detail: AlarmPeriodSetting :param join_configurations: 告警检索分析结果集合操作的相关配置 :type join_configurations: List[JoinConfig] :param trigger_conditions: 告警触发条件列表 :type trigger_conditions: List[TriggerCondition] :param send_resolved: 是否发送恢复通知,不填该参数默认为true :type send_resolved: bool """ super(CreateAlarmRequest, self).__init__(alarm_name, query_request, request_cycle, condition, alarm_period, alarm_notify_group, status, trigger_period, user_define_msg, severity, alarm_period_detail, join_configurations, trigger_conditions, send_resolved) self.project_id = project_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_name is None or self.project_id is None or self.request_cycle is None or self.condition is None \ or self.alarm_period is None or self.alarm_notify_group is None: return False return True class DeleteAlarmRequest(TLSRequest): def __init__(self, alarm_id: str): """ :param alarm_id:告警策略 ID :type alarm_id:str """ self.alarm_id = alarm_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_id is None: return False return True class ModifyAlarmRequest(SetAlarmRequest): def __init__(self, alarm_id: str, alarm_name: str = None, query_request: List[QueryRequest] = None, request_cycle: RequestCycle = None, condition: str = None, alarm_period: int = None, alarm_notify_group: List[str] = None, status: bool = None, trigger_period: int = None, user_define_msg: str = None, severity: str = None, alarm_period_detail: AlarmPeriodSetting = None, join_configurations: List[JoinConfig] = None, trigger_conditions: List[TriggerCondition] = None, send_resolved: bool = None): """ :param alarm_id: 告警策略ID :type alarm_id: str :param alarm_name: 告警策略名称 :type alarm_name: str :param query_request: 检索分析语句,可配置1~3条 :type query_request: List[QueryRequest] :param request_cycle: 告警任务的执行周期 :type request_cycle: RequestCycle :param condition: 告警触发条件 :type condition: str :param alarm_period: 告警重复的周期 :type alarm_period: int :param alarm_notify_group: 告警对应的通知列表 :type alarm_notify_group: List[str] :param status: 是否开启告警策略,默认值为true :type status: bool :param trigger_period: triggerPeriod触发告警持续周期,最小值为1,最大值为10 :type trigger_period: int :param user_define_msg: 告警通知的内容 :type user_define_msg: str :param severity: 告警通知的级别,即告警的严重程度,支持设置为notice、warning或critical,严重程度递增,默认为notice :type severity: str :param alarm_period_detail: 告警通知发送的周期 :type alarm_period_detail: AlarmPeriodSetting :param join_configurations: 告警检索分析结果集合操作的相关配置 :type join_configurations: List[JoinConfig] :param trigger_conditions: 告警触发条件列表 :type trigger_conditions: List[TriggerCondition] :param send_resolved: 是否发送恢复通知 :type send_resolved: bool """ super(ModifyAlarmRequest, self).__init__(alarm_name, query_request, request_cycle, condition, alarm_period, alarm_notify_group, status, trigger_period, user_define_msg, severity, alarm_period_detail, join_configurations, trigger_conditions, send_resolved) self.alarm_id = alarm_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.alarm_id is None: return False return True class DescribeAlarmsRequest(TLSRequest): def __init__(self, project_id: str, alarm_name: str = None, alarm_id: str = None, topic_name: str = None, topic_id: str = None, status: bool = None, page_number: int = 1, page_size: int = 20): """ :param project_id: 日志项目 ID :type project_id: string :param alarm_name:告警策略名称 :type alarm_name:str :param alarm_id:告警策略 ID :type alarm_id:str :param status:是否开启告警策略。默认值为 true :type status:bool :param page_number: 分页查询时的页码。默认为 1 :type page_number: int :param page_size: 分页大小。默认为 20,最大为 100 :type page_size: int :param topic_id:日志主题 ID :type topic_id:str :param topic_name: 日志主题名称 :type topic_name: string """ self.project_id = project_id self.alarm_name = alarm_name self.alarm_id = alarm_id self.topic_name = topic_name self.topic_id = topic_id self.status = status self.page_number = page_number self.page_size = page_size def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.project_id is None: return False return True class OpenKafkaConsumerRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class CloseKafkaConsumerRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class DescribeKafkaConsumerRequest(TLSRequest): def __init__(self, topic_id: str): """ :param topic_id:日志主题 ID :type topic_id:str """ self.topic_id = topic_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.topic_id is None: return False return True class CreateConsumerGroupRequest(TLSRequest): def __init__(self, project_id: str, consumer_group_name: str, topic_id_list: List[str], heartbeat_ttl: int, ordered_consume: bool): """ :param project_id: 日志项目ID :type project_id: str :param consumer_group_name: 消费组名称 :type consumer_group_name: str :param topic_id_list: 消费者要消费的TopicID列表 :type topic_id_list: List[str] :param heartbeat_ttl: 心跳TTL :type heartbeat_ttl: int :param ordered_consume: 是否按顺序消费 :type ordered_consume: bool """ self.project_id = project_id self.consumer_group_name = consumer_group_name self.topic_id_list = topic_id_list self.heartbeat_ttl = heartbeat_ttl self.ordered_consume = ordered_consume def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.project_id is not None and self.consumer_group_name is not None and self.topic_id_list is not None and self.heartbeat_ttl is not None and self.ordered_consume is not None) def get_api_input(self): body = {PROJECT_ID_UPPERCASE: self.project_id, CONSUMER_GROUP_NAME: self.consumer_group_name, TOPIC_ID_LIST: self.topic_id_list, HEARTBEAT_TTL: self.heartbeat_ttl, ORDERED_CONSUME: self.ordered_consume} return body class DeleteConsumerGroupRequest(TLSRequest): def __init__(self, project_id: str, consumer_group_name: str): """ :param project_id: 日志项目ID :type project_id: str :param consumer_group_name: 消费组名称 :type consumer_group_name: str """ self.project_id = project_id self.consumer_group_name = consumer_group_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None and self.consumer_group_name is not None def get_api_input(self): return {PROJECT_ID_UPPERCASE: self.project_id, CONSUMER_GROUP_NAME: self.consumer_group_name} class ModifyConsumerGroupRequest(TLSRequest): def __init__(self, project_id: str, consumer_group_name: str, topic_id_list: List[str] = None, heartbeat_ttl: int = None, ordered_consume: bool = None): """ :param project_id: 日志项目ID :type project_id: str :param consumer_group_name: 消费组名称 :type consumer_group_name: str :param topic_id_list: 消费者要消费的TopicID列表 :type topic_id_list: List[str] :param heartbeat_ttl: 心跳TTL :type heartbeat_ttl: int :param ordered_consume: 是否按顺序消费 :type ordered_consume: bool """ self.project_id = project_id self.consumer_group_name = consumer_group_name self.topic_id_list = topic_id_list self.heartbeat_ttl = heartbeat_ttl self.ordered_consume = ordered_consume def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None and self.consumer_group_name is not None def get_api_input(self): body = {PROJECT_ID_UPPERCASE: self.project_id, CONSUMER_GROUP_NAME: self.consumer_group_name} if self.topic_id_list is not None: body[TOPIC_ID_LIST] = self.topic_id_list if self.heartbeat_ttl is not None: body[HEARTBEAT_TTL] = self.heartbeat_ttl if self.ordered_consume is not None: body[ORDERED_CONSUME] = self.ordered_consume return body class DescribeConsumerGroupsRequest(TLSRequest): def __init__(self, project_id: str, page_number: int = 1, page_size: int = 20, consumer_group_name: str = None, project_name: str = None, topic_id: str = None, topic_name: str = None, iam_project_name: str = None): """ :param project_id: 日志项目ID :type project_id: str :param page_number: 分页查询时的页码 :type page_number: int :param page_size: 分页大小 :type page_size: int :param consumer_group_name: 消费组名称 :type consumer_group_name: str :param project_name: 日志项目名称 :type project_name: str :param topic_id: 日志主题ID :type topic_id: str :param topic_name: 日志主题名称 :type topic_name: str :param iam_project_name: IAM日志项目名称 :type iam_project_name: str """ self.project_id = project_id self.page_number = page_number self.page_size = page_size self.consumer_group_name = consumer_group_name self.project_name = project_name self.topic_id = topic_id self.topic_name = topic_name self.iam_project_name = iam_project_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None class ConsumerHeartbeatRequest(TLSRequest): def __init__(self, project_id: str, consumer_group_name: str, consumer_name: str): """ :param project_id: 日志项目ID :type project_id: str :param consumer_group_name: 消费组名称 :type consumer_group_name: str :param consumer_name: 消费者名称 :type consumer_name: str """ self.project_id = project_id self.consumer_group_name = consumer_group_name self.consumer_name = consumer_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None and self.consumer_group_name is not None and self.consumer_name is not None def get_api_input(self): return {PROJECT_ID_UPPERCASE: self.project_id, CONSUMER_GROUP_NAME: self.consumer_group_name, CONSUMER_NAME: self.consumer_name} class ModifyCheckpointRequest(TLSRequest): def __init__(self, project_id: str, topic_id: str, shard_id: int, consumer_group_name: str, checkpoint: str): """ :param project_id: 日志项目ID :type project_id: str :param topic_id: 日志主题ID :type topic_id: str :param shard_id: ShardID :type shard_id: int :param consumer_group_name: 消费者名称 :type consumer_group_name: str :param checkpoint: 检查点 :type checkpoint: str """ self.project_id = project_id self.topic_id = topic_id self.shard_id = shard_id self.consumer_group_name = consumer_group_name self.checkpoint = checkpoint def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.project_id is not None and self.topic_id is not None and self.shard_id is not None and self.consumer_group_name is not None and self.checkpoint is not None) def get_api_input(self): return {PROJECT_ID_UPPERCASE: self.project_id, TOPIC_ID_UPPERCASE: self.topic_id, SHARD_ID_UPPERCASE: self.shard_id, CONSUMER_GROUP_NAME: self.consumer_group_name, CHECKPOINT: self.checkpoint} class ResetCheckpointRequest(TLSRequest): def __init__(self, project_id: str, consumer_group_name: str, position: str): """ :param project_id: 日志项目ID :type project_id: str :param consumer_group_name: 消费者名称 :type consumer_group_name: str :param position: 消费位点 :type position: str """ self.project_id = project_id self.consumer_group_name = consumer_group_name self.position = position def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None and self.consumer_group_name is not None and self.position is not None def get_api_input(self): return {PROJECT_ID_UPPERCASE: self.project_id, CONSUMER_GROUP_NAME: self.consumer_group_name, POSITION: self.position} class DescribeCheckpointRequest(TLSRequest): def __init__(self, project_id: str, topic_id: str, shard_id: int, consumer_group_name: str): """ :param project_id: 日志项目ID :param topic_id: 日志主题ID :param shard_id: ShardID :param consumer_group_name: 消费组名称 """ self.project_id = project_id self.topic_id = topic_id self.shard_id = shard_id self.consumer_group_name = consumer_group_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.project_id is not None and self.topic_id is not None and self.shard_id is not None and self.consumer_group_name is not None) def get_api_input(self): params = {PROJECT_ID: self.project_id, TOPIC_ID: self.topic_id, SHARD_ID: self.shard_id} body = {CONSUMER_GROUP_NAME: self.consumer_group_name} return {PARAMS: params, BODY: body} class AddTagsToResourceRequest(TLSRequest): def __init__(self, resource_type: str, resources_list: List[str], tags: List[TagInfo]): """ :param resource_type: 资源类型,支持设置为project或topic :type resource_type: str :param resources_list: 资源列表,即日志项目或日志主题的ID列表 :type resources_list: List[str] :param tags: 需要绑定的标签键和标签值数组对象 :type tags: List[TagInfo] """ self.resource_type = resource_type self.resources_list = resources_list self.tags = tags def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.resource_type is not None and self.resources_list is not None and self.tags is not None def get_api_input(self): body = {RESOURCE_TYPE: self.resource_type, RESOURCES_LIST: self.resources_list, TAGS: []} for tag in self.tags: body[TAGS].append(tag.json()) return body class RemoveTagsFromResourceRequest(TLSRequest): def __init__(self, resource_type: str, resources_list: List[str], tag_key_list: List[str]): """ :param resource_type: 资源类型,支持设置为project或topic :type resource_type: str :param resources_list: 资源列表,即日志项目或日志主题的ID列表 :type resources_list: List[str] :param tag_key_list: 待解绑的资源标签键列表 :type tag_key_list: List[str] """ self.resource_type = resource_type self.resources_list = resources_list self.tag_key_list = tag_key_list def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.resource_type is not None and self.resources_list is not None and self.tag_key_list is not None class TagResourcesRequest(TLSRequest): def __init__(self, resource_type: str, resources_ids: List[str], tags: List[TagInfo]): """ :param resource_type: 资源类型,支持设置为:project:日志项目;topic:日志主题 :type resource_type: str :param resources_ids: 资源列表,即日志项目或日志主题的 ID 列表。支持一次传入多个资源 ID,最多同时传入 50 个资源 ID。 :type resources_ids: List[str] :param tags: 需要绑定的标签键和标签值数组对象 :type tags: List[TagInfo] """ self.resource_type = resource_type self.resources_ids = resources_ids self.tags = tags def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.resource_type is not None and self.resources_ids is not None and self.tags is not None) def get_api_input(self): body = {RESOURCE_TYPE: self.resource_type, RESOURCES_IDS: self.resources_ids, TAGS: []} for tag in self.tags: body[TAGS].append(tag.json()) return body class UntagResourcesRequest(TLSRequest): def __init__(self, resource_type: str, resources_ids: List[str], tag_keys: List[str]): """ :param resource_type: 资源类型,支持设置为:project:日志项目;topic:日志主题 :type resource_type: str :param resources_ids: 资源列表,即日志项目或日志主题的 ID 列表。支持一次传入多个资源 ID,最多同时传入 50 个资源 ID。 :type resources_ids: List[str] :param tag_keys: 待解绑的资源标签键列表。支持一次传入多个标签键,多个标签键间用英文逗号(,)分隔。最多同时传入 20 个标签键。 :type tag_keys: List[str] """ self.resource_type = resource_type self.resources_ids = resources_ids self.tag_keys = tag_keys def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.resource_type is not None and self.resources_ids is not None and self.tag_keys is not None) class CreateImportTaskRequest(TLSRequest): def __init__(self, topic_id: str, task_name: str, source_type: str, import_source_info: ImportSourceInfo, target_info: TargetInfo, project_id: str = None, description: str = None): """ :param topic_id: 日志主题ID :type topic_id: str :param task_name: 导入任务名称 :type task_name: str :param source_type: 导入任务源类型:tos、kafka :type source_type: str :param import_source_info: 导入任务源信息 :type import_source_info: ImportSourceInfo :param target_info: 导入任务目标信息 :type target_info: TargetInfo :param project_id: 日志项目ID :type project_id: str :param description: 导入任务描述 :type description: str """ self.project_id = project_id self.topic_id = topic_id self.task_name = task_name self.source_type = source_type self.import_source_info = import_source_info self.target_info = target_info self.description = description def get_api_input(self): body = super(CreateImportTaskRequest, self).get_api_input() del body[PROJECT_ID] if self.project_id is not None: body[PROJECT_ID_UPPERCASE] = self.project_id del body[TOPIC_ID] body[TOPIC_ID_UPPERCASE] = self.topic_id if self.import_source_info is not None: body[IMPORT_SOURCE_INFO] = self.import_source_info.json() if self.target_info is not None: body[TARGET_INFO] = self.target_info.json() return body class DeleteImportTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 导入任务ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.task_id is None: return False if isinstance(self.task_id, str): return bool(self.task_id.strip()) return True class ModifyImportTaskRequest(CreateImportTaskRequest): def __init__(self, task_id: str, status: int, topic_id: str, task_name: str, source_type: str, import_source_info: ImportSourceInfo, target_info: TargetInfo, project_id: str = None, description: str = None): """ :param task_id: 导入任务ID :type task_id: str :param status: 导入任务状态:0:导入中。1:导入完成。2:导入异常。3:停止中。4:已停止。5:重启中。 :type status: int :param topic_id: 日志主题ID :type topic_id: str :param task_name: 导入任务名称 :type task_name: str :param source_type: 导入任务源类型:tos、kafka :type source_type: str :param import_source_info: 导入任务源信息 :type import_source_info: ImportSourceInfo :param target_info: 导入任务目标信息 :type target_info: TargetInfo :param project_id: 日志项目ID :type project_id: str :param description: 导入任务描述 :type description: str """ super(ModifyImportTaskRequest, self).__init__(topic_id, task_name, source_type, import_source_info, target_info, project_id, description) self.task_id = task_id self.status = status def get_api_input(self): body = super(ModifyImportTaskRequest, self).get_api_input() body[TASK_ID] = self.task_id body[STATUS] = self.status return body def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.task_id is not None and self.status is not None and self.topic_id is not None and self.task_name is not None and self.source_type is not None and self.import_source_info is not None and self.target_info is not None) class DescribeImportTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 导入任务ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None class DescribeImportTasksRequest(TLSRequest): def __init__(self, task_id: str = None, task_name: str = None, project_id: str = None, project_name: str = None, iam_project_name: str = None, topic_id: str = None, topic_name: str = None,page_number: int = 1, page_size: int = 20, source_type: str = None, status: int = None): """ :param task_id: 导入任务ID :type task_id: str :param task_name: 导入任务名称 :type task_name: str :param project_id: 日志项目ID :type project_id: str :param project_name: 日志项目名称 :type project_name: str :param iam_project_name: 日志项目名称(IAM) :type iam_project_name: str :param topic_id: 日志主题ID :type topic_id: str :param topic_name: 日志主题名称 :type topic_name: str :param page_number: 分页查询时的页码。默认为 1,即从第一页数据开始返回。 :type page_number: int :param page_size: 分页大小。默认为 20,最大为 100。 :type page_size: int :param source_type: 导入任务源类型:tos、kafka :type source_type: str :param status: 导入任务状态:0:导入中。1:导入完成。2:导入异常。3:停止中。4:已停止。5:重启中。 :type status: int """ self.task_id = task_id self.task_name = task_name self.project_id = project_id self.project_name = project_name self.iam_project_name = iam_project_name self.topic_id = topic_id self.topic_name = topic_name self.page_number = page_number self.page_size = page_size self.source_type = source_type self.status = status class CreateShipperRequest(TLSRequest): def __init__(self, topic_id: str, shipper_name: str, shipper_type: str, content_info: ContentInfo, tos_shipper_info: TosShipperInfo = None, kafka_shipper_info: KafkaShipperInfo = None, shipper_start_time: int = None, shipper_end_time: int = None, role_trn: str = None, service_trn: str = None): """ :param topic_id: 日志主题ID :type topic_id: str :param shipper_name: 投递配置名称 :type shipper_name: str :param shipper_type: 投递类型: tos、kafka :type shipper_type: str :param content_info: 日志内容的投递格式配置 :type content_info: ContentInfo :param tos_shipper_info: 投递到TOS的相关配置 :type tos_shipper_info: TosShipperInfo, optional :param kafka_shipper_info: 投递到Kafka的相关配置 :type kafka_shipper_info: KafkaShipperInfo, optional :param shipper_start_time: 投递开始时间,毫秒时间戳 :type shipper_start_time: int, optional :param shipper_end_time: 投递结束时间,毫秒时间戳 :type shipper_end_time: int, optional :param role_trn: 自定义角色的Trn :type role_trn: str, optional :param service_trn: 服务信任角色的Trn :type service_trn: str, optional """ self.topic_id = topic_id self.shipper_name = shipper_name self.shipper_type = shipper_type self.content_info = content_info self.tos_shipper_info = tos_shipper_info self.kafka_shipper_info = kafka_shipper_info self.shipper_start_time = shipper_start_time self.shipper_end_time = shipper_end_time self.role_trn = role_trn self.service_trn = service_trn def get_api_input(self): api_input = super(CreateShipperRequest, self).get_api_input() api_input[CONTENT_INFO] = self.content_info.json() if self.tos_shipper_info: api_input[TOS_SHIPPER_INFO] = self.tos_shipper_info.json() if self.kafka_shipper_info: api_input[KAFKA_SHIPPER_INFO] = self.kafka_shipper_info.json() return api_input class DeleteShipperRequest(TLSRequest): def __init__(self, shipper_id: str): """ :param shipper_id: 投递配置ID :type shipper_id: str """ self.shipper_id = shipper_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.shipper_id is not None class ModifyShipperRequest(TLSRequest): def __init__(self, shipper_id: str, shipper_name: str = None, shipper_type: str = None, content_info: ContentInfo = None, tos_shipper_info: TosShipperInfo = None, kafka_shipper_info: KafkaShipperInfo = None, status: bool = None, shipper_start_time: int = None, shipper_end_time: int = None, role_trn: str = None, service_trn: str = None): """ :param shipper_id: 投递配置ID :type shipper_id: str :param shipper_name: 投递配置名称 :type shipper_name: str, optional :param shipper_type: 投递类型: tos、kafka :type shipper_type: str, optional :param content_info: 日志内容的投递格式配置 :type content_info: ContentInfo, optional :param tos_shipper_info: 投递到TOS的相关配置 :type tos_shipper_info: TosShipperInfo, optional :param kafka_shipper_info: 投递到Kafka的相关配置 :type kafka_shipper_info: KafkaShipperInfo, optional :param status: 是否开启投递配置 :type status: bool, optional :param shipper_start_time: 投递开始时间,毫秒时间戳 :type shipper_start_time: int, optional :param shipper_end_time: 投递结束时间,毫秒时间戳 :type shipper_end_time: int, optional :param role_trn: 自定义角色的Trn :type role_trn: str, optional :param service_trn: 服务信任角色的Trn :type service_trn: str, optional """ self.shipper_id = shipper_id self.shipper_name = shipper_name self.shipper_type = shipper_type self.content_info = content_info self.tos_shipper_info = tos_shipper_info self.kafka_shipper_info = kafka_shipper_info self.status = status self.shipper_start_time = shipper_start_time self.shipper_end_time = shipper_end_time self.role_trn = role_trn self.service_trn = service_trn def get_api_input(self): api_input = super(ModifyShipperRequest, self).get_api_input() if self.content_info: api_input[CONTENT_INFO] = self.content_info.json() if self.tos_shipper_info: api_input[TOS_SHIPPER_INFO] = self.tos_shipper_info.json() if self.kafka_shipper_info: api_input[KAFKA_SHIPPER_INFO] = self.kafka_shipper_info.json() return api_input def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.shipper_id is not None class DescribeShipperRequest(TLSRequest): def __init__(self, shipper_id: str): """ :param shipper_id: 投递配置ID :type shipper_id: str """ self.shipper_id = shipper_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.shipper_id is not None class DescribeShippersRequest(TLSRequest): def __init__(self, project_id: str = None, project_name: str = None, iam_project_name: str = None, shipper_id: str = None, shipper_name: str = None, topic_id: str = None, topic_name: str = None, shipper_type: str = None, page_number: int = 1, page_size: int = 20): """ :param project_id: 日志项目ID :type project_id: str, optional :param project_name: 日志项目名称 :type project_name: str, optional :param iam_project_name: IAM项目名称 :type iam_project_name: str, optional :param shipper_id: 投递配置ID :type shipper_id: str, optional :param shipper_name: 投递配置名称 :type shipper_name: str, optional :param topic_id: 日志主题ID :type topic_id: str, optional :param topic_name: 日志主题名称 :type topic_name: str, optional :param shipper_type: 投递类型: tos、kafka :type shipper_type: str, optional :param page_number: 分页查询时的页码 :type page_number: int, optional :param page_size: 分页大小 :type page_size: int, optional """ self.project_id = project_id self.project_name = project_name self.iam_project_name = iam_project_name self.shipper_id = shipper_id self.shipper_name = shipper_name self.topic_id = topic_id self.topic_name = topic_name self.shipper_type = shipper_type self.page_number = page_number self.page_size = page_size class ModifyETLTaskRequest(TLSRequest): def __init__(self, task_id: str, name: str = None, description: str = None, script: str = None, target_resources: List = None): """\ :param task_id: 加工任务 ID :type task_id: str :param name: 加工任务名称 :type name: str, optional :param description: 数据加工任务的描述信息 :type description: str, optional :param script: 加工规则 :type script: str, optional :param target_resources: 输出目标的相关信息 :type target_resources: List[TargetResource], optional """ self.task_id = task_id self.name = name self.description = description self.script = script self.target_resources = target_resources def check_validation(self): """\ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None def get_api_input(self): body = super(ModifyETLTaskRequest, self).get_api_input() if self.target_resources is not None: body[ETL_TARGET_RESOURCES] = [] for target_resource in self.target_resources: body[ETL_TARGET_RESOURCES].append(target_resource.json()) return body class DescribeETLTaskRequest(TLSRequest): def __init__(self, task_id: str): """\ :param task_id: 待查询的加工任务 ID :type task_id: str """ self.task_id = task_id def check_validation(self): """\ :return: 参数是否合法 :rtype: bool """ if self.task_id is None: return False return True class DescribeETLTasksRequest(TLSRequest): def __init__( self, project_id: str = None, project_name: str = None, source_topic_id: str = None, source_topic_name: str = None, task_id: str = None, task_name: str = None, status: str = None, iam_project_name: str = None, page_number: int = 1, page_size: int = 20): """\ :param project_id: 日志项目 ID :type project_id: str, optional :param project_name: 日志项目名称 :type project_name: str, optional :param source_topic_id: 源日志主题 ID :type source_topic_id: str, optional :param source_topic_name: 源日志主题名称 :type source_topic_name: str, optional :param task_id: 加工任务 ID :type task_id: str, optional :param task_name: 加工任务名称 :type task_name: str, optional :param status: 加工任务状态 :type status: str, optional :param iam_project_name: IAM 项目名称 :type iam_project_name: str, optional :param page_number: 分页页码,从 1 开始 :type page_number: int, optional :param page_size: 分页大小,默认为 20,最大 100 :type page_size: int, optional """ self.project_id = project_id self.project_name = project_name self.source_topic_id = source_topic_id self.source_topic_name = source_topic_name self.task_id = task_id self.task_name = task_name self.status = status self.iam_project_name = iam_project_name self.page_number = page_number self.page_size = page_size def check_validation(self): """\ :return: 参数是否合法 :rtype: bool """ return True class CancelDownloadTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 下载任务 ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None class DescribeScheduleSqlTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 定时 SQL 分析任务 ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None class DeleteScheduleSqlTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 定时SQL分析任务的ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None class DeleteETLTaskRequest(TLSRequest): def __init__(self, task_id: str): """ :param task_id: 待删除的加工任务的 ID :type task_id: str """ self.task_id = task_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None class CreateTraceInstanceRequest(TLSRequest): def __init__(self, project_id: str, trace_instance_name: str, description: str = None): """ :param project_id: 日志主题所属的日志项目uuid :type project_id: str :param trace_instance_name: Trace实例名称:同一个日志项目下,日志主题名称不可重复; 只能包括小写字母、数字、中文和短划线(-); 必须以小写字母、中文或者数字开头和结尾;长度为3~30字符 :type trace_instance_name: str :param description: Trace实例描述信息:不支持<>、'、、;长度为0-64个字符 :type description: str """ self.project_id = project_id self.trace_instance_name = trace_instance_name self.description = description def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.project_id is not None and self.trace_instance_name is not None class DeleteTraceInstanceRequest(TLSRequest): def __init__(self, trace_instance_id: str): """ :param trace_instance_id: Trace实例 ID :type trace_instance_id: str """ self.trace_instance_id = trace_instance_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.trace_instance_id is not None class ModifyTraceInstanceRequest(TLSRequest): def __init__(self, trace_instance_id: str, description: str = None): """ :param trace_instance_id: Trace实例 ID :type trace_instance_id: str :param description: Trace实例描述信息:不支持<>、'、、;长度为0-64个字符 :type description: str """ self.trace_instance_id = trace_instance_id self.description = description def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.trace_instance_id is not None class DescribeTraceInstanceRequest(TLSRequest): def __init__(self, trace_instance_id: str): """ :param trace_instance_id: Trace实例 ID :type trace_instance_id: str """ self.trace_instance_id = trace_instance_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.trace_instance_id is not None class DescribeTraceInstancesRequest(TLSRequest): def __init__(self, page_number: int = 1, page_size: int = 20, trace_instance_name: str = None, trace_instance_id: str = None, project_id: str = None, project_name: str = None, status: str = None, iam_project_name: str = None): """ :param page_number: 分页,默认从1开始 :type page_number: int :param page_size: 分页大小限制,默认为20,最大为100 :type page_size: int :param trace_instance_name: Trace实例名称,作为模糊查询使用。TraceInstanceName和TraceInstanceId只能提供一个 :type trace_instance_name: str :param trace_instance_id: Trace实例ID,作为模糊查询使用 :type trace_instance_id: str :param project_id: 日志项目ID :type project_id: str :param project_name: 日志项目名称 :type project_name: str :param status: Trace实例的状态 :type status: str :param iam_project_name: IAM日志项目名称 :type iam_project_name: str """ self.page_number = page_number self.page_size = page_size self.trace_instance_name = trace_instance_name self.trace_instance_id = trace_instance_id self.project_id = project_id self.project_name = project_name self.status = status self.iam_project_name = iam_project_name def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True class GetAccountStatusRequest(TLSRequest): def __init__(self): """ GetAccountStatus 请求参数定义 """ pass def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return True class DescribeTraceRequest(TLSRequest): def __init__(self, trace_id: str, trace_instance_id: str): """ :param trace_id: Trace ID :type trace_id: str :param trace_instance_id: Trace 实例 ID :type trace_instance_id: str """ self.trace_id = trace_id self.trace_instance_id = trace_instance_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.trace_id is not None and self.trace_instance_id is not None class SearchTracesRequest(TLSRequest): def __init__(self, trace_instance_id: str, query: dict = None): """ :param trace_instance_id: Trace 实例 ID :type trace_instance_id: str :param query: 查询条件,包含分页、过滤等信息 :type query: dict """ self.trace_instance_id = trace_instance_id # 始终使用字典表示查询条件,便于在请求体中直接序列化 self.query = query or {} def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.trace_instance_id is not None class ModifyAlarmWebhookIntegrationRequest(TLSRequest): def __init__(self, webhook_id: str, webhook_name: str, webhook_type: str, webhook_url: str, webhook_method: str = None, webhook_headers: List['GeneralWebhookHeaderKV'] = None, webhook_secret: str = None): """ :param webhook_id: 告警 Webhook 集成配置 ID :type webhook_id: str :param webhook_name: Webhook 集成配置名称 :type webhook_name: str :param webhook_type: Webhook 类型。GeneralWebhook:自定义 Webhook;Lark:飞书;DingTalk:钉钉;WeChat:企业微信 :type webhook_type: str :param webhook_url: Webhook 请求地址 :type webhook_url: str :param webhook_method: 自定义 Webhook 请求方法,仅支持 POST、PUT :type webhook_method: str :param webhook_headers: 自定义 Webhook 的请求头,WebhookType 为 GeneralWebhook 时必填 :type webhook_headers: List[GeneralWebhookHeaderKV] :param webhook_secret: Webhook 加密密钥 :type webhook_secret: str """ self.webhook_id = webhook_id self.webhook_name = webhook_name self.webhook_type = webhook_type self.webhook_url = webhook_url self.webhook_method = webhook_method self.webhook_headers = webhook_headers self.webhook_secret = webhook_secret def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if not self.webhook_id or not self.webhook_name or not self.webhook_type or not self.webhook_url: return False # 当 WebhookType 为 GeneralWebhook 时,WebhookMethod 和 WebhookHeaders 必填 if self.webhook_type == "GeneralWebhook": if not self.webhook_method or not self.webhook_headers: return False return True def get_api_input(self): body = super(ModifyAlarmWebhookIntegrationRequest, self).get_api_input() # 适配字段命名:WebhookId -> WebhookID if "WebhookId" in body: body[WEBHOOK_ID] = body.pop("WebhookId") if self.webhook_headers is not None: body[WEBHOOK_HEADERS] = [] for header in self.webhook_headers: header_dict = {} if header.key is not None: header_dict[KEY] = header.key if header.value is not None: header_dict[VALUE] = header.value body[WEBHOOK_HEADERS].append(header_dict) return body class CreateAlarmWebhookIntegrationRequest(TLSRequest): def __init__(self, webhook_name: str, webhook_type: str, webhook_url: str, webhook_method: str = None, webhook_headers: List['GeneralWebhookHeaderKV'] = None, webhook_secret: str = None): """ :param webhook_name: Webhook 集成配置名称。命名规则请参考资源命名规则 :type webhook_name: str :param webhook_type: Webhook 类型。GeneralWebhook:自定义 Webhook 地址。 Lark:飞书。DingTalk:钉钉。WeChat:企业微信 :type webhook_type: str :param webhook_url: Webhook 请求地址 :type webhook_url: str :param webhook_method: 自定义 Webhook 请求方法,仅支持 POST、PUT :type webhook_method: str :param webhook_headers: 自定义 Webhook 的请求头。 设置 WebhookType 为 GeneralWebhook 时,必填 :type webhook_headers: List[GeneralWebhookHeaderKV] :param webhook_secret: Webhook 加密密钥。 设置 WebhookType 为 Lark,且在飞书机器人中设置安全设置为签名校验时, 需在此处输入飞书机器人的签名密钥。 设置 WebhookType 为 DingTalk,且在钉钉机器人中设置了签名值时, 需在此处输入钉钉机器人的签名值 :type webhook_secret: str """ self.webhook_name = webhook_name self.webhook_type = webhook_type self.webhook_url = webhook_url self.webhook_method = webhook_method self.webhook_headers = webhook_headers self.webhook_secret = webhook_secret def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if not self.webhook_name or not self.webhook_type or not self.webhook_url: return False # 当 WebhookType 为 GeneralWebhook 时,WebhookMethod 和 WebhookHeaders 必填 if self.webhook_type == "GeneralWebhook": if not self.webhook_method or not self.webhook_headers: return False return True def get_api_input(self): body = super(CreateAlarmWebhookIntegrationRequest, self).get_api_input() if self.webhook_headers is not None: body[WEBHOOK_HEADERS] = [] for header in self.webhook_headers: header_dict = {} if header.key is not None: header_dict[KEY] = header.key if header.value is not None: header_dict[VALUE] = header.value body[WEBHOOK_HEADERS].append(header_dict) return body class DeleteAlarmWebhookIntegrationRequest(TLSRequest): def __init__(self, webhook_id: str): """ :param webhook_id: 告警 Webhook 集成配置的 ID :type webhook_id: str """ self.webhook_id = webhook_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.webhook_id is not None def get_api_input(self): body = super(DeleteAlarmWebhookIntegrationRequest, self).get_api_input() # 适配字段命名:WebhookId -> WebhookID if "WebhookId" in body: body[WEBHOOK_ID] = body.pop("WebhookId") return body class DeleteAlarmContentTemplateRequest(TLSRequest): def __init__(self, alarm_content_template_id: str): """ :param alarm_content_template_id: 告警通知内容模板的 ID :type alarm_content_template_id: str """ self.alarm_content_template_id = alarm_content_template_id def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.alarm_content_template_id is not None class ModifyAlarmContentTemplateRequest(TLSRequest): def __init__( self, alarm_content_template_id: str, alarm_content_template_name: str, ding_talk_content_template: "DingTalkContentTemplateInfo" = None, email_content_template: "EmailContentTemplateInfo" = None, lark_content_template: "LarkContentTemplateInfo" = None, sms_content_template: "SmsContentTemplateInfo" = None, vms_content_template: "VmsContentTemplateInfo" = None, we_chat_content_template: "WeChatContentTemplateInfo" = None, webhook_content_template: "WebhookContentTemplateInfo" = None, need_valid_content: bool = None, ): """修改告警通知内容模板 :param alarm_content_template_id: 告警通知内容模板 ID :param alarm_content_template_name: 告警通知内容模板名称 :param ding_talk_content_template: 钉钉通知内容模板 :param email_content_template: 邮件通知内容模板 :param lark_content_template: 飞书通知内容模板 :param sms_content_template: 短信通知内容模板 :param vms_content_template: 语音通知内容模板 :param we_chat_content_template: 企业微信通知内容模板 :param webhook_content_template: 自定义 Webhook 通知内容模板 :param need_valid_content: 是否需要校验内容模板 """ self.alarm_content_template_id = alarm_content_template_id self.alarm_content_template_name = alarm_content_template_name self.ding_talk_content_template = ding_talk_content_template self.email_content_template = email_content_template self.lark_content_template = lark_content_template self.sms_content_template = sms_content_template self.vms_content_template = vms_content_template self.we_chat_content_template = we_chat_content_template self.webhook_content_template = webhook_content_template self.need_valid_content = need_valid_content def check_validation(self): """校验必填参数合法性""" return bool(self.alarm_content_template_id) and bool(self.alarm_content_template_name) def get_api_input(self): """构造 API 入参 对齐服务端 alarm_content_template.ModifyReq 结构: - AlarmContentTemplateId / AlarmContentTemplateName 直接使用 snake_to_pascal 转换结果; - DingTalk/Email/Lark/Sms/Vms/WeChat/Webhook 需展开为对应内容模板的 JSON; - NeedValidContent 直接透传。 """ body = super(ModifyAlarmContentTemplateRequest, self).get_api_input() # 移除自动生成的 *ContentTemplate 字段,统一映射为服务端定义字段 for key in ( DING_TALK_CONTENT_TEMPLATE, EMAIL_CONTENT_TEMPLATE, LARK_CONTENT_TEMPLATE, SMS_CONTENT_TEMPLATE, VMS_CONTENT_TEMPLATE, WE_CHAT_CONTENT_TEMPLATE, WEBHOOK_CONTENT_TEMPLATE, ): if key in body: del body[key] if self.ding_talk_content_template is not None: body[DING_TALK] = self.ding_talk_content_template.json() if self.email_content_template is not None: body[EMAIL] = self.email_content_template.json() if self.lark_content_template is not None: body[LARK] = self.lark_content_template.json() if self.sms_content_template is not None: body["Sms"] = self.sms_content_template.json() if self.vms_content_template is not None: body[VMS] = self.vms_content_template.json() if self.we_chat_content_template is not None: body[WE_CHAT] = self.we_chat_content_template.json() if self.webhook_content_template is not None: body[WEBHOOK] = self.webhook_content_template.json() return body class CreateETLTaskRequest(TLSRequest): def __init__(self, dsl_type: str, name: str, source_topic_id: str, script: str, target_resources: list, task_type: str = "Resident", enable: bool = True, description: str = None, from_time: int = None, to_time: int = None): """ :param dsl_type: DSL类型,固定为NORMAL :type dsl_type: str :param name: 数据加工任务的名称 :type name: str :param source_topic_id: 待加工数据的源日志主题ID :type source_topic_id: str :param script: 数据加工规则 :type script: str :param target_resources: 输出目标的相关信息数组 :type target_resources: list :param task_type: 任务类型,固定为Resident(常驻任务) :type task_type: str :param enable: 是否启用该数据加工任务,true表示启用,false表示关闭 :type enable: bool :param description: 数据加工任务的描述信息 :type description: str :param from_time: 待加工数据的起始时间戳(Unix时间戳) :type from_time: int :param to_time: 待加工数据的结束时间戳(Unix时间戳) :type to_time: int """ self.dsl_type = dsl_type self.name = name self.source_topic_id = source_topic_id self.script = script self.target_resources = target_resources self.task_type = task_type self.enable = enable self.description = description self.from_time = from_time self.to_time = to_time def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if (self.dsl_type is None or self.name is None or self.source_topic_id is None or self.script is None or self.target_resources is None or self.task_type is None or self.enable is None): return False # 验证 target_resources 格式(仅做基础结构校验,不做范围与跨账号约束) if not isinstance(self.target_resources, list): return False for resource in self.target_resources: if not isinstance(resource, dict): return False if 'alias' not in resource or 'topic_id' not in resource or 'region' not in resource: return False return True def get_api_input(self): """构造 CreateETLTask 请求体 - 确保 DSL 字段键名为 `DSLType`(而非默认的 `DslType`); - 规范化 TargetResources 数组中每个元素的键名为 `Alias` / `TopicId` / `Region` / `RoleTrn`。 """ body = super(CreateETLTaskRequest, self).get_api_input() # 修正 DSLType 键名 if "DslType" in body: body[DSL_TYPE] = body.pop("DslType") # 规范化 TargetResources 结构 if self.target_resources is not None: normalized_resources = [] for resource in self.target_resources: if isinstance(resource, TargetResource): # 使用数据类的 json() 确保键名为 Alias/TopicId/Region/RoleTrn normalized_resources.append(resource.json()) elif isinstance(resource, dict): alias = resource.get("Alias") or resource.get("alias") topic_id = resource.get("TopicId") or resource.get("topic_id") region = resource.get("Region") or resource.get("region") role_trn = resource.get("RoleTrn") or resource.get("role_trn") normalized = {} if alias is not None: normalized[TARGET_ALIAS] = alias if topic_id is not None: normalized[TARGET_TOPIC_ID] = topic_id if region is not None: normalized[TARGET_REGION] = region if role_trn is not None: normalized[TARGET_ROLE_TRN] = role_trn normalized_resources.append(normalized) else: # 保持兼容:对非 dict/TargetResource 类型直接透传 normalized_resources.append(resource) body[ETL_TARGET_RESOURCES] = normalized_resources return body class CreateAlarmContentTemplateRequest(TLSRequest): def __init__(self, alarm_content_template_name: str, ding_talk: 'DingTalkContentTemplateInfo' = None, email: 'EmailContentTemplateInfo' = None, lark: 'LarkContentTemplateInfo' = None, need_valid_content: bool = None, sms: 'SmsContentTemplateInfo' = None, vms: 'VmsContentTemplateInfo' = None, we_chat: 'WeChatContentTemplateInfo' = None, webhook: 'WebhookContentTemplateInfo' = None): """ :param alarm_content_template_name: 告警通知内容模版的名称 :param ding_talk: 钉钉通知内容模版 :param email: 邮件通知内容模版 :param lark: 飞书通知内容模版 :param need_valid_content: 是否需要校验内容模版 :param sms: 短信通知内容模版 :param vms: 语音通知内容模版 :param we_chat: 企业微信通知内容模版 :param webhook: 自定义的 Webhook 告警通知内容模版 """ self.alarm_content_template_name = alarm_content_template_name self.ding_talk = ding_talk self.email = email self.lark = lark self.need_valid_content = need_valid_content self.sms = sms self.vms = vms self.we_chat = we_chat self.webhook = webhook def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.alarm_content_template_name is not None and self.alarm_content_template_name != "" def get_api_input(self): body = super(CreateAlarmContentTemplateRequest, self).get_api_input() if self.ding_talk is not None: body[DING_TALK] = self.ding_talk.json() if self.email is not None: body[EMAIL] = self.email.json() if self.lark is not None: body[LARK] = self.lark.json() if self.sms is not None: body["Sms"] = self.sms.json() if self.vms is not None: body[VMS] = self.vms.json() if self.we_chat is not None: body[WE_CHAT] = self.we_chat.json() if self.webhook is not None: body[WEBHOOK] = self.webhook.json() return body class ModifyETLTaskStatusRequest(TLSRequest): def __init__(self, task_id: str, enable: bool): """ :param task_id: 加工任务 ID :type task_id: str :param enable: 是否开启数据加工任务。true:开启。false:不开启 :type enable: bool """ self.task_id = task_id self.enable = enable def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return self.task_id is not None and self.enable is not None class CreateScheduleSqlTaskRequest(TLSRequest): def __init__(self, task_name: str, topic_id: str, dest_topic_id: str, process_start_time: int, process_time_window: str, query: str, request_cycle: RequestCycle, status: int, dest_region: str = None, process_end_time: int = None, process_sql_delay: int = None, description: str = None): """ :param task_name: 定时SQL分析任务名称 :type task_name: str :param topic_id: 待进行定时SQL分析的原始日志所在的日志主题ID :type topic_id: str :param dest_topic_id: 用于存储定时SQL分析结果数据的目标日志主题ID :type dest_topic_id: str :param process_start_time: 调度定时SQL分析任务的开始时间,即创建第一个实例的时间。格式为秒级时间戳 :type process_start_time: int :param process_time_window: SQL时间窗口,即定时SQL分析任务运行时,日志检索与分析的时间范围,左闭右开格式。最大24小时,最小1分钟 :type process_time_window: str :param query: 定时SQL分析任务定期执行的检索与分析语句,应符合日志服务的检索与分析语法 :type query: str :param request_cycle: 定时SQL分析任务的调度周期。调度周期决定每个实例的调度时间 :type request_cycle: RequestCycle :param status: 完成任务配置后是否立即启动定时SQL分析任务。0:关闭任务,后续需手动启动任务;1:立即启动 :type status: int :param dest_region: 目标日志主题所属地域。默认为当前地域 :type dest_region: str, optional :param process_end_time: 调度定时SQL分析任务的结束时间,格式为秒级时间戳。如果不配置,表示持续运行定时SQL分析任务 :type process_end_time: int, optional :param process_sql_delay: 每次调度的延迟时间。取值范围为0~120,单位为秒。如果不配置,则表示0,即无延时 :type process_sql_delay: int, optional :param description: 定时SQL分析任务的简单描述。不支持<>、'、\\、\\\\;长度范围为0~64个字符 :type description: str, optional """ self.task_name = task_name self.topic_id = topic_id self.dest_topic_id = dest_topic_id self.process_start_time = process_start_time self.process_time_window = process_time_window self.query = query self.request_cycle = request_cycle self.status = status self.dest_region = dest_region self.process_end_time = process_end_time self.process_sql_delay = process_sql_delay self.description = description def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ return (self.task_name is not None and self.topic_id is not None and self.dest_topic_id is not None and self.process_start_time is not None and self.process_time_window is not None and self.query is not None and self.request_cycle is not None and self.status is not None) def get_api_input(self): body = super(CreateScheduleSqlTaskRequest, self).get_api_input() # TopicId/DestTopicId 映射到服务端实际定义的 TopicID/DestTopicID if TOPIC_ID in body: body[TOPIC_ID_UPPERCASE] = body.pop(TOPIC_ID) if "DestTopicId" in body: body[DEST_TOPIC_ID] = body.pop("DestTopicId") if self.request_cycle is not None: body[REQUEST_CYCLE] = self.request_cycle.json() return body class ModifyScheduleSqlTaskRequest(TLSRequest): def __init__(self, task_id: str, task_name: str = None, description: str = None, dest_region: str = None, dest_topic_id: str = None, status: int = None, process_sql_delay: int = None, process_time_window: str = None, query: str = None, request_cycle: RequestCycle = None): """ :param task_id: 定时SQL分析任务ID :type task_id: str :param task_name: 定时SQL分析任务名称 :type task_name: str :param description: 定时SQL分析任务的简单描述 :type description: str :param dest_region: 目标日志主题所属地域 :type dest_region: str :param dest_topic_id: 用于存储SQL分析结果数据的目标日志主题ID :type dest_topic_id: str :param status: 完成任务配置后是否立即启动定时SQL分析任务。可选值:0:关闭任务,后续需手动启动任务;1:立即启动 :type status: int :param process_sql_delay: 每次调度的延迟时间。取值范围为0~120,单位为秒 :type process_sql_delay: int :param process_time_window: SQL时间窗口。定时SQL分析任务运行时,检索与分析日志的时间范围,左闭右开格式 :type process_time_window: str :param query: 定时SQL分析任务定期执行的检索与分析语句,应符合日志服务的检索与分析语法 :type query: str :param request_cycle: 定时SQL分析任务的调度周期 :type request_cycle: RequestCycle """ self.task_id = task_id self.task_name = task_name self.description = description self.dest_region = dest_region self.dest_topic_id = dest_topic_id self.status = status self.process_sql_delay = process_sql_delay self.process_time_window = process_time_window self.query = query self.request_cycle = request_cycle def check_validation(self): """ :return: 参数是否合法 :rtype: bool """ if self.task_id is None: return False return True def get_api_input(self): body = super(ModifyScheduleSqlTaskRequest, self).get_api_input() # DestTopicId 映射到服务端实际定义的 DestTopicID if "DestTopicId" in body: body[DEST_TOPIC_ID] = body.pop("DestTopicId") if self.request_cycle is not None: body[REQUEST_CYCLE] = self.request_cycle.json() return body class DescribeScheduleSqlTasksRequest(TLSRequest): def __init__(self, project_id: str = None, project_name: str = None, iam_project_name: str = None, topic_id: str = None, source_topic_name: str = None, task_id: str = None, task_name: str = None, status: str = None, page_number: int = 1, page_size: int = 20): """ :param project_id: 源日志主题所属的日志项目 ID :type project_id: str, optional :param project_name: 源日志主题所属的日志项目名称 :type project_name: str, optional :param iam_project_name: IAM 日志项目名称 :type iam_project_name: str, optional :param topic_id: 源日志主题 ID :type topic_id: str, optional :param source_topic_name: 源日志主题名称 :type source_topic_name: str, optional :param task_id: 定时 SQL 分析任务 ID :type task_id: str, optional :param task_name: 定时 SQL 分析任务名称 :type task_name: str, optional :param status: 定时SQL任务的状态 :type status: str, optional :param page_number: 分页查询时的页码。默认为 1,即从第一页数据开始返回 :type page_number: int, optional :param page_size: 分页大小。默认为 20,最大为 100 :type page_size: int, optional """ self.project_id = project_id self.project_name = project_name self.iam_project_name = iam_project_name self.topic_id = topic_id self.source_topic_name = source_topic_name self.task_id = task_id self.task_name = task_name self.status = status self.page_number = page_number self.page_size = page_size class DescribeAlarmContentTemplatesRequest(TLSRequest): def __init__(self, alarm_content_template_name: str = None, alarm_content_template_id: str = None, order_field: str = None, asc: bool = None, page_number: int = None, page_size: int = None): """查询告警通知内容模版列表请求 :param alarm_content_template_name: 告警通知内容模版的名称 :type alarm_content_template_name: str :param alarm_content_template_id: 告警通知内容模版 ID :type alarm_content_template_id: str :param order_field: 用于排序的字段 :type order_field: str :param asc: 是否升序排列 :type asc: bool :param page_number: 分页页码 :type page_number: int :param page_size: 页面大小 :type page_size: int """ self.alarm_content_template_name = alarm_content_template_name self.alarm_content_template_id = alarm_content_template_id self.order_field = order_field self.asc = asc self.page_number = page_number self.page_size = page_size def check_validation(self): """参数校验,目前全部可选,恒为 True""" return True def get_api_input(self): body = super(DescribeAlarmContentTemplatesRequest, self).get_api_input() # 适配排序方向参数:Asc -> "ASC",与服务端 consts.AlarmContentTemplateOrderASC 对齐 if "Asc" in body: body["ASC"] = body.pop("Asc") return body class DescribeAlarmWebhookIntegrationsRequest(TLSRequest): def __init__(self, webhook_id: str = None, webhook_name: str = None, webhook_type: str = None, page_number: int = 1, page_size: int = 20): """查询告警 Webhook 集成配置列表请求 :param webhook_id: Webhook 集成配置的 ID :type webhook_id: str :param webhook_name: Webhook 集成配置名称 :type webhook_name: str :param webhook_type: Webhook 集成配置的类型 :type webhook_type: str :param page_number: 分页查询时的页码 :type page_number: int :param page_size: 分页大小 :type page_size: int """ self.webhook_id = webhook_id self.webhook_name = webhook_name self.webhook_type = webhook_type self.page_number = page_number self.page_size = page_size def check_validation(self): """参数全部可选,始终视为合法""" return True def get_api_input(self): body = super(DescribeAlarmWebhookIntegrationsRequest, self).get_api_input() # 适配字段命名:WebhookId -> WebhookID if "WebhookId" in body: body[WEBHOOK_ID] = body.pop("WebhookId") return body class ListTagsForResourcesRequest(TLSRequest): def __init__(self, resource_type: str, resources_ids: List[str] = None, tag_filters: List[dict] = None, max_results: int = None, next_token: str = None): """查询资源标签列表请求 :param resource_type: 资源类型,可选值:project(日志项目)、topic(日志主题) :param resources_ids: 资源 ID 列表,最多 50 个 :param tag_filters: 资源标签过滤器 :param max_results: 分页大小,默认 20,最大 100 :param next_token: 分页查询凭证 """ self.resource_type = resource_type self.resources_ids = resources_ids self.tag_filters = tag_filters self.max_results = max_results self.next_token = next_token def check_validation(self): """参数校验""" return self.resource_type is not None def get_api_input(self): """构造 ListTagsForResources 请求体 - 顶层键名保持为 ResourceType/ResourcesIds/TagFilters/MaxResults/NextToken; - 规范化 TagFilters 内部结构为 [{"Key": ..., "Values": [...]}]。 """ body = super(ListTagsForResourcesRequest, self).get_api_input() if self.tag_filters is not None: normalized_filters = [] for tag_filter in self.tag_filters: if isinstance(tag_filter, dict): key = tag_filter.get("Key") or tag_filter.get("key") values = tag_filter.get("Values") or tag_filter.get("values") filter_body = {} if key is not None: filter_body["Key"] = key if values is not None: filter_body["Values"] = values normalized_filters.append(filter_body) else: # 保持兼容:非 dict 类型直接透传 normalized_filters.append(tag_filter) body["TagFilters"] = normalized_filters return body ================================================ FILE: volcengine/tls/tls_responses.py ================================================ # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import struct from volcengine.tls import log_content_patch from volcengine.tls.util import TLSUtil try: import lz4.block as lz4 except ImportError: try: import lz4 except ImportError: lz4 = None try: import zlib except ImportError: zlib = None from requests import Response from volcengine.tls.log_pb2 import LogGroupList from volcengine.tls.data import * class TLSResponse: def __init__(self, response: Response): self.headers = response.headers self.request_id = response.headers[X_TLS_REQUEST_ID] if "json" in self.headers[CONTENT_TYPE]: if response.text != "": self.response = json.loads(response.text) else: self.response = {} else: self.response = {DATA: response.content} def get_headers(self): """ :return: 请求headers :rtype: dict """ return self.headers def get_request_id(self): """ :return: tls请求id :rtype: str """ return self.request_id @staticmethod def _get_host_group_hosts_rules_info(host_group_hosts_rules_info) -> HostGroupHostsRulesInfo: host_group_hosts_rules_info[HOST_GROUP_INFO] = \ HostGroupInfo.set_attributes(data=host_group_hosts_rules_info[HOST_GROUP_INFO]) host_group_info = host_group_hosts_rules_info[HOST_GROUP_INFO] host_infos = [] for i in range(len(host_group_hosts_rules_info[HOST_INFOS])): host_infos.append((HostInfo.set_attributes(data=host_group_hosts_rules_info[HOST_INFOS][i]))) rule_infos = [] for i in range(len(host_group_hosts_rules_info[RULE_INFOS])): rule_infos.append(RuleInfo.set_attributes(data=host_group_hosts_rules_info[RULE_INFOS][i])) return HostGroupHostsRulesInfo(host_group_info, host_infos, rule_infos) class CreateProjectResponse(TLSResponse): def __init__(self, response: Response): super(CreateProjectResponse, self).__init__(response) self.project_id = self.response[PROJECT_ID] def get_project_id(self): """ :return:日志项目id :rtype: str """ return self.project_id class DeleteProjectResponse(TLSResponse): def __init__(self, response: Response): super(DeleteProjectResponse, self).__init__(response) class ModifyProjectResponse(TLSResponse): def __init__(self, response: Response): super(ModifyProjectResponse, self).__init__(response) class DescribeProjectResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProjectResponse, self).__init__(response) self.project = ProjectInfo.set_attributes(data=self.response) def get_project(self): """ :return: 日志项目 :rtype: ProjectInfo """ return self.project class DescribeProjectsResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProjectsResponse, self).__init__(response) self.total = self.response[TOTAL] self.projects = [] projects = self.response[PROJECTS] for i in range(len(projects)): self.projects.append(ProjectInfo.set_attributes(data=projects[i])) def get_total(self): """ :return: project总数 :rtype: int """ return self.total def get_projects(self): """ :return: 日志项目列表 :rtype: List[ProjectInfo] """ return self.projects class CreateTopicResponse(TLSResponse): def __init__(self, response: Response): super(CreateTopicResponse, self).__init__(response) self.topic_id = self.response[TOPIC_ID] def get_topic_id(self): """ :return: 日志主题 ID :rtype: str """ return self.topic_id class DeleteTopicResponse(TLSResponse): def __init__(self, response: Response): super(DeleteTopicResponse, self).__init__(response) class ModifyTopicResponse(TLSResponse): def __init__(self, response: Response): super(ModifyTopicResponse, self).__init__(response) class DescribeTopicResponse(TLSResponse): def __init__(self, response: Response): super(DescribeTopicResponse, self).__init__(response) self.topic = TopicInfo.set_attributes(data=self.response) def get_topic(self): """ :return: 日志主题 :rtype: TopicInfo """ return self.topic class DescribeTopicsResponse(TLSResponse): def __init__(self, response: Response): super(DescribeTopicsResponse, self).__init__(response) self.total = self.response[TOTAL] topics = self.response[TOPICS] self.topics = [] for i in range(len(topics)): self.topics.append(TopicInfo.set_attributes(data=topics[i])) def get_total(self): """ :return: topic总数 :rtype: int """ return self.total def get_topics(self): """ :return: topic列表 :rtype: List[TopicInfo] """ return self.topics class CreateIndexResponse(TLSResponse): def __init__(self, response: Response): super(CreateIndexResponse, self).__init__(response) self.topic_id = self.response[TOPIC_ID] class DeleteIndexResponse(TLSResponse): def __init__(self, response: Response): super(DeleteIndexResponse, self).__init__(response) class ModifyIndexResponse(TLSResponse): def __init__(self, response: Response): super(ModifyIndexResponse, self).__init__(response) class DescribeIndexResponse(TLSResponse): def __init__(self, response: Response): super(DescribeIndexResponse, self).__init__(response) self.full_text = FullTextInfo() if self.response[FULL_TEXT] is not None: self.full_text = FullTextInfo.set_attributes(data=self.response[FULL_TEXT]) self.full_text.delimiter = TLSUtil.replace_white_space_character(self.full_text.delimiter) self.key_value = [] key_value = self.response[KEY_VALUE] for i in range(len(key_value)): self.key_value.append(KeyValueInfo(key=key_value[i][KEY], value=ValueInfo.set_attributes(data=key_value[i][VALUE]))) self.key_value[i].value.delimiter = TLSUtil.replace_white_space_character(self.key_value[i].value.delimiter) self.user_inner_key_value = [] user_inner_key_value = self.response[USER_INNER_KEY_VALUE] for i in range(len(user_inner_key_value)): self.user_inner_key_value.append(KeyValueInfo(key=user_inner_key_value[i][KEY], value=ValueInfo.set_attributes(data=user_inner_key_value[i][VALUE]))) self.user_inner_key_value[i].value.delimiter = TLSUtil.replace_white_space_character(self.user_inner_key_value[i].value.delimiter) self.create_time = self.response[CREATE_TIME] self.modify_time = self.response[MODIFY_TIME] self.enable_auto_index = self.response.get(ENABLE_AUTO_INDEX, False) self.enable_phrase_index = self.response.get(ENABLE_PHRASE_INDEX, False) self.max_text_len = self.response.get(MAX_TEXT_LEN, 2048) def get_create_time(self): """ :return: 创建时间 :rtype: str """ return self.create_time def get_full_text(self): """ :return: 全文索引配置 :rtype: FullTextInfo """ return self.full_text def get_modify_time(self): """ :return: 修改时间 :rtype: str """ return self.modify_time def get_key_value(self): """ :return: 键值索引配置 :rtype: List[KeyValueInfo] """ return self.key_value def get_user_inner_key_value(self): """ :return: 预留字段索引配置 :rtype: List[KeyValueInfo] """ return self.user_inner_key_value def get_enable_auto_index(self): """ :return: 是否开启索引自动更新 :rtype: bool """ return self.enable_auto_index def get_enable_phrase_index(self): """ :return: 是否开启索引版短语查询 :rtype: bool """ return self.enable_phrase_index def get_max_text_len(self): """ :return: 统计字段值的最大长度 :rtype: int """ return self.max_text_len class CreateProcessorResponse(TLSResponse): def __init__(self, response: Response): super(CreateProcessorResponse, self).__init__(response) self.processor_id = self.response[PROCESSOR_ID_HUMP] def get_processor_id(self): return self.processor_id class DeleteProcessorResponse(TLSResponse): def __init__(self, response: Response): super(DeleteProcessorResponse, self).__init__(response) class ModifyProcessorResponse(TLSResponse): def __init__(self, response: Response): super(ModifyProcessorResponse, self).__init__(response) class DescribeProcessorResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProcessorResponse, self).__init__(response) self.processor = ProcessorInfo.set_attributes(self.response) def get_processor(self): return self.processor class DescribeProcessorsResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProcessorsResponse, self).__init__(response) self.total = self.response[TOTAL] self.items = [ ProcessorInfo.set_attributes(item) for item in self.response.get(ITEMS, []) ] def get_total(self): return self.total def get_items(self): return self.items class ExecProcessorResponse(TLSResponse): def __init__(self, response: Response): super(ExecProcessorResponse, self).__init__(response) self.exec_status = self.response.get(EXEC_STATUS) self.processed_log = self.response.get(PROCESSED_LOG) self.error = self.response.get(ERROR) def get_exec_status(self): return self.exec_status def get_processed_log(self): return self.processed_log def get_error(self): return self.error class OperateProcessorResponse(TLSResponse): def __init__(self, response: Response): super(OperateProcessorResponse, self).__init__(response) class DescribeTopicsByProcessorResponse(TLSResponse): def __init__(self, response: Response): super(DescribeTopicsByProcessorResponse, self).__init__(response) self.total = self.response[TOTAL] self.items = [ ProcessorTopicInfo.set_attributes(item) for item in self.response.get(ITEMS, []) ] def get_total(self): return self.total def get_items(self): return self.items class BindTopicProcessorResponse(TLSResponse): def __init__(self, response: Response): super(BindTopicProcessorResponse, self).__init__(response) class BatchBindTopicsResponse(TLSResponse): def __init__(self, response: Response): super(BatchBindTopicsResponse, self).__init__(response) class UnbindTopicProcessorResponse(TLSResponse): def __init__(self, response: Response): super(UnbindTopicProcessorResponse, self).__init__(response) class DescribeProcessorBindingsResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProcessorBindingsResponse, self).__init__(response) self.total = self.response[TOTAL] self.items = [ ProcessorBinding.set_attributes(item) for item in self.response.get(ITEMS, []) ] def get_total(self): return self.total def get_items(self): return self.items class DescribeProcessorFunctionsResponse(TLSResponse): def __init__(self, response: Response): super(DescribeProcessorFunctionsResponse, self).__init__(response) self.functions = {} for group, functions in self.response.get(FUNCTIONS, {}).items(): self.functions[group] = [ ProcessorFunctionInfo.set_attributes(function) for function in functions ] def get_functions(self): return self.functions class PutLogsResponse(TLSResponse): def __init__(self, response: Response): super(PutLogsResponse, self).__init__(response) class DescribeCursorResponse(TLSResponse): def __init__(self, response: Response): super(DescribeCursorResponse, self).__init__(response) self.cursor = self.response[CURSOR] def get_cursor(self): """ :return: 游标 :rtype: str """ return self.cursor class ConsumeLogsResponse(TLSResponse): def __init__(self, response: Response, compression: str): super(ConsumeLogsResponse, self).__init__(response) self.x_tls_cursor = self.headers[X_TLS_CURSOR] self.x_tls_count = int(self.headers[X_TLS_COUNT]) self.pb_message = None if DATA in self.response: pb_message = self.response[DATA] if compression == LZ4: pb_message = lz4.decompress(struct.pack(' if sys.version_info[0] == 3: return hmac.new(key, bytes(content, encoding='utf-8'), hashlib.sha256).digest() else: return hmac.new(key, bytes(content.encode('utf-8')), hashlib.sha256).digest() @staticmethod def hmac_sha1(key, content): # type(key) == if sys.version_info[0] == 3: return hmac.new(key, bytes(content, encoding='utf-8'), hashlib.sha1).digest() else: return hmac.new(key, bytes(content.encode('utf-8')), hashlib.sha1).digest() @staticmethod def sha256(content): # type(content) == if sys.version_info[0] == 3: if isinstance(content, str) is True: return hashlib.sha256(content.encode('utf-8')).hexdigest() else: return hashlib.sha256(content).hexdigest() else: if isinstance(content, (str, unicode)) is True: return hashlib.sha256(content.encode('utf-8')).hexdigest() else: return hashlib.sha256(content).hexdigest() @staticmethod def to_hex(content): lst = [] for ch in content: if sys.version_info[0] == 3: hv = hex(ch).replace('0x', '') else: hv = hex(ord(ch)).replace('0x', '') if len(hv) == 1: hv = '0' + hv lst.append(hv) return reduce(lambda x, y: x + y, lst) @staticmethod def pad(plain_text): block_size = AES.block_size number_of_bytes_to_pad = block_size - len(plain_text) % block_size ascii_string = chr(0) padding_str = number_of_bytes_to_pad * ascii_string padded_plain_text = plain_text + padding_str return padded_plain_text @staticmethod def generate_access_key_id(prefix): uid = str(uuid.uuid4()) uid_base64 = base64.b64encode(uid.replace('-', '').encode(encoding='utf-8')) s = uid_base64.decode().replace('=', '').replace('/', '').replace('+', '').replace('-', '') return prefix + s @staticmethod def rand_string_runes(length): return ''.join(random.sample(list(LETTER_RUNES), length)) @staticmethod def aes_encrypt_cbc_with_base64(orig_data, key): # type(orig_data) == # type(key) == generator = AES.new(key, AES.MODE_CBC, key) if sys.version_info[0] == 3: crypt = generator.encrypt(Util.pad(orig_data).encode('utf-8')) return base64.b64encode(crypt).decode() else: crypt = generator.encrypt(Util.pad(orig_data)) return base64.b64encode(crypt) @staticmethod def generate_secret_key(): rand_str = Util.rand_string_runes(32) return Util.aes_encrypt_cbc_with_base64(rand_str, 'bytedance-isgood'.encode('utf-8')) @staticmethod def crc32(file_path): prev = 0 for eachLine in open(file_path, "rb"): prev = crc32(eachLine, prev) return prev & 0xFFFFFFFF ================================================ FILE: volcengine/util/__init__.py ================================================ ================================================ FILE: volcengine/vedit/VEditService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service class VEditService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VEditService, "_instance"): with VEditService._instance_lock: if not hasattr(VEditService, "_instance"): VEditService._instance = object.__new__(cls) return VEditService._instance def __init__(self, region='cn-north-1'): self.service_info = VEditService.get_service_info(region) self.api_info = VEditService.get_api_info() super(VEditService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("vedit.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'edit', 'cn-north-1'), 5, 5, "https") } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info @staticmethod def get_api_info(): api_info = {"SubmitDirectEditTaskAsync": ApiInfo("POST", "/", {"Action": "SubmitDirectEditTaskAsync", "Version": "2018-01-01"}, {}, {}), "GetDirectEditResult": ApiInfo("POST", "/", {"Action": "GetDirectEditResult", "Version": "2018-01-01"}, {}, {}), "SubmitTemplateTaskAsync": ApiInfo("POST", "/", {"Action": "SubmitTemplateTaskAsync", "Version": "2018-01-01"}, {}, {}) } return api_info def submit_direct_edit_task_async(self, body): res = self.json('SubmitDirectEditTaskAsync', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def get_direct_edit_result(self, body): res = self.json('GetDirectEditResult', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json def submit_template_task_async(self, body): res = self.json('SubmitTemplateTaskAsync', {}, body) if res == '': raise Exception("empty response") res_json = json.loads(res) return res_json ================================================ FILE: volcengine/vedit/__init__.py ================================================ ================================================ FILE: volcengine/veen/__init__.py ================================================ ================================================ FILE: volcengine/veen/service.py ================================================ # -*- coding: utf-8 -*- import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo SERVICE_VERSION = "2021-04-30" service_info_map = { "cn-north-1": ServiceInfo("veenedge.volcengineapi.com", {'accept': 'application/json', }, Credentials('', '', "veenedge", "cn-north-1"), 60 * 5, 60 * 5, "https"), } api_info = { # 创建边缘服务: https://www.volcengine.com/docs/6499/76856 "CreateCloudServer": ApiInfo("POST", "/", { "Action": "CreateCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘服务列表: https://www.volcengine.com/docs/6499/76857 "ListCloudServers": ApiInfo("GET", "/", { "Action": "ListCloudServers", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘服务详情: https://www.volcengine.com/docs/6499/76858 "GetCloudServer": ApiInfo("GET", "/", { "Action": "GetCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 启动边缘服务: https://www.volcengine.com/docs/6499/81036 "StartCloudServer": ApiInfo("POST", "/", { "Action": "StartCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 停止边缘服务: https://www.volcengine.com/docs/6499/81035 "StopCloudServer": ApiInfo("POST", "/", { "Action": "StopCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 重启边缘服务: https://www.volcengine.com/docs/6499/81037 "RebootCloudServer": ApiInfo("POST", "/", { "Action": "RebootCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 删除边缘服务: https://www.volcengine.com/docs/6499/76859 "DeleteCloudServer": ApiInfo("POST", "/", { "Action": "DeleteCloudServer", "Version": SERVICE_VERSION}, {}, {}), # 获取可开通的实例规格: https://www.volcengine.com/docs/6499/76860 "ListInstanceTypes": ApiInfo("GET", "/", { "Action": "ListInstanceTypes", "Version": SERVICE_VERSION}, {}, {}), # 获取支持的区域和运营商: https://www.volcengine.com/docs/6499/76861 "ListAvailableResourceInfo": ApiInfo("GET", "/", { "Action": "ListAvailableResourceInfo", "Version": SERVICE_VERSION}, {}, {}), # 新增边缘实例: https://www.volcengine.com/docs/6499/76863 "CreateInstance": ApiInfo("POST", "/", { "Action": "CreateInstance", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘实例列表: https://www.volcengine.com/docs/6499/76862 "ListInstances": ApiInfo("GET", "/", { "Action": "ListInstances", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘实例详情: https://www.volcengine.com/docs/6499/76865 "GetInstance": ApiInfo("GET", "/", { "Action": "GetInstance", "Version": SERVICE_VERSION}, {}, {}), # 启动边缘实例: https://www.volcengine.com/docs/6499/76868 "StartInstances": ApiInfo("POST", "/", { "Action": "StartInstances", "Version": SERVICE_VERSION}, {}, {}), # 停止边缘实例: https://www.volcengine.com/docs/6499/76866 "StopInstances": ApiInfo("POST", "/", { "Action": "StopInstances", "Version": SERVICE_VERSION}, {}, {}), # 重启边缘实例: https://www.volcengine.com/docs/6499/76864 "RebootInstances": ApiInfo("POST", "/", { "Action": "RebootInstances", "Version": SERVICE_VERSION}, {}, {}), # 删除边缘实例: https://www.volcengine.com/docs/6499/81039 "OfflineInstances": ApiInfo("POST", "/", { "Action": "OfflineInstances", "Version": SERVICE_VERSION}, {}, {}), # 编辑边缘实例名称: https://www.volcengine.com/docs/6499/76867 "SetInstanceName": ApiInfo("POST", "/", { "Action": "SetInstanceName", "Version": SERVICE_VERSION}, {}, {}), # 重置边缘实例密码: https://www.volcengine.com/docs/6499/76869 "ResetLoginCredential": ApiInfo("POST", "/", { "Action": "ResetLoginCredential", "Version": SERVICE_VERSION}, {}, {}), # 获取实例云盘信息: https://www.volcengine.com/docs/6499/174016 "GetInstanceCloudDiskInfo": ApiInfo("GET", "/", { "Action": "GetInstanceCloudDiskInfo", "Version": SERVICE_VERSION}, {}, {}), # 扩容实例云盘: https://www.volcengine.com/docs/6499/174017 "ScaleInstanceCloudDiskCapacity": ApiInfo("POST", "/", { "Action": "ScaleInstanceCloudDiskCapacity", "Version": SERVICE_VERSION}, {}, {}), # 创建边缘云盘 "CreateEbsInstances": ApiInfo("POST", "/", { "Action": "CreateEbsInstances", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘云盘列表 "ListEbsInstances": ApiInfo("POST", "/", { "Action": "ListEbsInstances", "Version": SERVICE_VERSION}, {}, {}), # 获取边缘云盘详情 "GetEbsInstance": ApiInfo("POST", "/", { "Action": "GetEbsInstance", "Version": SERVICE_VERSION}, {}, {}), # 边缘云盘扩容 "ScaleEbsInstanceCapacity": ApiInfo("POST", "/", { "Action": "ScaleEbsInstanceCapacity", "Version": SERVICE_VERSION}, {}, {}), # 边缘云盘挂载 "AttachEbs": ApiInfo("POST", "/", { "Action": "AttachEbs", "Version": SERVICE_VERSION}, {}, {}), # 边缘云盘卸载 "DetachEbs": ApiInfo("POST", "/", { "Action": "DetachEbs", "Version": SERVICE_VERSION}, {}, {}), # 边缘云盘删除 "DeleteEbsInstance": ApiInfo("POST", "/", { "Action": "DeleteEbsInstance", "Version": SERVICE_VERSION}, {}, {}), # 批量重置系统或更换镜像 https://www.volcengine.com/docs/6499/196711 "BatchResetSystem": ApiInfo("POST", "/", { "Action": "BatchResetSystem", "Version": SERVICE_VERSION}, {}, {}), } class VeenService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VeenService, "_instance"): with VeenService._instance_lock: if not hasattr(VeenService, "_instance"): VeenService._instance = object.__new__(cls) return VeenService._instance def __init__(self, region="cn-north-1"): self.service_info = VeenService.get_service_info(region) self.api_info = VeenService.get_api_info() super(VeenService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region_name): service_info = service_info_map.get(region_name, None) if not service_info: raise Exception('do not support region %s' % region_name) return service_info @staticmethod def get_api_info(): return api_info def create_cloudserver(self, body=None): if body is None: body = {} action = "CreateCloudServer" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_cloudservers(self, query=None): if query is None: query = {} action = "ListCloudServers" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def get_cloudserver(self, query=None): if query is None: query = {} action = "GetCloudServer" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def start_cloudserver(self, body=None): if body is None: body = {} action = "StartCloudServer" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def stop_cloudserver(self, body=None): if body is None: body = {} action = "StopCloudServer" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def reboot_cloudserver(self, body=None): if body is None: body = {} action = "RebootCloudServer" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_cloudserver(self, body=None): if body is None: body = {} action = "DeleteCloudServer" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_instance_types(self, query=None): if query is None: query = {} action = "ListInstanceTypes" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_available_resource_info(self, query=None): if query is None: query = {} action = "ListAvailableResourceInfo" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_instance(self, body=None): if body is None: body = {} action = "CreateInstance" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_instances(self, query=None): if query is None: query = {} action = "ListInstances" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def get_instance(self, query=None): if query is None: query = {} action = "GetInstance" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def start_instances(self, body=None): if body is None: body = {} action = "StartInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def stop_instances(self, body=None): if body is None: body = {} action = "StopInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def reboot_instances(self, body=None): if body is None: body = {} action = "RebootInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def offline_instances(self, body=None): if body is None: body = {} action = "OfflineInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def set_instance_name(self, body=None): if body is None: body = {} action = "SetInstanceName" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def reset_login_credential(self, body=None): if body is None: body = {} action = "ResetLoginCredential" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def get_instance_cloud_disk_info(self, query=None): if query is None: query = {} action = "GetInstanceCloudDiskInfo" res = self.get(action,query) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def scale_instance_cloud_disk_capacity(self, body=None): if body is None: body = {} action = "ScaleInstanceCloudDiskCapacity" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def create_ebs_instances(self, body=None): if body is None: body = {} action = "CreateEbsInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def list_ebs_instances(self, body=None): if body is None: body = {} action = "ListEbsInstances" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def get_ebs_instance(self, body=None): if body is None: body = {} action = "GetEbsInstance" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def scale_ebs_instance_capacity(self, body=None): if body is None: body = {} action = "ScaleEbsInstanceCapacity" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def attach_ebs(self, body=None): if body is None: body = {} action = "AttachEbs" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def detach_ebs(self, body=None): if body is None: body = {} action = "DetachEbs" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def delete_ebs_instance(self, body=None): if body is None: body = {} action = "DeleteEbsInstance" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json def batch_reset_system(self, body=None): if body is None: body = {} action = "BatchResetSystem" res = self.json(action,[],json.dumps(body)) if res == '': raise Exception("%s: empty response" % action) res_json = json.loads(res) return res_json ================================================ FILE: volcengine/verender/VerenderService.py ================================================ # coding: utf-8 import json import os import threading import time import redo from requests import exceptions from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from volcengine.ApiInfo import ApiInfo from volcengine.verender.ftrans import FtransService SERVICE = "verender" VERSION = "2021-12-31" REGION = "cn-north1" SCHEME = "https" CONN_TIMEOUT = 5 RECV_TIMEOUT = 5 DEFAULT_PAGE_NUM = 1 DEFAULT_PAGE_SIZE = 10 DEFAULT_STORAGE_ACCESS_EXPIRED_SEC = 15 * 60 def _list_dir(dir_name, max_depth=50): if max_depth <= 0: raise Exception("too deep dir %s" % dir_name) local_files = [] files = os.listdir(dir_name) if len(files) == 0: local_files.append(dir_name) for f in files: full_path = os.path.join(dir_name, f) if os.path.isfile(full_path): local_files.append(full_path) else: subs = _list_dir(full_path, max_depth - 1) for e in subs: local_files.append(e) return local_files def _to_slash(filename): filename = filename.replace(":\\", "/").replace("\\", "/") if filename[0] == '/': filename = filename[1:] return filename class FileInfo(object): def __init__(self, name, size, mtime, md5=None): self.name = name self.size = size self.mtime = mtime self.md5 = md5 def __str__(self): return "name: %s, size: %d, mtime: %d, md5: %s" % (self.name, self.size, self.mtime, self.md5) class VerenderService(Service): _lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VerenderService, "_instance"): with VerenderService._lock: if not hasattr(VerenderService, "_instance"): VerenderService._instance = object.__new__(cls) return VerenderService._instance # ftrans_client_addr是快传客户端的地址 不配置默认使用S10 传输速度会低于快传客户端 # ftrans_proxy_addr是代理的管理地址 不需要代理则无需配置 def __init__(self, ftrans_client_addr=None, ftrans_proxy_addr=None): self.api_info = VerenderService.get_api_info() self.service_info = VerenderService.get_service_info() self._ftrans_client_addr = ftrans_client_addr self._ftrans_proxy_addr = ftrans_proxy_addr self._storage_access_map = {} super(VerenderService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo( "open.volcengineapi.com", {"Accept": "application/json"}, Credentials("", "", SERVICE, REGION), CONN_TIMEOUT, RECV_TIMEOUT, SCHEME ) return service_info @staticmethod def get_api_info(): api_info = { "ListWorkspace": ApiInfo( "GET", "/", {"Action": "ListWorkspaces", "Version": VERSION}, {}, {} ), "GetStorageAccess": ApiInfo( "GET", "/", {"Action": "GetStorageAccess", "Version": VERSION}, {}, {} ), "ListDccs": ApiInfo( "GET", "/", {"Action": "ListDccs", "Version": VERSION}, {}, {} ), "ListAccountDccPlugins": ApiInfo( "GET", "/", {"Action": "ListAccountDccPlugins", "Version": VERSION}, {}, {} ), "GetCurrentUser": ApiInfo( "GET", "/", {"Action": "GetCurrentUser", "Version": VERSION}, {}, {} ), "CreateRenderJob": ApiInfo( "POST", "/", {"Action": "CreateRenderJob", "Version": VERSION}, {}, {} ), "ListRenderJob": ApiInfo( "GET", "/", {"Action": "ListRenderJobs", "Version": VERSION}, {}, {} ), "GetRenderJob": ApiInfo( "GET", "/", {"Action": "GetRenderJob", "Version": VERSION}, {}, {} ), "RetryRenderJob": ApiInfo( "POST", "/", {"Action": "RetryJob", "Version": VERSION}, {}, {} ), "ResumeRenderJobs": ApiInfo( "POST", "/", {"Action": "ResumeJobs", "Version": VERSION}, {}, {} ), "StopRenderJobs": ApiInfo( "POST", "/", {"Action": "StopJobs", "Version": VERSION}, {}, {} ), "DeleteRenderJobs": ApiInfo( "POST", "/", {"Action": "DeleteJobs", "Version": VERSION}, {}, {} ), "FullSpeedRenderJobs": ApiInfo( "POST", "/", {"Action": "FullSpeedRenderJobs", "Version": VERSION}, {}, {} ), "AutoAllRenderJobs": ApiInfo( "POST", "/", {"Action": "AutoAllRenderJobs", "Version": VERSION}, {}, {} ), "UpdateRenderJobsPriority": ApiInfo( "POST", "/", {"Action": "UpdateRenderJobsPriority", "Version": VERSION}, {}, {} ), "ListJobOutput": ApiInfo( "POST", "/", {"Action": "ListJobOutput", "Version": VERSION}, {}, {} ), "GetJobOutput": ApiInfo( "POST", "/", {"Action": "GetJobOutput", "Version": VERSION}, {}, {} ), "UpdateJobOutput": ApiInfo( "POST", "/", {"Action": "UpdateJobOutput", "Version": VERSION}, {}, {} ), "ListCellSpec": ApiInfo( "GET", "/", {"Action": "ListCellSpecs", "Version": VERSION}, {}, {} ), "AddRenderSetting": ApiInfo( "POST", "/", {"Action": "AddRenderSetting", "Version": VERSION}, {}, {} ), "UpdateRenderSetting": ApiInfo( "POST", "/", {"Action": "UpdateRenderSetting", "Version": VERSION}, {}, {} ), "DeleteRenderSetting": ApiInfo( "POST", "/", {"Action": "DeleteRenderSetting", "Version": VERSION}, {}, {} ), "ListRenderSetting": ApiInfo( "GET", "/", {"Action": "GetRenderSettingList", "Version": VERSION}, {}, {} ), "GetRenderSetting": ApiInfo( "GET", "/", {"Action": "GetRenderSetting", "Version": VERSION}, {}, {} ), "GetPluginList": ApiInfo( "GET", "/", {"Action": "GetPlugins", "Version": VERSION}, {}, {} ) } return api_info def _get_ftrans_client(self, workspace_id, isp): params = { "WorkspaceId": workspace_id } resp = self.list_workspace(params=params) if resp["Total"] != 1: raise Exception("workspace not found") try: ignore_upload_case = resp["Workspaces"][0]["ConvertToLowerCase"] except: ignore_upload_case = False if workspace_id not in self._storage_access_map: params = { "WorkspaceId": workspace_id } storage_access = self.get_storage_access(params) self._storage_access_map[workspace_id] = { "storage_access": storage_access, "expired_at": int(time.time()) + DEFAULT_STORAGE_ACCESS_EXPIRED_SEC, "ftrans_client_map": {}, "ignore_upload_case": ignore_upload_case } else: storage_access = self._storage_access_map[workspace_id] if storage_access["expired_at"] < int(time.time()): params = { "WorkspaceId": workspace_id } storage_access = self.get_storage_access(params) self._storage_access_map[workspace_id] = { "storage_access": storage_access["storage_access"], "expired_at": int(time.time()) + DEFAULT_STORAGE_ACCESS_EXPIRED_SEC, "ftrans_client_map": {}, "ignore_upload_case": ignore_upload_case } storage_access = self._storage_access_map[workspace_id] if isp in storage_access["ftrans_client_map"]: return storage_access["ftrans_client_map"][isp], storage_access["ignore_upload_case"] else: bucket = storage_access["storage_access"]["bucket_name"] acl_token = storage_access["storage_access"]["ftrans_security_token"] server_name = storage_access["storage_access"]["ftrans_cert_name"] s10_addr = storage_access["storage_access"]["ftrans_s10_server"] cert = storage_access["storage_access"]["cert_pem"] key = storage_access["storage_access"]["private_key_pem"] s2_addr = storage_access["storage_access"]["ftrans_quic_server"] cli = FtransService(bucket, acl_token, server_name, s10_server=s10_addr, cert_pem=cert, key_pem=key, client_addr=self._ftrans_client_addr, proxy_addr=self._ftrans_proxy_addr, s2_server=s2_addr, isp=isp) storage_access["ftrans_client_map"][isp] = cli return cli, storage_access["ignore_upload_case"] @redo.retriable(retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout, exceptions.ReadTimeout), sleeptime=0.1, jitter=0.01, attempts=2) def _call_json(self, api, params=None, body=None, with_meta=False): params = params or {} body = body or {} body = json.dumps(body) resp = self.json(api, params, body) if "" == resp: raise Exception("empty response") resp_json = json.loads(resp) if resp_json.get("ResponseMetadata", {}).get("Error", {}).get("CodeN", 0) != 0: raise Exception(resp) if with_meta: result = resp_json else: result = resp_json.get("Result", "") return result @redo.retriable(retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout, exceptions.ReadTimeout), sleeptime=0.1, jitter=0.01, attempts=2) def _call_get(self, api, params=None, with_meta=False): params = params or {} resp = self.get(api, params=params) if "" == resp: raise Exception("empty response") resp_json = json.loads(resp) if resp_json.get("ResponseMetadata", {}).get("Error", {}).get("CodeN", 0) != 0: raise Exception(resp) if with_meta: result = resp_json else: result = resp_json.get("Result", "") return result @redo.retriable(retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout, exceptions.ReadTimeout), sleeptime=0.1, jitter=0.01, attempts=2) def _call_post(self, api, params=None, form=None): params = params or {} form = form or {} resp = self.post(api, params=params, form=form) if "" == resp: raise Exception("empty response") return resp def list_workspace(self, params=None): return self._call_get("ListWorkspace", params=params) def get_storage_access(self, params=None): return self._call_get("GetStorageAccess", params=params) def get_current_user(self): return self._call_get("GetCurrentUser", params=None) # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def upload_file(self, workspace_id, src, des, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp=isp) if ignore_case: des = des.lower() name, size, mtime, md5 = cli.upload_file(src, des) return FileInfo(name, size, mtime, md5) # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def upload_folder(self, workspace_id, src_path, des_path, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp=isp) file_list = _list_dir(src_path) for file in file_list: src = _to_slash(file) src_path = _to_slash(src_path) des_path = _to_slash(des_path) if src_path[-1] != '/': src_path = src_path + "/" if des_path[-1] != '/': des_path = des_path + "/" des = des_path + src[len(src_path):] if ignore_case: des = des.lower() self.upload_file(workspace_id, file, des) # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def download_file(self, workspace_id, src, dst, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp) if ignore_case: pass name, size, mtime, md5 = cli.download_file(dst, src) return FileInfo(name, size, mtime, md5) # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def list_file(self, workspace_id, prefix, filter_in=None, order_type=None, order_field=None, page_num=None, page_size=None, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp=isp) if ignore_case: pass resp = cli.list_file(prefix, filter_in=filter_in, order_type=order_type, order_field=order_field, page_num=page_num, page_size=page_size) return resp # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def stat_file(self, workspace_id, filename, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp=isp) if ignore_case: pass size, mtime = cli.get_file_size(filename) return FileInfo(filename, size, mtime, None) # isp是传输所选择的运营商出口 可选 ct|cm|un 默认ct def remove_file(self, workspace_id, filename, isp="ct"): cli, ignore_case = self._get_ftrans_client(workspace_id, isp=isp) if ignore_case: pass return cli.remove_file(filename) def list_cell_spec(self, params=None): resp = self._call_get("ListCellSpec", params=params) return resp def create_render_job(self, params, body): resp = self._call_json("CreateRenderJob", params=params, body=body) return resp def list_render_job(self, params): resp = self._call_get("ListRenderJob", params=params) return resp def get_render_job(self, params): resp = self._call_get("GetRenderJob", params=params) return resp def retry_render_job(self, params, body): resp = self._call_json("RetryRenderJob", params=params, body=body, with_meta=True) return resp def auto_full_speed_render_jobs(self, params, body): resp = self._call_json("AutoAllRenderJobs", params=params, body=body, with_meta=True) return resp def resume_render_jobs(self, params, body): resp = self._call_json("ResumeRenderJobs", params=params, body=body, with_meta=True) return resp def stop_render_jobs(self, params, body): resp = self._call_json("StopRenderJobs", params=params, body=body, with_meta=True) return resp def delete_render_jobs(self, params, body): resp = self._call_json("DeleteRenderJobs", params=params, body=body, with_meta=True) return resp def full_speed_render_jobs(self, params, body): resp = self._call_json("FullSpeedRenderJobs", params=params, body=body, with_meta=True) return resp def update_render_jobs_priority(self, params, body): resp = self._call_json("UpdateRenderJobsPriority", params=params, body=body, with_meta=True) return resp def list_job_output(self, params, body=None): resp = self._call_json("ListJobOutput", params=params, body=body) return resp def get_job_output(self, params, body=None): resp = self._call_json("GetJobOutput", params=params, body=body) return resp def update_job_output(self, params, body=None): resp = self._call_json("UpdateJobOutput", params=params, body=body, with_meta=True) return resp def add_render_setting(self, params, body): resp = self._call_json("AddRenderSetting", params=params, body=body) return resp def update_render_setting(self, params, body): resp = self._call_json("UpdateRenderSetting", params=params, body=body, with_meta=True) return resp def delete_render_setting(self, params): resp = self._call_json("DeleteRenderSetting", params=params, with_meta=True) return resp def list_dcc(self): resp = self._call_get("ListDccs") return resp def list_render_setting(self, params): resp = self._call_get("ListRenderSetting", params=params) return resp def get_render_setting(self, params): resp = self._call_get("GetRenderSetting", params=params) return resp["Settings"][0] def list_account_dcc_plugin(self, params): resp = self._call_get("ListAccountDccPlugins", params=params) return resp ================================================ FILE: volcengine/verender/__init__.py ================================================ ================================================ FILE: volcengine/verender/ftrans.py ================================================ import base64 import hashlib import json import os import queue import random import threading import time import uuid import urllib3.poolmanager ISP_CT = "ct" ISP_UN = "un" ISP_CM = "cm" ISP_DEFAULT="default" VERSION_DEFAULT="default" SWITCH_ON = 1 SWITCH_OFF = 0 FTRANS_PROTOCOL_TCP = "tcp" FTRANS_PROTOCOL_UDP = "udp" FTRANS_HTTP_STATUS_OK = 200 FTRANS_SIG_EXPIRED_NSEC = 15 FTRANS_HTTP_METHOD_GET = "GET" FTRANS_HTTP_METHOD_POST = "POST" FTRANS_MOUNT_PATH = "/var/mnt" FTRANS_ORDER_TYPE_ASC = "asc" FTRANS_ORDER_TYPE_DESC = "desc" FTRANS_ORDER_FIELD_NAME = "name" FTRANS_ORDER_FIELD_MTIME = "mtime" FTRANS_DEFAULT_PAGE_NUM = 1 FTRANS_DEFAULT_PAGE_SIZE = 10 FTRANS_DEFAULT_FILTER_IN = "" FTRANS_PART_SIZE = 4 << 20 FTRANS_STATUS_WAITING = 0 FTRANS_STATUS_DOING = 1 FTRANS_STATUS_FINISHED = 2 FTRANS_STATUS_FAILED = 3 FTRANS_DEFAULT_PART_CONCURRENCY = 4 FTRANS_TRANS_STATUS_COMPLETED = "completed" FTRANS_TRANS_STATUS_FAILED = "failed" FTRANS_TRANS_STATUS_CANCELLED = "cancelled" FTRANS_STATUS_UPLOAD_FILE_NONE = 0x401003 FTRANS_STATUS_DOWNLOAD_FILE_NONE = 0x402003 FTRANS_STATUS_SUCC = 0x000000 class FtransException(Exception): pass class FtransParameterException(FtransException): pass class FtransNetworkException(FtransException): pass class FtransHttpResponseException(FtransException): pass class FtransUploadException(FtransException): pass class FtransDownloadException(FtransException): pass class FtransFileNotFound(FtransException): pass def _split_addr(addr): if addr[0] == '[': segs = addr.split(":") ip = ":".join(segs[0:-1]) ip = ip[1:-1] port = int(segs[-1]) else: segs = addr.split(":") ip = segs[0] port = int(segs[-1]) return ip, port def _set_addr_map(addr_map, version, isp, ip, port): if version not in addr_map: addr_map[version] = {} if isp not in addr_map[version]: addr_map[version][isp] = [] found = False for exist_ip, exist_port in addr_map[version][isp]: if ip == exist_ip and port == exist_port: found = True break if not found: addr_map[version][isp].append((ip, port)) def _get_addr_map(addr_map, version, isp): if version not in addr_map: if VERSION_DEFAULT not in addr_map: raise FtransException("version not found in addr_map") version = VERSION_DEFAULT if isp not in addr_map[version]: if ISP_DEFAULT not in addr_map[version]: raise FtransException("isp not found in addr_map") isp = ISP_DEFAULT if len(addr_map[version][isp]) == 0: raise FtransException("empty addr list") return addr_map[version][isp][random.randint(1, 100) % len(addr_map[version][isp])] def _build_addr_map(addr): addr_map = {} for elem in addr.split(";"): idx = elem.find("[") if idx == -1: # ipv4 segs = elem.split(":") if len(segs) < 2 or len(segs) > 4: continue if len(segs) == 2: # ip4:port ip, port = _split_addr(elem) _set_addr_map(addr_map, VERSION_DEFAULT, ISP_DEFAULT, ip, port) elif len(segs) == 3: if segs[0] != ISP_CT and segs[0] != ISP_UN and segs[0] != ISP_CM: # version:ip4:port ip, port = _split_addr(":".join(segs[1:])) _set_addr_map(addr_map, segs[0], ISP_DEFAULT, ip, port) else: # isp:ip4:port ip, port = _split_addr(":".join(segs[1:])) _set_addr_map(addr_map, VERSION_DEFAULT, segs[0], ip, port) else: # version:isp:ip4:port ip, port = _split_addr(":".join(segs[2:])) _set_addr_map(addr_map, segs[0], segs[1], ip, port) else: # ipv6 if idx == 0: # [ip6]:port ip, port = _split_addr(elem) _set_addr_map(addr_map, VERSION_DEFAULT, ISP_DEFAULT, ip, port) else: segs = elem[:idx-1].split(":") if len(segs) > 2: continue ip, port = _split_addr(elem[idx:]) if len(segs) == 1: if segs[0] != ISP_CT and segs[0] != ISP_UN and segs[0] != ISP_CM: # version:[ip6]:port _set_addr_map(addr_map, segs[0], ISP_DEFAULT, ip, port) else: # isp:[ip6]:port _set_addr_map(addr_map, VERSION_DEFAULT, segs[0], ip, port) else: # version:isp:[ip6]:port _set_addr_map(addr_map, segs[0], segs[1], ip, port) return addr_map def _save_cert_key(cert_pem, key_pem): random_str = uuid.uuid4().hex cert_file = "%s.cert" % random_str with open(cert_file, "w+") as f: f.write(cert_pem) key_file = "%s.key" % random_str with open(key_file, "w+") as f: f.write(key_pem) return cert_file, key_file def _stat_local_file(filename): return os.stat(filename) def _normalize_filter_in(filter_in): special_chars = { "\\": "\\\\", ".": "\\.", "*": "\\*", "+": "\\+", "?": "\\?", "[": "\\[", "]": "\\]", "{": "\\{", "}": "\\}", "(": "\\(", ")": "\\)", ",": "\\," } for old in special_chars: filter_in = filter_in.replace(old, special_chars[old]) return filter_in def _to_slash(filename): filename = filename.replace(":\\", "/").replace("\\", "/") if filename[0] == '/': filename = filename[1:] return filename class FtransPartTask(object): def __init__(self, off, size, fft): self.off = off self.size = size self.parent_task = fft self.data = None self.status = FTRANS_STATUS_WAITING class FtransFileTask(object): def __init__(self, local_file_path, remote_file_path, temp_file_path, file_size, mtime, file): self.local_file_path = local_file_path self.remote_file_path = remote_file_path self.temp_file_path = temp_file_path self.file_size = file_size self.mtime = mtime self.file = file self.parts = None self.status = FTRANS_STATUS_WAITING self.lock = threading.Lock() def split_part_task(self): self.parts = queue.Queue() start = 0 end = self.file_size while start < end: size = FTRANS_PART_SIZE if start + size > end: size = end - start fpt = FtransPartTask(start, size, self) self.parts.put(fpt) start += size class FtransWorker(threading.Thread): def __init__(self, func, args_list): self.func = func self.args_list = args_list super().__init__() def run(self): while True: try: args = self.args_list.get(timeout=1) self.func(args) except queue.Empty: return class FtransService(object): def __init__(self, bucket, acl_token, server_name, s10_server=None, cert_pem=None, key_pem=None, isp="ct", client_addr=None, s2_server=None, proxy_addr=None, client_acl_token=None): self._ftrans_bucket = bucket self._ftrans_acl_token = acl_token self._ftrans_server_name = server_name self._ftrans_s10_addr = None self._ftrans_s10_port = None self._ftrans_s10_cert_file = None self._ftrans_s10_key_file = None self._ftrans_client_addr = None self._ftrans_client_port = None self._ftrans_s2_addr = None self._ftrans_s2_port = None self._ftrans_proxy_addr = None self._ftrans_proxy_port = None self._ftrans_client_config = None if s10_server is not None: try: addr_map = _build_addr_map(s10_server) except Exception: raise FtransParameterException("invalid s10 server addr %s" % s10_server) try: s10_addr, s10_port = _get_addr_map(addr_map, VERSION_DEFAULT, isp) except: raise FtransParameterException("no s10 server found of isp[%s]" % isp ) if cert_pem is None or key_pem is None: raise FtransParameterException("cert_pem and key_pem must be specified when s10_server is set") cert_file, key_file = _save_cert_key(cert_pem, key_pem) self._ftrans_s10_addr = s10_addr self._ftrans_s10_port = s10_port self._ftrans_s10_cert_file = cert_file self._ftrans_s10_key_file = key_file self._ftrans_s10_conn = urllib3.HTTPSConnectionPool( self._ftrans_s10_addr, self._ftrans_s10_port, cert_file=self._ftrans_s10_cert_file, key_file=self._ftrans_s10_key_file, assert_hostname=self._ftrans_server_name ) if client_addr is not None: if s2_server is None: raise FtransParameterException("s2_server must be specified when client_addr is set") try: client_ip, client_port = _split_addr(client_addr) except Exception: raise FtransParameterException("invalid client_addr [%s]" % client_addr) client_config = FtransService._get_ftrans_client_config(client_ip, client_port, client_acl_token) version = client_config["Version"] protocol = FTRANS_PROTOCOL_UDP if (client_config.get("RuntimeTransTudpSwitch", "") == SWITCH_OFF) and \ (client_config.get("RuntimeTransTtcpSwitch", "") == SWITCH_ON): protocol = FTRANS_PROTOCOL_TCP try: addr_map = _build_addr_map(s2_server) except Exception: raise FtransParameterException("invalid s2_server [%s]" % s2_server) try: s2_addr, s2_port = _get_addr_map(addr_map, version, isp) except: raise FtransParameterException("no s2 addr found of version[%s] isp[%s]" % (version, isp)) proxy_ip = None proxy_port = None if proxy_addr is not None: try: proxy_manager_addr, proxy_manager_port = _split_addr(proxy_addr) except Exception: raise FtransParameterException("invalid proxy_addr[%s]" % proxy_addr) proxy_list = FtransService._get_ftrans_proxy_list(proxy_manager_addr, proxy_manager_port) found = False for p in proxy_list: if p["TargetDomain"] == s2_addr and p["TargetPort"] == s2_port and p["Type"] == protocol and \ p["State"] == "运行中": found = True proxy_ip = p["IP"] proxy_port = p["Port"] break if not found: proxy_list = FtransService._create_ftrans_proxy(proxy_manager_addr, proxy_manager_port, s2_addr, s2_port, protocol) proxy_ip = proxy_list[0]["IP"] proxy_port = proxy_list[0]["Port"] self._ftrans_client_addr = client_ip self._ftrans_client_port = client_port self._ftrans_s2_addr = s2_addr self._ftrans_s2_port = s2_port self._ftrans_client_config = client_config self._ftrans_proxy_addr = proxy_ip self._ftrans_proxy_port = proxy_port self._ftrans_client_acl_token = client_acl_token def __del__(self): os.remove(self._ftrans_s10_cert_file) os.remove(self._ftrans_s10_key_file) @staticmethod def _gen_ftrans_sig(op, t, token): if token is None: token = "4d0c1b2513cb82263814e10bf2f136ed" s = "%s@ftrans/%s@%d" % (token.lower(), op.lower(), t) return hashlib.md5(s.encode()).hexdigest() @staticmethod def _get_ftrans_client_config(client_addr, client_port, client_acl_token): op = "config" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (client_addr, client_port, op, t, sig) resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http response status %d when get client config" % resp.status) return json.loads(resp.data) @staticmethod def _get_ftrans_proxy_list(proxy_manager_addr, proxy_manager_port): url = "http://%s:%d/api/v1/proxy-list" % (proxy_manager_addr, proxy_manager_port) resp = FtransService._do_request(FTRANS_HTTP_METHOD_GET, url) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http response %d when get proxy list" % resp.status) return json.loads(resp.data) @staticmethod def _create_ftrans_proxy(proxy_manager_addr, proxy_manager_port, s2_addr, s2_port, protocol): url = "http://%s:%d/api/v1/proxy" % (proxy_manager_addr, proxy_manager_port) data = [ { "TargetDomain": s2_addr, "TargetPort": s2_port, "Type": protocol } ] resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(data)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when create proxy" % resp.status) return json.loads(resp.data) @staticmethod def _do_request(method, url, headers=None, body=None, conn=None): if conn is None: conn = urllib3.PoolManager() try: resp = conn.request(method, url, headers=headers, body=body) except Exception as ex: raise FtransNetworkException("do request %s failed %s" % (url, str(ex))) return resp def _get_full_path(self, filename): full_path = "%s/%s/%s" % (FTRANS_MOUNT_PATH, self._ftrans_bucket, filename) return full_path def _ftrans_client_enable(self): return (self._ftrans_client_addr is not None) and (self._ftrans_client_port is not None) def _upload_file_s2(self, local_file_path, remote_file_path): op = "upload" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) des = self._get_full_path(remote_file_path) if self._ftrans_proxy_addr is not None and self._ftrans_proxy_port is not None: server_address = "%s:%d" % (self._ftrans_proxy_addr, self._ftrans_proxy_port) else: server_address = "%s:%d" % (self._ftrans_s2_addr, self._ftrans_s2_port) body = { "serverName": self._ftrans_server_name, "serverAddress": server_address, "files": [ { "transId": uuid.uuid4().hex, "aclToken": self._ftrans_acl_token, "src": local_file_path, "des": des } ] } resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(body)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when submit upload file request" % resp.status) upload_info = json.loads(resp.data) upload_info["serverName"] = self._ftrans_server_name upload_info["serverAddress"] = server_address while True: resp = self._status_upload_s2(upload_info) upload_status = resp["files"][0] if upload_status["transId"] != upload_info["files"][0]["transId"]: continue if upload_status["statusCode"] not in [FTRANS_STATUS_SUCC, FTRANS_STATUS_UPLOAD_FILE_NONE]: raise FtransUploadException("upload file %s failed %s" % (local_file_path, upload_status["statusMsg"])) if upload_status["statusCode"] == FTRANS_STATUS_SUCC: trans_status = upload_status["transStatus"] if trans_status == FTRANS_TRANS_STATUS_COMPLETED: break elif (trans_status == FTRANS_TRANS_STATUS_FAILED) or (trans_status == FTRANS_TRANS_STATUS_CANCELLED): raise FtransUploadException( "upload file %s failed %s" % (local_file_path, upload_status["statusMsg"]) ) time.sleep(1) stat_info = _stat_local_file(local_file_path) return remote_file_path, stat_info.st_size, int(stat_info.st_mtime * 1e6), None def _download_file_s2(self, local_file_path, remote_file_path): op = "download" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) src = self._get_full_path(remote_file_path) if self._ftrans_proxy_addr is not None and self._ftrans_proxy_port is not None: server_address = "%s:%d" % (self._ftrans_proxy_addr, self._ftrans_proxy_port) else: server_address = "%s:%d" % (self._ftrans_s2_addr, self._ftrans_s2_port) body = { "serverName": self._ftrans_server_name, "serverAddress": server_address, "files": [ { "transId": uuid.uuid4().hex, "aclToken": self._ftrans_acl_token, "src": src, "des": local_file_path } ] } resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(body)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when submit download file request" % resp.status) download_info = json.loads(resp.data) download_info["serverName"] = self._ftrans_server_name download_info["serverAddress"] = server_address while True: resp = self._status_download_s2(download_info) download_status = resp["files"][0] if download_status["transId"] != download_info["files"][0]["transId"]: continue if download_status["statusCode"] not in [FTRANS_STATUS_SUCC, FTRANS_STATUS_DOWNLOAD_FILE_NONE]: raise FtransUploadException( "upload file %s failed %s" % (local_file_path, download_status["statusMsg"])) if download_status["statusCode"] == FTRANS_STATUS_SUCC: trans_status = download_status["transStatus"] if trans_status == FTRANS_TRANS_STATUS_COMPLETED: break elif (trans_status == FTRANS_TRANS_STATUS_FAILED) or (trans_status == FTRANS_TRANS_STATUS_CANCELLED): raise FtransUploadException( "upload file %s failed %s" % (local_file_path, download_status["statusMsg"]) ) time.sleep(1) stat_info = _stat_local_file(local_file_path) return remote_file_path, stat_info.st_size, int(stat_info.st_mtime * 1e6), None def _status_upload_s2(self, upload_info): op = "status_upload" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(upload_info)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when status upload file request" % resp.status) return json.loads(resp.data) def _status_download_s2(self, download_info): op = "status_download" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(download_info)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when status download file request" % resp.status) return json.loads(resp.data) def _list_file_s2(self, prefix, filter_in, order_type, order_field, page_num, page_size): op = "list_dir" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) des = self._get_full_path(prefix) if self._ftrans_proxy_addr is not None and self._ftrans_proxy_port is not None: server_address = "%s:%d" % (self._ftrans_proxy_addr, self._ftrans_proxy_port) else: server_address = "%s:%d" % (self._ftrans_s2_addr, self._ftrans_s2_port) body = { "serverName": self._ftrans_server_name, "serverAddress": server_address, "aclToken": self._ftrans_acl_token, "des": des, "filterIn": filter_in, "sortBy": order_field, "orderBy": order_type, "pageNo": page_num, "pageSize": page_size } resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(body)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when list dir request" % resp.status) files = json.loads(resp.data) total = files["matchedNum"] records = files["fileNodes"] for f in records: f["mtime"] = mtime = int(time.mktime(time.strptime(f["mtime"], "%Y-%m-%d %H:%M:%S")) * 1e6) return total, records def _get_file_size_s2(self, filename): prefix = os.path.dirname(filename) name = os.path.basename(filename) filter_in = _normalize_filter_in(name) total_num, file_info_list = self._list_file_s2(prefix, filter_in, FTRANS_ORDER_TYPE_ASC, FTRANS_ORDER_FIELD_MTIME, FTRANS_DEFAULT_PAGE_NUM, FTRANS_DEFAULT_PAGE_SIZE) if total_num == 0: raise FtransFileNotFound("file [%s] not found" % filename) found = False size = 0 mtime = 0 for f in file_info_list: if f["name"] == name: size = f["size"] mtime = f["mtime"] found = True break if not found: raise FtransFileNotFound("file [%s] not found" % filename) return size, mtime def _remove_file_s2(self, filename): op = "remove_file" t = int(time.time()) + FTRANS_SIG_EXPIRED_NSEC sig = FtransService._gen_ftrans_sig(op, t, self._ftrans_client_acl_token) url = "http://%s:%d/v2/ftrans?op=%s&t=%d&sig=%s" % (self._ftrans_client_addr, self._ftrans_client_port, op, t, sig) des = self._get_full_path(filename) if self._ftrans_proxy_addr is not None and self._ftrans_proxy_port is not None: server_address = "%s:%d" % (self._ftrans_proxy_addr, self._ftrans_proxy_port) else: server_address = "%s:%d" % (self._ftrans_s2_addr, self._ftrans_s2_port) body = { "serverName": self._ftrans_server_name, "serverAddress": server_address, "aclToken": self._ftrans_acl_token, "des": des, } resp = FtransService._do_request(FTRANS_HTTP_METHOD_POST, url, body=json.dumps(body)) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http status %d when remove file %s" % (resp.status, filename)) return def _upload_part_s10(self, fpt): with fpt.parent_task.lock: if fpt.parent_task.status == FTRANS_STATUS_FAILED: raise FtransUploadException("some part upload failed for %s" % fpt.parent_task.local_file_path) fpt.parent_task.file.seek(fpt.off) fpt.data = fpt.parent_task.file.read(fpt.size) try: self._upload_file_part_s10(fpt) except Exception as ex: with fpt.parent_task.lock: fpt.parent_task.status = FTRANS_STATUS_FAILED raise ex def _download_part_s10(self, fpt): with fpt.parent_task.lock: if fpt.parent_task.status == FTRANS_STATUS_FAILED: raise FtransDownloadException("some part download failed for %s" % fpt.parent_task.remote_file_path) try: file_size, mtime, data = self._download_file_part_s10(fpt) if file_size != fpt.parent_task.file_size or mtime != fpt.parent_task.mtime: raise FtransDownloadException( "file %s has been modified during downloading" % fpt.parent_task.remote_file_path) with fpt.parent_task.lock: fpt.parent_task.file.seek(fpt.off) fpt.parent_task.file.write(data) except Exception as ex: with fpt.parent_task.lock: fpt.parent_task.status = FTRANS_STATUS_FAILED raise ex def _upload_file_s10(self, local_file_path, remote_file_path): if not os.path.exists(local_file_path): raise FtransFileNotFound("local file %s not found" % local_file_path) fi = os.stat(local_file_path) file_size = fi.st_size mtime = int(fi.st_mtime * 1e6) des = _to_slash(remote_file_path) remote_file_size, remote_mtime = self._get_file_size_s10(des) # local_file and remote_file is same, just return success if (file_size == remote_file_size) and (mtime == remote_mtime): return des, file_size, mtime, None # if local_file_path is dir, just make it if os.path.isdir(local_file_path): self._make_dir_s10(des, mtime) return des, 0, mtime, None # empty file, just touch it if file_size == 0: self._touch_file_s10(des, mtime) return des, 0, mtime, None f = open(local_file_path, "rb") temp_file_path = "%s_%s" % (remote_file_path, uuid.uuid4().hex) fft = FtransFileTask(local_file_path, des, temp_file_path, file_size, mtime, f) fft.split_part_task() fft.status = FTRANS_STATUS_DOING worker_list = [] i = 0 while i < FTRANS_DEFAULT_PART_CONCURRENCY: worker = FtransWorker(self._upload_part_s10, fft.parts) worker.start() worker_list.append(worker) i += 1 for worker in worker_list: worker.join() if fft.status == FTRANS_STATUS_DOING: fft.status = FTRANS_STATUS_FINISHED else: fft.status = FTRANS_STATUS_FAILED fft.file.close() if fft.status != FTRANS_STATUS_FINISHED: raise FtransUploadException("upload file %s failed" % local_file_path) self._rename_file_s10(fft.temp_file_path, fft.remote_file_path) return fft.remote_file_path, fft.file_size, fft.mtime, None def _download_file_s10(self, local_file_path, remote_file_path): file_size, mtime = self._get_file_size_s10(remote_file_path) if (file_size == 0) and (mtime == 0): raise FtransFileNotFound("file %s not found" % remote_file_path) if os.path.exists(local_file_path): fi = os.stat(local_file_path) # local_file_path and remote_file is same if (fi.st_size == file_size) and (int(fi.st_mtime * 1e6) == mtime): return remote_file_path, file_size, mtime, None else: # local_file_path exists and not same as remote_file_path, just delete it and download os.remove(local_file_path) temp_file_path = "%s_%s" % (local_file_path, uuid.uuid4().hex) save_dir = os.path.dirname(temp_file_path) if not os.path.exists(save_dir): os.makedirs(save_dir) f = open(temp_file_path, "wb+") if file_size == 0: f.close() os.rename(temp_file_path, local_file_path) fft = FtransFileTask(local_file_path, remote_file_path, temp_file_path, file_size, mtime, f) fft.split_part_task() i = 0 fft.status = FTRANS_STATUS_DOING worker_list = [] i = 0 while i < FTRANS_DEFAULT_PART_CONCURRENCY: worker = FtransWorker(self._download_part_s10, fft.parts) worker.start() worker_list.append(worker) i += 1 for worker in worker_list: worker.join() if fft.status == FTRANS_STATUS_DOING: fft.status = FTRANS_STATUS_FINISHED else: fft.status = FTRANS_STATUS_FAILED fft.file.close() if fft.status != FTRANS_STATUS_FINISHED: raise FtransDownloadException("download file %s failed" % remote_file_path) os.rename(fft.temp_file_path, fft.local_file_path) os.utime(fft.local_file_path, (time.time(), float(mtime) / 1e6)) return remote_file_path, file_size, mtime, None def _upload_file_part_s10(self, fpt): op = "upload_file" des = base64.b64encode(bytes(self._get_full_path(fpt.parent_task.temp_file_path), encoding="UTF-8")).decode( encoding="UTF-8") offset = fpt.off size = fpt.size mtime = fpt.parent_task.mtime acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&des=%s&offset=%d&size=%d&mtime=%d&acltoken=%s" % (op, des, offset, size, mtime, acl_token) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn, body=fpt.data) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http response status [%d] when upload_file_s10" % resp.status) return def _download_file_part_s10(self, fpt): op = "download_file" src = base64.b64encode(bytes(self._get_full_path(fpt.parent_task.remote_file_path), encoding="UTF-8")).decode( encoding="UTF-8") offset = fpt.off size = fpt.size acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&src=%s&offset=%d&size=%d&acltoken=%s" % (op, src, offset, size, acl_token) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn, body=fpt.data) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid http response status [%d] when download_file_s10" % resp.status) file_size = int(resp.headers.get("Fsize")) mtime = int(resp.headers.get("Mtime")) return file_size, mtime, resp.data def _list_file_s10(self, prefix, filter_in, order_type, order_field, page_num, page_size): op = "list_dir" src = base64.b64encode(bytes(self._get_full_path(prefix), encoding="UTF-8")).decode(encoding="UTF-8") keyword = base64.b64encode(bytes(filter_in, encoding="UTF-8")).decode(encoding="UTF-8") url = "/s10/p2/ftrans?op=%s&src=%s&filterIn=%s&orderBy=%s&sortBy=%s&pageNo=%d&pageSize=%d&" \ "acltoken=%s" % ( op, src, keyword, order_type, order_field, page_num, page_size, self._ftrans_acl_token ) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when list_file_s10" % resp.status) total = int(resp.headers.get("matchedNum")) records = json.loads(resp.data) for f in records: f["mtime"] = int(time.mktime(time.strptime(f["mtime"], "%Y-%m-%d %H:%M:%S")) * 1e6) return total, records def _remove_file_s10(self, filename): op = "remove_file" des = base64.b64encode(bytes(self._get_full_path(filename), encoding="UTF-8")).decode(encoding="UTF-8") acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&des=%s&acltoken=%s" % (op, des, acl_token) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when remove_file_s10" % resp.status) return def _get_file_size_s10(self, filename): op = "size_file" src = base64.b64encode(bytes(self._get_full_path(filename), encoding="UTF-8")).decode(encoding="UTF-8") acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&src=%s&acltoken=%s" % (op, src, acl_token) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when get_file_size_s10" % resp.status) file_size = int(resp.headers.get("Fsize")) mtime = int(resp.headers.get("Mtime")) return file_size, mtime def _make_dir_s10(self, dir_name, mtime): op = "make_dir" des = base64.b64encode(bytes(self._get_full_path(dir_name), encoding="UTF-8")).decode(encoding="UTF-8") acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&des=%s&acltoken=%s&mtime=%d" % (op, des, acl_token, mtime) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when make_dir_s10" % resp.status) return def _rename_file_s10(self, src, des): op = "rename_file" src = base64.b64encode(bytes(self._get_full_path(src), encoding="UTF-8")).decode(encoding="UTF-8") des = base64.b64encode(bytes(self._get_full_path(des), encoding="UTF-8")).decode(encoding="UTF-8") acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&src=%s&des=%s&acltoken=%s" % (op, src, des, acl_token) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%d] when rename_file_s10" % resp.status) return def _touch_file_s10(self, des, mtime): op = "touch_file" des = base64.b64encode(bytes(self._get_full_path(des), encoding="UTF-8")).decode(encoding="UTF-8") acl_token = self._ftrans_acl_token url = "/s10/p2/ftrans?op=%s&des=%s&acltoken=%s&mtime=%d" % (op, des, acl_token, mtime) resp = self._do_request(FTRANS_HTTP_METHOD_POST, url, conn=self._ftrans_s10_conn) if resp.status != FTRANS_HTTP_STATUS_OK: raise FtransHttpResponseException("invalid response status [%s] when touch_file_s10" % resp.status) return def upload_file(self, local_file_path, remote_file_path): if remote_file_path == "": raise FtransException("invalid des [%s]" % remote_file_path) remote_file_path = _to_slash(remote_file_path) if self._ftrans_client_enable(): return self._upload_file_s2(local_file_path, remote_file_path) else: return self._upload_file_s10(local_file_path, remote_file_path) def download_file(self, local_file_path, remote_file_path): if remote_file_path == "": raise FtransException("invalid des [%s]" % remote_file_path) remote_file_path = _to_slash(remote_file_path) if self._ftrans_client_enable(): return self._download_file_s2(local_file_path, remote_file_path) else: return self._download_file_s10(local_file_path, remote_file_path) def get_file_size(self, filename): if filename == "": raise FtransException("invalid des [%s]" % filename) filename = _to_slash(filename) if self._ftrans_client_enable(): return self._get_file_size_s2(filename) else: return self._get_file_size_s10(filename) def get_file_md5(self, filename): # may be supported in future return None def remove_file(self, filename): if filename == "": raise FtransException("invalid des [%s]" % filename) filename = _to_slash(filename) if self._ftrans_client_enable(): return self._remove_file_s2(filename) else: return self._remove_file_s10(filename) def list_file(self, prefix, filter_in=None, order_type=None, order_field=None, page_num=None, page_size=None): if prefix != "": prefix = _to_slash(prefix) if filter_in is None: filter_in = FTRANS_DEFAULT_FILTER_IN if order_type is None: order_type = FTRANS_ORDER_TYPE_ASC if order_field is None: order_field = FTRANS_ORDER_FIELD_NAME if page_num is None: page_num = FTRANS_DEFAULT_PAGE_NUM if page_size is None: page_size = FTRANS_DEFAULT_PAGE_SIZE if self._ftrans_client_enable(): return self._list_file_s2(prefix, filter_in, order_type, order_field, page_num, page_size) else: return self._list_file_s10(prefix, filter_in, order_type, order_field, page_num, page_size) ================================================ FILE: volcengine/viking_db/Collection.py ================================================ # coding:utf-8 import json from typing import Union, List from volcengine.viking_db.common import Data, RetryOption class Collection(object): def __init__(self, collection_name, fields, viking_db_service, primary_key, indexes=None, stat=None, description="", create_time=None, update_time=None, update_person=None, retry_option=None, vectorize=None): """ :param collection_name: the name of VikingDB collection. :type collection_name: str :param fields: fields(schema) defination, including field_name, field_type, default_val, and dim or pipeline_name for embedding related field :type fields: list[Field] :param viking_db_service: VikingDBService instance. :type viking_db_service: VikingDBService :param primary_key: field_name of primary key in collection, or "__AUTO_ID__" to use auto int64 id. :type primary_key: str :param retry_option: retry option. :type retry_option: RetryOption """ self.collection_name = collection_name self.fields = fields self.viking_db_service = viking_db_service self.primary_key = primary_key self.vectorize = vectorize if indexes is not None: self.indexes = indexes else: self.indexes = [] if stat is not None: self.stat = stat else: self.stat = {} self.description = description if create_time is not None: self.create_time = create_time if update_time is not None: self.update_time = update_time if update_person is not None: self.update_person = update_person self._is_client = False self.retry_option = retry_option if retry_option else RetryOption() def upsert_data(self, data: Union[Data, List[Data]], async_upsert=False, retry=True): """ Insert and overwrite data in fields within a collection :param data: The data you want to insert or overwrite. :type data: Data or list[Data] :rtype: None :param async_upsert: Whether to use async upsert, if enabled, writing will be faster but the data will not be updated in index immediately but after next round of index building finished. :type async_upsert: bool :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ remaining = self.retry_option.new_remaining(retry) if isinstance(data, Data): fields_arr = [data.fields] ttl = 0 if data.TTL is not None: ttl = data.TTL params = {"collection_name": self.collection_name, "fields": fields_arr, "ttl": ttl} if async_upsert: params["async"]=True # print(params) res = self.viking_db_service._retry_request("UpsertData", {}, json.dumps(params), remaining, self.retry_option) elif isinstance(data, list): fields_arr = [] ttl = 0 record = {} for item in data: if item.TTL in record: fields = record[item.TTL] fields.append(item.fields) record[item.TTL] = fields else: record[item.TTL] = [item.fields] for item in record: params = {"collection_name": self.collection_name, "fields": record[item], "ttl": item} if async_upsert: params["async"]=True res = self.viking_db_service._retry_request("UpsertData", {}, json.dumps(params), remaining, self.retry_option) def update_data(self, data: Union[Data, List[Data]], retry=True): """ Update data in fields within a collection :param data: The data field you want to update. must contain primary key :type data: Data or list[Data] :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ remaining = self.retry_option.new_remaining(retry) if isinstance(data, Data): fields_arr = [data.fields] ttl = 0 if data.TTL is not None: ttl = data.TTL params = {"collection_name": self.collection_name, "fields": fields_arr, "ttl": ttl} res = self.viking_db_service._retry_request("UpdateData", {}, json.dumps(params), remaining, self.retry_option) elif isinstance(data, list): fields_arr = [] ttl = 0 record = {} for item in data: if item.TTL in record: fields = record[item.TTL] fields.append(item.fields) record[item.TTL] = fields else: record[item.TTL] = [item.fields] for item in record: params = {"collection_name": self.collection_name, "fields": record[item], "ttl": item} res = self.viking_db_service._retry_request("UpdateData", {}, json.dumps(params), remaining, self.retry_option) async def async_upsert_data(self, data: Union[Data, List[Data]], async_upsert=False): if isinstance(data, Data): fields_arr = [data.fields] ttl = 0 if data.TTL is not None: ttl = data.TTL params = {"collection_name": self.collection_name, "fields": fields_arr, "ttl": ttl} if async_upsert: params["async"]=True # print(params) res = await self.viking_db_service.async_json_exception("UpsertData", {}, json.dumps(params)) elif isinstance(data, list): fields_arr = [] ttl = 0 record = {} for item in data: if item.TTL in record: fields = record[item.TTL] fields.append(item.fields) record[item.TTL] = fields else: record[item.TTL] = [item.fields] for item in record: params = {"collection_name": self.collection_name, "fields": record[item], "ttl": item} if async_upsert: params["async"]=True res = await self.viking_db_service.async_json_exception("UpsertData", {}, json.dumps(params)) def delete_data(self, id: Union[str, List[str], int, List[int]], retry=True): """ delete data in fields within a collection :param id: The data id you want to delete. :type id: str or list[str] or int or list[int] :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ remaining = self.retry_option.new_remaining(retry) if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "primary_keys": id} res = self.viking_db_service._retry_request("DeleteData", {}, json.dumps(params), remaining, self.retry_option) return res elif isinstance(id, List): params = {"collection_name": self.collection_name, "primary_keys": id} res = self.viking_db_service._retry_request("DeleteData", {}, json.dumps(params), remaining, self.retry_option) return res async def async_delete_data(self, id: Union[str, List[str], int, List[int]]): if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "primary_keys": id} await self.viking_db_service.async_json_exception("DeleteData", {}, json.dumps(params)) elif isinstance(id, List): params = {"collection_name": self.collection_name, "primary_keys": id} await self.viking_db_service.async_json_exception("DeleteData", {}, json.dumps(params)) def delete_all_data(self): """ delete all the data of a collection """ params = {"collection_name": self.collection_name, "del_all": True} self.viking_db_service.json_exception("DeleteData", {}, json.dumps(params)) async def async_delete_all_data(self): params = {"collection_name": self.collection_name, "del_all": True} await self.viking_db_service.async_json_exception("DeleteData", {}, json.dumps(params)) def fetch_data(self, id: Union[str, List[str], int, List[int]], retry=True): """ Query single or multiple data records in a specified Collection based on primary key :param id: the primary key. :type id: str or list[str] or int or list[int] :rtype: Data or list[Data] :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ remaining = self.retry_option.new_remaining(retry) if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "primary_keys": id} res = self.viking_db_service._retry_request("FetchData", {}, json.dumps(params), remaining, self.retry_option) # res是一个列表,只有一个元素 res = json.loads(res) data = Data(res["data"][0], id=id, timestamp=None) return data elif isinstance(id, List): params = {"collection_name": self.collection_name, "primary_keys": id} if self._is_client: params['replace_primay'] = True res = self.viking_db_service._retry_request("FetchData", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] for item in res["data"]: data = Data(item, id=item[self.primary_key], timestamp=None) datas.append(data) return datas async def async_fetch_data(self, id: Union[str, List[str], int, List[int]]): if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "primary_keys": id} # print(params) res = await self.viking_db_service.async_get_body_exception("FetchData", {}, json.dumps(params)) # print(res) # res是一个列表,只有一个元素 res = json.loads(res) # print(res["data"][0]) data = Data(res["data"][0], id=id, timestamp=None) return data elif isinstance(id, List): params = {"collection_name": self.collection_name, "primary_keys": id} if self._is_client: params['replace_primay'] = True res = await self.viking_db_service.async_get_body_exception("FetchData", {}, json.dumps(params)) res = json.loads(res) # print(res["data"],self.primary_key) datas = [] for item in res["data"]: # print(item) data = Data(item, id=item[self.primary_key], timestamp=None) datas.append(data) # print(data.id,data.fields) return datas ================================================ FILE: volcengine/viking_db/CollectionClient.py ================================================ # coding:utf-8 from volcengine.viking_db import Collection, VikingDBService from volcengine.viking_db.common import RetryOption class CollectionClient(Collection): def __init__(self, collection_name, host="api-vikingdb.volces.com", region="cn-north-1", ak="", sk="", scheme='http', connection_timeout=30, socket_timeout=30, proxy=None, retry_option=None): vikingdb_service = VikingDBService(host, region, ak, sk, scheme, connection_timeout, socket_timeout, proxy, retry_option) self.viking_db_service = vikingdb_service self.collection_name = collection_name self.primary_key = "__primary_key" self._is_client = True self.retry_option = retry_option if retry_option else RetryOption() ================================================ FILE: volcengine/viking_db/Index.py ================================================ # coding:utf-8 import json import warnings from typing import Union, List, Dict from volcengine.viking_db.common import (RetryOption, Data, VectorOrder, ScalarOrder, AggResult, IndexSortResult, SortResultItem) class Index(object): def __init__(self, collection_name, index_name, vector_index, scalar_index, stat, viking_db_service, description="", cpu_quota=2, partition_by=None, create_time=None, update_time=None, update_person=None, index_cost=None, shard_count=None, shard_policy=None, retry_option=None): """ :param collection_name: the name of VikingDB collection. :type collection_name: str :param index_name: the name of VikingDB index. :type index_name: str :param vector_index: ANN vector index information. :type vector_index: dict :param scalar_index: scalar index information. :type scalar_index: set :param stat: index status like 'READY'. :type stat: str :param viking_db_service: VikingDBService instance. :type viking_db_service: VikingDBService :param description: the description of index. :type description: str :param cpu_quota: allocated cpu quota of the index. :type cpu_quota: int :param partition_by: the name of sub-index, if not specified, the sub-index is single default. :type partition_by: str :param shard_count: the number of shards, by default it's 1. :type shard_count: int :param shard_policy: the sharding policy of the index, by default it's 'auto'. :type shard_policy: str :param retry_option: retry option. :type retry_option: RetryOption """ self.collection_name = collection_name self.index_name = index_name self.description = description self.vector_index = vector_index self.scalar_index = scalar_index self.stat = stat self.viking_db_service = viking_db_service self.cpu_quota = cpu_quota self.partition_by = partition_by self.create_time = create_time self.update_time = update_time self.update_person = update_person self.index_cost = index_cost self.shard_count = shard_count self.shard_policy = shard_policy self.retry_option = retry_option if retry_option else RetryOption() # 获取primary_key col = self.viking_db_service.get_exception("GetCollection", {"collection_name": self.collection_name}) col = json.loads(col) self._is_client = False self.primary_key = col["data"]["primary_key"] def search(self, order=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=True, filter_pre_ann_limit=-1, filter_pre_ann_ratio=-1.0, **kwargs): """ Search for vectors or scalars similar to a given vector or scalar. :param order: the given vector or scalar or None. :type order: VectorOrder or ScalarOrder or None :param filter: filter conditions. :type filter: dict :param limit: number of retrieved results. :type limit: int :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :type: list :param dense_weight: the weight of dense vector, the value should be a float in range [0.2, 1.0]. :type dense_weight: float :type primary_key_in: filter data by primary key value, list[int] or list[str] :type: list :type primary_key_not_in: filter out data by primary key value, list[int] or list[str] :type: list :type post_process_ops: post process operators :type: list[dict] :type post_process_input_limit: number of data input to post process operators :type: int :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ if isinstance(order, VectorOrder): res = [] if order.vector is not None: res = self.search_by_vector(order.vector, sparse_vectors=order.sparse_vectors, filter=filter, limit=limit, output_fields=output_fields, partition=partition, dense_weight=dense_weight, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=retry, filter_pre_ann_limit=filter_pre_ann_limit, filter_pre_ann_ratio=filter_pre_ann_ratio, **kwargs) elif order.id is not None: res = self.search_by_id(order.id, filter=filter, limit=limit, output_fields=output_fields, partition=partition, dense_weight=dense_weight, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=retry, filter_pre_ann_limit=filter_pre_ann_limit, filter_pre_ann_ratio=filter_pre_ann_ratio, **kwargs) return res elif isinstance(order, ScalarOrder): search = {} order_by_scalar = {"order": order.order.value, "field_name": order.field_name} search = {"order_by_scalar": order_by_scalar, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if filter_pre_ann_limit >= 0: search['filter_pre_ann_limit'] = filter_pre_ann_limit if filter_pre_ann_ratio >= 0.0: search['filter_pre_ann_ratio'] = filter_pre_ann_ratio offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} # print(params) remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] # 返回数据是个列表,每个id又对应一个列表,但是这里输入id好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas elif order is None: search = {"limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas async def async_search(self, order=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, **kwargs): if isinstance(order, VectorOrder): res = [] if order.vector is not None: res = await self.async_search_by_vector(order.vector, sparse_vectors=order.sparse_vectors, filter=filter, limit=limit, output_fields=output_fields, partition=partition, dense_weight=dense_weight, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None) elif order.id is not None: res = await self.async_search_by_id(order.id, filter=filter, limit=limit, output_fields=output_fields, partition=partition, dense_weight=dense_weight, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None) return res elif isinstance(order, ScalarOrder): search = {} order_by_scalar = {"order": order.order.value, "field_name": order.field_name} search = {"order_by_scalar": order_by_scalar, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) datas = [] # 返回数据是个列表,每个id又对应一个列表,但是这里输入id好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas elif order is None: search = {"limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) datas = [] for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas def search_by_id(self, id, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=True, scale_k=0, filter_pre_ann_limit=-1, filter_pre_ann_ratio=-1.0, **kwargs): """ Search for vectors similar to a given vector based on its id. :param id: the primary key. :type id: str :param filter: filter conditions. :type filter: dict :param limit: number of retrieved results. :type limit: int :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :rtype: list :param dense_weight: the weight of dense vector, the value should be a float in range [0.2, 1.0]. :type dense_weight: float :type primary_key_in: filter data by primary key value, list[int] or list[str] :type: list :type primary_key_not_in: filter out data by primary key value, list[int] or list[str] :type: list :type post_process_ops: post process operators :type: list[dict] :type post_process_input_limit: number of data input to post process operators :type: int :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ search = {} order_by_id = {"primary_keys": id} search = {"order_by_vector": order_by_id, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if scale_k > 0: search['scale_k'] = scale_k if filter_pre_ann_limit >= 0: search['filter_pre_ann_limit'] = filter_pre_ann_limit if filter_pre_ann_ratio >= 0.0: search['filter_pre_ann_ratio'] = filter_pre_ann_ratio offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} # print(params) remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) # print(res["data"]) datas = [] # 返回数据是个列表,每个id又对应一个列表,但是这里输入id好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: # print(item) id = item[self.primary_key] # print(id) fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] # print(id, fields) data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) # print("==================") extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas async def async_search_by_id(self, id, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, **kwargs): search = {} order_by_id = {"primary_keys": id} search = {"order_by_vector": order_by_id, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} # print(params) res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) # print(res["data"]) datas = [] # 返回数据是个列表,每个id又对应一个列表,但是这里输入id好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: # print(item) id = item[self.primary_key] # print(id) fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] # print(id, fields) data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) # print("==================") extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas def search_by_vector(self, vector, sparse_vectors=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=True, scale_k=0, filter_pre_ann_limit=-1, filter_pre_ann_ratio=-1.0, **kwargs): """ Search for vectors similar to a given vector. :param vector: the given vector. :type vector: list :param filter: filter conditions. :type filter: dict :param limit: number of retrieved results. :type limit: int :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :rtype: list :param dense_weight: the weight of dense vector, the value should be a float in range [0.2, 1.0]. :type dense_weight: float :type primary_key_in: filter data by primary key value, list[int] or list[str] :type: list :type primary_key_not_in: filter out data by primary key value, list[int] or list[str] :type: list :type post_process_ops: post process operators :type: list[dict] :type post_process_input_limit: number of data input to post process operators :type: int :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ # vector是一个向量,不是list,但是数据库要求传入的是个列表 search = {} order_by_vector = {"vectors": [vector]} if sparse_vectors is not None: order_by_vector['sparse_vectors'] = [sparse_vectors] search = {"order_by_vector": order_by_vector, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if scale_k > 0: search['scale_k'] = scale_k if filter_pre_ann_limit >= 0: search['filter_pre_ann_limit'] = filter_pre_ann_limit if filter_pre_ann_ratio >= 0.0: search['filter_pre_ann_ratio'] = filter_pre_ann_ratio offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas async def async_search_by_vector(self, vector, sparse_vectors=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, **kwargs): # vector是一个向量,不是list,但是数据库要求传入的是个列表 search = {} order_by_vector = {"vectors": [vector]} if sparse_vectors is not None: order_by_vector['sparse_vectors'] = [sparse_vectors] search = {"order_by_vector": order_by_vector, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] data = Data(fields, id=id, timestamp=None, score=item["score"], dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas def search_with_multi_modal(self, text=None, image=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, need_instruction=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=True, scale_k=0, filter_pre_ann_limit=-1, filter_pre_ann_ratio=-1.0, **kwargs): """ Search with multi-modal data including type of text and image. :param text: the given text. :type text: str :param image: the given image. :type image: str :param filter: filter conditions. :type filter: dict :param limit: number of retrieved results. :type limit: int :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :rtype: list :param dense_weight: the weight of dense vector, the value should be a float in range [0.2, 1.0]. :type dense_weight: float :type need_instruction: whether need instruction for embedding :type: bool :type primary_key_in: filter data by primary key value, list[int] or list[str] :type: list :type primary_key_not_in: filter out data by primary key value, list[int] or list[str] :type: list :type post_process_ops: post process operators :type: list[dict] :type post_process_input_limit: number of data input to post process operators :type: int :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ if text is None and image is None: raise Exception("not any modal data params exist") order_by_raw = {} if text is not None: order_by_raw["text"] = text if image is not None: order_by_raw["image"] = image search = {"order_by_raw": order_by_raw, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if need_instruction is not None: search['need_instruction'] = need_instruction if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if scale_k > 0: search['scale_k'] = scale_k if filter_pre_ann_limit >= 0: search['filter_pre_ann_limit'] = filter_pre_ann_limit if filter_pre_ann_ratio >= 0.0: search['filter_pre_ann_ratio'] = filter_pre_ann_ratio offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] text = None if "text" in item: text = item["text"] data = Data(fields, id=id, timestamp=None, score=item["score"], text=text, dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas async def async_search_with_multi_modal(self, text=None, image=None, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, need_instruction=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, scale_k=0, **kwargs): if text is None and image is None: raise Exception("not any modal data params exist") order_by_raw = {} if text is not None: order_by_raw["text"] = text if image is not None: order_by_raw["image"] = image search = {"order_by_raw": order_by_raw, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if need_instruction is not None: search['need_instruction'] = need_instruction if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if scale_k > 0: search['scale_k'] = scale_k offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] text = None if "text" in item: text = item["text"] data = Data(fields, id=id, timestamp=None, score=item["score"], text=text, dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas def search_by_text(self, text, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, need_instruction=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, retry=True, scale_k=0, filter_pre_ann_limit=-1, filter_pre_ann_ratio=-1.0, **kwargs): """ Search for text similar to a given text. (You can use search_with_multi_modal instead.) :param text: the given text. :type text: Text :param filter: filter conditions. :type filter: dict :param limit: number of retrieved results. :type limit: int :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :rtype: list :param dense_weight: the weight of dense vector, the value should be a float in range [0.2, 1.0]. :type dense_weight: float :type need_instruction: whether need instruction for embedding :type: bool :type primary_key_in: filter data by primary key value, list[int] or list[str] :type: list :type primary_key_not_in: filter out data by primary key value, list[int] or list[str] :type: list :type post_process_ops: post process operators :type: list[dict] :type post_process_input_limit: number of data input to post process operators :type: int :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ warnings.warn("search_by_text is deprecated, please use search_with_multi_modal instead", DeprecationWarning) order_by_raw = {"text": text.text} search = {"order_by_raw": order_by_raw, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if need_instruction is not None: search['need_instruction'] = need_instruction if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit if scale_k > 0: search['scale_k'] = scale_k if filter_pre_ann_limit >= 0: search['filter_pre_ann_limit'] = filter_pre_ann_limit if filter_pre_ann_ratio >= 0.0: search['filter_pre_ann_ratio'] = filter_pre_ann_ratio offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] text = None if "text" in item: text = item["text"] data = Data(fields, id=id, timestamp=None, score=item["score"], text=text, dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas async def async_search_by_text(self, text, filter=None, limit=10, output_fields=None, partition="default", dense_weight=None, need_instruction=None, primary_key_in=None, primary_key_not_in=None, post_process_ops=None, post_process_input_limit=None, **kwargs): warnings.warn("async_search_by_text is deprecated, please use async_search_with_multi_modal instead", DeprecationWarning) order_by_raw = {"text": text.text} search = {"order_by_raw": order_by_raw, "limit": limit, "partition": partition} if output_fields is not None: search["output_fields"] = output_fields if filter is not None: search['filter'] = filter if dense_weight is not None: search['dense_weight'] = dense_weight if need_instruction is not None: search['need_instruction'] = need_instruction if primary_key_in is not None: search['primary_key_in'] = primary_key_in if primary_key_not_in is not None: search['primary_key_not_in'] = primary_key_not_in if post_process_ops is not None: search['post_process_ops'] = post_process_ops if post_process_input_limit is not None: search['post_process_input_limit'] = post_process_input_limit offset = kwargs.get("offset", -1) if offset >= 0: search['offset'] = offset need_search_count = kwargs.get("need_search_count", False) if need_search_count: search['need_search_count'] = need_search_count if self._is_client: search['replace_primay'] = True if kwargs.get("need_return_vector", False): search['need_return_vector'] = kwargs['need_return_vector'] params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": search} res = await self.viking_db_service.async_json_exception("SearchIndex", {}, json.dumps(params)) res = json.loads(res) datas = [] # 返回数据是个列表,每个vector又对应一个列表,但是这里输入vector好像只能传一个值,所以要for两次 for items in res["data"]: for item in items: id = item[self.primary_key] fields = {} if output_fields != [] or output_fields is None or item.get('fields', None): fields = item["fields"] text = None if "text" in item: text = item["text"] data = Data(fields, id=id, timestamp=None, score=item["score"], text=text, dist=item.get('dist', None)) datas.append(data) extend_info = res.get('extend', {}) if need_search_count: return datas, extend_info return datas def search_agg(self, agg: Dict[str, any], filter=None, partition="default", retry=True) -> AggResult: """ Search and aggregate the data. :param agg: the aggregation operator. :type agg: dict :param filter: filter conditions. :type filter: dict :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :rtype: list :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": {"partition": partition}, "agg": agg} if filter is not None: params["search"]["filter"] = filter remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("SearchAgg", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) data = res["data"] return AggResult( agg_op=data["agg_op"], group_by_field=data["group_by_field"], agg_result=data["agg_result"], ) async def async_search_agg(self, agg: Dict[str, any], filter=None, partition="default") -> AggResult: params = {"collection_name": self.collection_name, "index_name": self.index_name, "search": {"partition": partition}, "agg": agg} if filter is not None: params["search"]["filter"] = filter res = await self.viking_db_service.async_json_exception("SearchAgg", {}, json.dumps(params)) res = json.loads(res) data = res["data"] return AggResult( agg_op=data["agg_op"], group_by_field=data["group_by_field"], agg_result=data["agg_result"], ) def sort(self, query_vector: List[float], primary_keys: List, retry=True): """ Index sort: input a query vector and primary key list, get the sorted score list. :param query_vector: one query vector. :type query_vector: list :param primary_keys: primary key list. :type primary_keys: list :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ params = {"collection_name": self.collection_name, "index_name": self.index_name, "sort": {"query_vector": query_vector, "primary_keys": primary_keys}} remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("IndexSort", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) data = res["data"] result_items = [] for raw_item in data["sort_result"]: primary_key = raw_item["primary_key"] score = raw_item["score"] result_items.append(SortResultItem(primary_key=primary_key, score=score)) return IndexSortResult(sort_result=result_items, primary_key_not_exist=data["primary_key_not_exist"]) def fetch_data(self, id: Union[str, List[str], int, List[int]], output_fields=None, partition="", retry=True): """ Fetch data by primary key (id). this method is much faster than Collection.fetch_data() due to indexed. :param text: the given primary key or keys. :type text: str or int or list[str] or list[int] :param output_fields: specify the list of scalar fields to be returned. :type output_fields: list :param partition: the name of sub-index. :type partition: int or str or list[int] or list[str] :param retry: whether to retry when the request fails caused by 1000029: QuotaLimiterException. :type retry: bool """ params = {} if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "index_name": self.index_name, "primary_keys": id} if output_fields is not None: params["output_fields"] = output_fields if partition != "": params["partition"] = partition remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("FetchIndexData", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) # res["data"]是一个list # print(res["data"][0]["fields"]) fields = {} if "fields" in res["data"][0]: fields = res["data"][0]["fields"] data = Data(fields, id=id, timestamp=None) return data elif isinstance(id, List): datas = [] params = {"collection_name": self.collection_name, "index_name": self.index_name, "primary_keys": id} if output_fields is not None: params["output_fields"] = output_fields if partition != "": params["partition"] = partition if self._is_client: params['replace_primay'] = True remaining = self.retry_option.new_remaining(retry) res = self.viking_db_service._retry_request("FetchIndexData", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) # print(res) for item in res["data"]: # print(item) fields = {} if "fields" in item: # print(item["fields"]) fields = item["fields"] data = Data(fields, id=item[self.primary_key], timestamp=None) datas.append(data) return datas async def async_fetch_data(self, id: Union[str, List[str], int, List[int]], output_fields=None, partition=""): params = {} if isinstance(id, str) or isinstance(id, int): params = {"collection_name": self.collection_name, "index_name": self.index_name, "primary_keys": id} if output_fields is not None: params["output_fields"] = output_fields if partition != "": params["partition"] = partition res = await self.viking_db_service.async_get_body_exception("FetchIndexData", {}, json.dumps(params)) res = json.loads(res) # res["data"]是一个list # print(res["data"][0]["fields"]) fields = {} if "fields" in res["data"][0]: fields = res["data"][0]["fields"] data = Data(fields, id=id, timestamp=None) return data elif isinstance(id, List): datas = [] params = {"collection_name": self.collection_name, "index_name": self.index_name, "primary_keys": id} if output_fields is not None: params["output_fields"] = output_fields if partition != "": params["partition"] = partition if self._is_client: params['replace_primay'] = True res = await self.viking_db_service.async_get_body_exception("FetchIndexData", {}, json.dumps(params)) res = json.loads(res) # print(res) for item in res["data"]: # print(item) fields = {} if "fields" in item: # print(item["fields"]) fields = item["fields"] data = Data(fields, id=item[self.primary_key], timestamp=None) datas.append(data) return datas ================================================ FILE: volcengine/viking_db/IndexClient.py ================================================ # coding:utf-8 from volcengine.viking_db import Index, VikingDBService from volcengine.viking_db.common import RetryOption class IndexClient(Index): def __init__(self, collection_name, index_name, host="api-vikingdb.volces.com", region="cn-north-1", ak="", sk="", scheme='http', connection_timeout=30, socket_timeout=30, proxy=None, retry_option=None): vikingdb_service = VikingDBService(host, region, ak, sk, scheme, connection_timeout, socket_timeout, proxy, retry_option) self.viking_db_service = vikingdb_service self.collection_name = collection_name self.index_name = index_name self.primary_key = "__primary_key" self._is_client = True self.retry_option = retry_option if retry_option else RetryOption() ================================================ FILE: volcengine/viking_db/ServiceBase.py ================================================ # coding:utf-8 import json import time import requests import aiohttp from .common import * from .exception import ERRCODE_EXCEPTION, VikingDBException from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo from volcengine.auth.SignerV4 import SignerV4 class VikingDBServiceBase(Service): def __init__(self, host="api-vikingdb.volces.com", region="cn-north-1", ak="", sk="", scheme='http', connection_timeout=30, socket_timeout=30, proxy=None, retry_option=None): """ :param retry_option: retry option. :type retry_option: RetryOption """ self.service_info = VikingDBServiceBase.get_service_info(host, region, scheme, connection_timeout, socket_timeout, ak, sk) self.api_info = VikingDBServiceBase.get_api_info() super(VikingDBServiceBase, self).__init__(self.service_info, self.api_info) if ak: self.set_ak(ak) if sk: self.set_sk(sk) if proxy is not None: if "http:" in proxy: self.session.proxies.update({ 'http': proxy, }) if "https:" in proxy: self.session.proxies.update({ 'https': proxy, }) self.retry_option = retry_option if retry_option else RetryOption() try: res = self.get_body("Ping", {}, json.dumps({})) except Exception as e: raise VikingDBException(1000028, "missed", "host or region is incorrect: {}".format(str(e))) from None def setHeader(self, header): api_info = VikingDBServiceBase.get_api_info() for key in api_info: for item in header: api_info[key].header[item] = header[item] self.api_info = api_info @staticmethod def get_service_info(host, region, scheme, connection_timeout, socket_timeout, ak, sk): service_info = ServiceInfo(host, {"Host": host}, Credentials(ak, sk, 'air', region), connection_timeout, socket_timeout, scheme=scheme) return service_info @staticmethod def get_api_info(): api_info = { # Collection "CreateCollection": ApiInfo("POST", "/api/collection/create", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "GetCollection": ApiInfo("GET", "/api/collection/info", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "DropCollection": ApiInfo("POST", "/api/collection/drop", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "ListCollections": ApiInfo("GET", "/api/collection/list", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), # Index "CreateIndex": ApiInfo("POST", "/api/index/create", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "GetIndex": ApiInfo("GET", "/api/index/info", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "DropIndex": ApiInfo("POST", "/api/index/drop", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "ListIndexes": ApiInfo("GET", "/api/index/list", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "UpsertData": ApiInfo("POST", "/api/collection/upsert_data", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "UpdateData": ApiInfo("POST", "/api/collection/update_data", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "DeleteData": ApiInfo("POST", "/api/collection/del_data", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "FetchData": ApiInfo("GET", "/api/collection/fetch_data", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "FetchIndexData": ApiInfo("GET", "/api/index/fetch_data", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "SearchIndex": ApiInfo("POST", "/api/index/search", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "SearchAgg": ApiInfo("POST", "/api/index/search/agg", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "IndexSort": ApiInfo("POST", "/api/index/sort", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "Embedding": ApiInfo("POST", "/api/data/embedding", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "ListEmbeddings": ApiInfo("GET", "/api/data/list_embedding_models", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "UpdateCollection": ApiInfo("POST", "/api/collection/update", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "UpdateIndex": ApiInfo("POST", "/api/index/update", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "Rerank": ApiInfo("POST", "/api/index/rerank", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "BatchRerank": ApiInfo("POST", "/api/index/batch_rerank", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "Ping": ApiInfo("GET", "/api/viking_db/data/ping", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "EmbeddingV2": ApiInfo("POST", "/api/data/embedding/version/2", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "CreateTask": ApiInfo("POST", "/api/task/create", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "GetTask": ApiInfo("POST", "/api/task/info", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "ListTask": ApiInfo("POST", "/api/task/list", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "DropTask": ApiInfo("POST", "/api/task/drop", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), "UpdateTask": ApiInfo("POST", "/api/task/update", {}, {}, {'Accept': 'application/json', 'Content-Type': 'application/json'}), } return api_info # get参数放在body里面 def get_body(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.get(url, headers=r.headers, data=r.body, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return json.dumps(resp.json()) else: raise Exception(resp.text.encode("utf-8")) async def async_json(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body SignerV4.sign(r, self.service_info.credentials) timeout = aiohttp.ClientTimeout(connect=self.service_info.connection_timeout, sock_connect=self.service_info.socket_timeout) url = r.build() async with aiohttp.request("POST", url, headers=r.headers, data=r.body, timeout=timeout) as r: resp = await r.text(encoding="utf-8") if r.status == 200: return resp else: raise Exception(resp) # get参数放在body里面,异常处理 def get_body_exception(self, api, params, body): # res = self.get_body(api, params, body) # if res == '': # raise VikingDBException(1000028, "missed", # "empty response due to unknown error, please contact customer service") # return res try: res = self.get_body(api, params, body) except requests.Timeout as e: raise e except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingDBException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res # get参数放在url里面,异常处理 def get_exception(self, api, params): try: res = self.get(api, params) except requests.Timeout as e: raise e except Exception as e: try: res_json = json.loads(e.args[0]) except: raise VikingDBException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res # post异常处理 def json_exception(self, api, params, body): # res = self.json(api, params, body) # if res == '': # raise VikingDBException(1000028, "missed", # "empty response due to unknown error, please contact customer service") # return res try: res = self.json(api, params, body) except requests.Timeout as e: raise e except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingDBException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res async def async_json_exception(self, api, params, body): try: res = await self.async_json(api, params, body) except requests.Timeout as e: raise e except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingDBException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res async def async_get_body_exception(self, api, params, body): try: res = await self.async_get_body(api, params, body) except requests.Timeout as e: raise e except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingDBException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res async def async_get_body(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body SignerV4.sign(r, self.service_info.credentials) timeout = aiohttp.ClientTimeout(connect=self.service_info.connection_timeout, sock_connect=self.service_info.socket_timeout) url = r.build() async with aiohttp.request("GET", url, headers=r.headers, data=r.body, timeout=timeout) as r: resp = await r.text(encoding="utf-8") if r.status == 200: return resp else: raise Exception(resp) def _retry_request(self, api, params, body, remaining=None, retry_option=None): try: method = self.api_info[api].method if method == "GET": res = self.get_body(api, params, body) else: res = self.json(api, params, body) except requests.Timeout as e: if remaining and remaining.has_remaining(): timeout = retry_option.calculate_retry_timeout(remaining) time.sleep(timeout) else: raise e return self._retry_request(api, params, body, remaining, retry_option) except Exception as e: err_msg = "request exception: {}".format(e) try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingDBException(1000028, "missed", "res json load error: {}, due to last error: {}".format(str(e), err_msg)) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) if code == 1000029 and remaining and remaining.has_remaining(): timeout = retry_option.calculate_retry_timeout(remaining) time.sleep(timeout) return self._retry_request(api, params, body, remaining, retry_option) else: raise ERRCODE_EXCEPTION.get(code, VikingDBException)(code, request_id, message) from None if res == '': raise VikingDBException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res ================================================ FILE: volcengine/viking_db/Task.py ================================================ class Task(object): def __init__(self, collection_name, create_time, process_info, task_id, task_params, task_status, task_type, update_person, update_time): self.collection_name = collection_name self.create_time = create_time self.process_info = process_info self.task_id = task_id self.task_params = task_params self.task_status = task_status self.task_type = task_type self.update_person = update_person self.update_time = update_time ================================================ FILE: volcengine/viking_db/VikingDBService.py ================================================ # coding:utf-8 from .Task import Task import json import threading from .Index import Index from .common import * from .Collection import Collection from .ServiceBase import VikingDBServiceBase from .exception import ERRCODE_EXCEPTION, VikingDBException from typing import Union, List class VikingDBService(VikingDBServiceBase): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VikingDBService, "_instance"): with VikingDBService._instance_lock: if not hasattr(VikingDBService, "_instance"): VikingDBService._instance = object.__new__(cls) return VikingDBService._instance def __init__(self, host="api-vikingdb.volces.com", region="cn-north-1", ak="", sk="", scheme='http', connection_timeout=30, socket_timeout=30, proxy=None, retry_option=None): """ :param retry_option: retry option. :type retry_option: RetryOption """ super(VikingDBService, self).__init__( host, region, ak, sk, scheme, connection_timeout, socket_timeout, proxy, retry_option) def create_collection(self, collection_name, fields, description="", vectorize=None, project="default"): """ create a collection. :param collection_name: The name of the collection. :type collection_name: str :param fields: The custom fields of the collection. :type fields: list[Field] :param description: The description of the collection. :type description: str :param vectorize: vectorize for multi-modal data. :type vectorize: list[VectorizeTuple] :param project: The name of the project. :type project: str :rtype: Collection """ params = {"collection_name": collection_name, "description": description, "project": project} assert isinstance(fields, list) primary_key = None _fields = [] for field in fields: assert isinstance(field, Field) if field.is_primary_key: primary_key = field.field_name _field = { "field_name": field.field_name, "field_type": field.field_type.value, } if field.default_val is not None: _field["default_val"] = field.default_val if field.dim is not None: _field["dim"] = field.dim if field.pipeline_name is not None: _field["pipeline_name"] = field.pipeline_name _fields.append(_field) if primary_key: params["primary_key"] = primary_key else: params["primary_key"] = "__AUTO_ID__" params["fields"] = _fields if vectorize is not None: assert isinstance(vectorize, list) and all(isinstance(item, VectorizeTuple) for item in vectorize) params["vectorize"] = [convert_vectorize_tuple_to_dict(v) for v in vectorize] self.json_exception("CreateCollection", {}, json.dumps(params)) return Collection(collection_name, fields, self, primary_key, description=description, retry_option=self.retry_option, vectorize=vectorize) async def async_create_collection(self, collection_name, fields, description="", vectorize=None): params = {"collection_name": collection_name, "description": description} assert isinstance(fields, list) primary_key = None _fields = [] for field in fields: assert isinstance(field, Field) if field.is_primary_key: primary_key = field.field_name _field = { "field_name": field.field_name, "field_type": field.field_type.value, } if field.default_val is not None: _field["default_val"] = field.default_val if field.dim is not None: _field["dim"] = field.dim if field.pipeline_name is not None: _field["pipeline_name"] = field.pipeline_name _fields.append(_field) if primary_key: params["primary_key"] = primary_key else: params["primary_key"] = "__AUTO_ID__" params["fields"] = _fields if vectorize is not None: assert isinstance(vectorize, list) and all(isinstance(item, VectorizeTuple) for item in vectorize) params["vectorize"] = [convert_vectorize_tuple_to_dict(v) for v in vectorize] await self.async_json_exception("CreateCollection", {}, json.dumps(params)) return Collection(collection_name, fields, self, primary_key, description=description, retry_option=self.retry_option, vectorize=vectorize) def get_collection(self, collection_name, retry=True): """ get a collection :param collection_name: The name of the collection. :type collection_name: str :rtype: Collection :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ params = {"collection_name": collection_name} remaining = self.retry_option.new_remaining(retry) res = self._retry_request("GetCollection", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) description = "" stat = None fields = [] indexes = [] create_time = None update_time = None update_person = None vectorize = None if "fields" in res["data"]: # fields 应该是list,这里是json array # print(res["data"]["fields"]) for item in res["data"]["fields"]: field_name = None field_type = None default_val = None dim = None is_primary_key = False pipeline_name = None # print(item) if "field_name" in item: field_name = item["field_name"] if "field_type" in item: field_type = item["field_type"] if "default_val" in item: default_val = item["default_val"] if "dim" in item: dim = item["dim"] if "primary_key" in res["data"]: if res["data"]["primary_key"] == field_name: is_primary_key = True if "pipeline_name" in item: pipeline_name = item["pipeline_name"] # print(field_name, field_type, default_val, dim, is_primary_key, pipeline_name) field = Field(field_name, field_type, default_val=default_val, dim=dim, is_primary_key=is_primary_key, pipeline_name=pipeline_name) fields.append(field) if "description" in res["data"]: description = res["data"]["description"] if "indexes" in res["data"]: # print(res["data"]["indexes"]) 返回的是index_name for item in res["data"]["indexes"]: # print(item) index = self.get_index(collection_name, item) indexes.append(index) if "stat" in res["data"]: stat = res["data"]["stat"] if "create_time" in res["data"]: create_time = res["data"]["create_time"] if "update_time" in res["data"]: update_time = res["data"]["update_time"] if "update_person" in res["data"]: update_person = res["data"]["update_person"] if "vectorize" in res["data"]: vectorize_dict_list = res["data"]["vectorize"] vectorize = [convert_dict_to_vectorize_tuple(v_dict) for v_dict in vectorize_dict_list] collection = Collection(collection_name, fields, self, res["data"]["primary_key"], indexes=indexes, stat=stat, description=description, create_time=create_time, update_time=update_time, update_person=update_person, retry_option=self.retry_option, vectorize=vectorize) return collection async def async_get_collection(self, collection_name): params = {"collection_name": collection_name} res = await self.async_get_body_exception("GetCollection", {}, json.dumps(params)) res = json.loads(res) if "data" not in res: raise VikingDBException(1000028, "missed", "data format error, please contact us") return self.package_collection(collection_name, res["data"]) def package_collection(self, collection_name, res): description = "" stat = None fields = [] indexes = [] create_time = None update_time = None update_person = None vectorize = None if "fields" in res: for item in res["fields"]: field_name = None field_type = None default_val = None dim = None is_primary_key = False pipeline_name = None # print(item) if "field_name" in item: field_name = item["field_name"] if "field_type" in item: field_type = item["field_type"] if "default_val" in item: default_val = item["default_val"] if "dim" in item: dim = item["dim"] if "primary_key" in res: if res["primary_key"] == field_name: is_primary_key = True if "pipeline_name" in item: pipeline_name = item["pipeline_name"] # print(field_name, field_type, default_val, dim, is_primary_key, pipeline_name) field = Field(field_name, field_type, default_val=default_val, dim=dim, is_primary_key=is_primary_key, pipeline_name=pipeline_name) fields.append(field) if "description" in res: description = res["description"] if "indexes" in res: for item in res["indexes"]: # print(item) index = self.get_index(collection_name, item) indexes.append(index) if "stat" in res: stat = res["stat"] if "create_time" in res: create_time = res["create_time"] if "update_time" in res: update_time = res["update_time"] if "update_person" in res: update_person = res["update_person"] if "vectorize" in res: vectorize_dict_list = res["vectorize"] vectorize = [convert_dict_to_vectorize_tuple(v_dict) for v_dict in vectorize_dict_list] # print(description, fields, indexes, stat, res["primary_key"]) collection = Collection(collection_name, fields, self, res["primary_key"], indexes=indexes, stat=stat, description=description, create_time=create_time, update_time=update_time, update_person=update_person, retry_option=self.retry_option, vectorize=vectorize) return collection def drop_collection(self, collection_name, retry=True): """ drop a collection :param collection_name: The name of the collection. :type collection_name: str :rtype: None :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ remaining = self.retry_option.new_remaining(retry) params = {"collection_name": collection_name} self._retry_request("DropCollection", {}, json.dumps(params), remaining, self.retry_option) # res = self.json("DropCollection", {}, json.dumps(params)) async def async_drop_collection(self, collection_name): params = {"collection_name": collection_name} await self.async_json_exception("DropCollection", {}, json.dumps(params)) def list_collections(self, project=""): """ list collections :param project: The name of the project. :type project: str :rtype: list[Collection] """ params = { "project": project } res = self.get_body_exception("ListCollections", {}, json.dumps(params)) res = json.loads(res) collections = [] for indexItem in res["data"]: description = None collection_name = None stat = None fields = [] indexes = [] create_time = None update_time = None update_person = None vectorize = None if "fields" in indexItem: for item in indexItem["fields"]: field_name = None field_type = None default_val = None dim = None is_primary_key = False pipeline_name = None if "field_name" in item: field_name = item["field_name"] if "field_type" in item: field_type = item["field_type"] if "default_val" in item: default_val = item["default_val"] if "dim" in item: dim = item["dim"] if "primary_key" in indexItem: if indexItem["primary_key"] == field_name: is_primary_key = True if "pipeline_name" in item: pipeline_name = item["pipeline_name"] # print(field_name, field_type, default_val, dim, is_primary_key, pipeline_name) field = Field(field_name, field_type, default_val=default_val, dim=dim, is_primary_key=is_primary_key, pipeline_name=pipeline_name) fields.append(field) if "collection_name" in indexItem: collection_name = indexItem["collection_name"] if "description" in indexItem: description = indexItem["description"] if "indexes" in indexItem: # print(res["data"]["indexes"]) 返回的是index_name for item in indexItem["indexes"]: # print(item) index = self.get_index(collection_name, item) indexes.append(index) if "stat" in indexItem: stat = indexItem["stat"] if "create_time" in indexItem: create_time = indexItem["create_time"] if "update_time" in indexItem: update_time = indexItem["update_time"] if "update_person" in indexItem: update_person = indexItem["update_person"] if "vectorize" in indexItem: vectorize_dict_list = indexItem["vectorize"] vectorize = [convert_dict_to_vectorize_tuple(v_dict) for v_dict in vectorize_dict_list] # print(description, fields, indexes, stat, indexItem["primary_key"], create_time, update_time, update_person) collection = Collection(collection_name, fields, self, indexItem["primary_key"], indexes=indexes, stat=stat, description=description, create_time=create_time, update_time=update_time, update_person=update_person, retry_option=self.retry_option, vectorize=vectorize) collections.append(collection) return collections async def async_list_collections(self): res = await self.async_get_body_exception("ListCollections", {}, json.dumps({})) res = json.loads(res) collections = [] if "data" not in res: raise VikingDBException(1000028, "missed", "data format error, please contact us") for indexItem in res["data"]: collection = self.package_collection(indexItem["collection_name"], indexItem) collections.append(collection) return collections def create_index(self, collection_name, index_name, vector_index=None, cpu_quota=2, description="", partition_by="", scalar_index=None, shard_count=None, shard_policy=None): """ create an index. :param collection_name: The name of the collection. :type collection_name: str :param index_name: The name of the index. :type index_name: str :param vector_index: determine vector index :type vector_index: VectorIndexParams or None :param cpu_quota: CPU quota :type cpu_quota: int :param description: The description of the index. :type description: str :param partition_by: partition_by sub-indexing partition. :type partition_by: str :param scalar_index: determine index type. :type scalar_index: list or None :param shard_count: shard count. :type shard_count: int :rtype: Index """ # print(vector_index.dic()) params = { "collection_name": collection_name, "index_name": index_name, "cpu_quota": cpu_quota, "description": description, "partition_by": partition_by, } if vector_index is not None: params["vector_index"] = vector_index.dic() # vector_index 类型应该是VectorIndexParams,而非json if scalar_index is not None: params["scalar_index"] = scalar_index if shard_count is not None: params["shard_count"] = shard_count if shard_policy is not None: params["shard_policy"] = shard_policy.value # print(params) res = self.json_exception("CreateIndex", {}, json.dumps(params)) # print(res) index = Index(collection_name, index_name, vector_index, scalar_index, None, self, description=description, cpu_quota=cpu_quota, partition_by=partition_by, retry_option=self.retry_option) return index async def async_create_index(self, collection_name, index_name, vector_index=None, cpu_quota=2, description="", partition_by="", scalar_index=None, shard_count=None, shard_policy=None): params = { "collection_name": collection_name, "index_name": index_name, "cpu_quota": cpu_quota, "description": description, "partition_by": partition_by, } if vector_index is not None: params["vector_index"] = vector_index.dic() # vector_index 类型应该是VectorIndexParams,而非json if scalar_index is not None: params["scalar_index"] = scalar_index if shard_count is not None: params["shard_count"] = shard_count if shard_policy is not None: params["shard_policy"] = shard_policy.value # print(params) res = await self.async_json_exception("CreateIndex", {}, json.dumps(params)) # print(res) index = Index(collection_name, index_name, vector_index, scalar_index, None, self, description=description, cpu_quota=cpu_quota, partition_by=partition_by, retry_option=self.retry_option) return index def get_index(self, collection_name, index_name, retry=True): """ get an index :param collection_name: The name of the collection. :type collection_name: str :param index_name: The name of the index. :type index_name: str :rtype: Index :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ params = { "collection_name": collection_name, "index_name": index_name, } remaining = self.retry_option.new_remaining(retry) res = self._retry_request("GetIndex", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) vector_index = scalar_index = partition_by = status = None cpu_quota = 2 description = "" shard_count = shard_policy = index_cost = create_time = update_time = update_person = None # print(res["data"]) if "vector_index" in res["data"]: vector_index = res["data"]["vector_index"] # if "scalar_index" in res["data"]: # scalar_index = res["data"]["scalar_index"] if "range_index" in res["data"]: scalar_index = res["data"]["range_index"] if "enum_index" in res["data"]: if scalar_index is not None: scalar_index = set(scalar_index + res["data"]["enum_index"]) else: scalar_index = res["data"]["enum_index"] if "description" in res["data"]: description = res["data"]["description"] if "cpu_quota" in res["data"]: cpu_quota = res["data"]["cpu_quota"] if "partition_by" in res["data"]: partition_by = res["data"]["partition_by"] if "status" in res["data"]: status = res["data"]["status"] if "create_time" in res["data"]: create_time = res["data"]["create_time"] if "update_time" in res["data"]: update_time = res["data"]["update_time"] if "update_person" in res["data"]: update_person = res["data"]["update_person"] if "index_cost" in res["data"]: index_cost = res["data"]["index_cost"] if "shard_count" in res["data"]: shard_count = res["data"]["shard_count"] if "shard_policy" in res["data"]: shard_policy = res["data"]["shard_policy"] # print(collection_name, index_name, vector_index, scalar_index, description, cpu_quota, partition_by, status) index = Index(collection_name, index_name, vector_index, scalar_index, status, self, description=description, cpu_quota=cpu_quota, partition_by=partition_by, create_time=create_time, update_time=update_time, update_person=update_person, index_cost=index_cost, shard_count=shard_count, shard_policy=shard_policy, retry_option=self.retry_option) return index async def async_get_index(self, collection_name, index_name): params = { "collection_name": collection_name, "index_name": index_name, } res = await self.async_get_body_exception("GetIndex", {}, json.dumps(params)) res = json.loads(res) if "data" not in res: raise VikingDBException(1000028, "missed", "data format error, please contact us") return self.package_index(collection_name, index_name, res["data"]) def package_index(self, collection_name, index_name, res): vector_index = scalar_index = partition_by = status = None cpu_quota = 2 description = "" shard_count = shard_policy = index_cost = create_time = update_time = update_person = None if "vector_index" in res: vector_index = res["vector_index"] if "range_index" in res: scalar_index = res["range_index"] if "enum_index" in res: if scalar_index is not None: scalar_index = set(scalar_index + res["enum_index"]) else: scalar_index = res["enum_index"] if "description" in res: description = res["description"] if "cpu_quota" in res: cpu_quota = res["cpu_quota"] if "partition_by" in res: partition_by = res["partition_by"] if "status" in res: status = res["status"] if "create_time" in res: create_time = res["create_time"] if "update_time" in res: update_time = res["update_time"] if "update_person" in res: update_person = res["update_person"] if "index_cost" in res: index_cost = res["index_cost"] if "shard_count" in res: shard_count = res["shard_count"] if "shard_policy" in res: shard_policy = res["shard_policy"] # print(collection_name, index_name, vector_index, scalar_index, description, cpu_quota, partition_by, status) index = Index(collection_name, index_name, vector_index, scalar_index, status, self, description=description, cpu_quota=cpu_quota, partition_by=partition_by, create_time=create_time, update_time=update_time, update_person=update_person, index_cost=index_cost, shard_count=shard_count, shard_policy=shard_policy, retry_option=self.retry_option) return index def drop_index(self, collection_name, index_name): """ drop an index :param collection_name: The name of the collection. :type collection_name: str :param index_name: The name of the index. :type index_name: str :rtype: None """ params = { "collection_name": collection_name, "index_name": index_name, } # res = self.json("DropIndex", {}, json.dumps(params)) self.json_exception("DropIndex", {}, json.dumps(params)) async def async_drop_index(self, collection_name, index_name): params = { "collection_name": collection_name, "index_name": index_name, } await self.async_json_exception("DropIndex", {}, json.dumps(params)) def list_indexes(self, collection_name): """ list indexes :rtype: list[Index] """ params = { "collection_name": collection_name, } # res = self.get("ListIndexes", params) res = self.get_exception("ListIndexes", params) res = json.loads(res) indexes = [] for item in res["data"]: # print(item) vector_index = scalar_index = partition_by = status = None cpu_quota = 2 description = index_name = "" shard_count = shard_policy = index_cost = create_time = update_time = update_person = None if "index_name" in item: index_name = item["index_name"] if "vector_index" in item: vector_index = item["vector_index"] # if "scalar_index" in item: # scalar_index = item["scalar_index"] if "range_index" in item: scalar_index = item["range_index"] if "enum_index" in item: if scalar_index is not None: scalar_index = set(scalar_index + item["enum_index"]) else: scalar_index = item["enum_index"] if "description" in item: description = item["description"] if "cpu_quota" in item: cpu_quota = item["cpu_quota"] if "partition_by" in item: partition_by = item["partition_by"] if "status" in item: status = item["status"] if "create_time" in item: create_time = item["create_time"] if "update_time" in item: update_time = item["update_time"] if "update_person" in item: update_person = item["update_person"] if "index_cost" in item: index_cost = item["index_cost"] if "shard_count" in item: shard_count = item["shard_count"] if "shard_policy" in item: shard_policy = item["shard_policy"] # print(collection_name, index_name, vector_index, scalar_index, description, cpu_quota, partition_by, status) index = Index(collection_name, index_name, vector_index, scalar_index, status, self, description=description, cpu_quota=cpu_quota, partition_by=partition_by, create_time=create_time, update_time=update_time, update_person=update_person, index_cost=index_cost, shard_count=shard_count, shard_policy=shard_policy, retry_option=self.retry_option) indexes.append(index) # print(indexes) return indexes async def async_list_indexes(self, collection_name): params = { "collection_name": collection_name, } # res = self.get("ListIndexes", params) res = await self.async_get_body_exception("ListIndexes", {}, json.dumps(params)) res = json.loads(res) indexes = [] if "data" not in res: raise VikingDBException(1000028, "missed", "data format error, please contact us") for item in res["data"]: index = self.package_index(collection_name, item["index_name"], item) indexes.append(index) # print(indexes) return indexes def embedding(self, emb_model, raw_data: Union[RawData, List[RawData]], retry=True): """ request embedding service to extract features from text, images, etc. :param emb_model: The name of the collection. :type emb_model: EmbModel :param raw_data: The name of the collection. :type raw_data: RawData or list[RawData] :rtype: list or list[list] :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ model = {"model_name": emb_model.model_name, "params": emb_model.params} data = [] if isinstance(raw_data, RawData): param = {"data_type": raw_data.data_type, "text": raw_data.text} data.append(param) elif isinstance(raw_data, List): for item in raw_data: param = {"data_type": item.data_type, "text": item.text} data.append(param) params = {"model": model, "data": data} remaining = self.retry_option.new_remaining(retry) res = self._retry_request("Embedding", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) # print(res["data"]) if isinstance(raw_data, RawData): return res["data"][0] else: return res["data"] async def async_embedding(self, emb_model, raw_data: Union[RawData, List[RawData]]): model = {"model_name": emb_model.model_name, "params": emb_model.params} data = [] if isinstance(raw_data, RawData): param = {"data_type": raw_data.data_type, "text": raw_data.text} data.append(param) elif isinstance(raw_data, List): for item in raw_data: param = {"data_type": item.data_type, "text": item.text} data.append(param) params = {"model": model, "data": data} res = await self.async_json_exception("Embedding", {}, json.dumps(params)) res = json.loads(res) # print(res["data"]) if isinstance(raw_data, RawData): # print(res["data"][0]) return res["data"][0] else: return res["data"] def update_collection(self, collection_name, fields, description=None): _fields = [] for field in fields: assert isinstance(field, Field) _field = { "field_name": field.field_name, "field_type": field.field_type.value, } if field.default_val is not None: _field["default_val"] = field.default_val if field.dim is not None: _field["dim"] = field.dim if field.pipeline_name is not None: _field["pipeline_name"] = field.pipeline_name _fields.append(_field) params = { "collection_name": collection_name, "fields": _fields } if description != None: params["description"] = description # print(params) res = self.json_exception("UpdateCollection", {}, json.dumps(params)) async def async_update_collection(self, collection_name, fields, description=None): _fields = [] for field in fields: assert isinstance(field, Field) _field = { "field_name": field.field_name, "field_type": field.field_type.value, } if field.default_val is not None: _field["default_val"] = field.default_val if field.dim is not None: _field["dim"] = field.dim if field.pipeline_name is not None: _field["pipeline_name"] = field.pipeline_name _fields.append(_field) params = { "collection_name": collection_name, "fields": _fields } if description != None: params["description"] = description # print(params) res = await self.async_json_exception("UpdateCollection", {}, json.dumps(params)) def update_index(self, collection_name, index_name, description=None, cpu_quota=None, scalar_index=None, shard_count=None): params = { "collection_name": collection_name, "index_name": index_name, } if description is not None: params["description"] = description if cpu_quota is not None: params["cpu_quota"] = cpu_quota if scalar_index is not None: params["scalar_index"] = scalar_index if shard_count is not None: params["shard_count"] = shard_count res = self.json_exception("UpdateIndex", {}, json.dumps(params)) async def async_update_index(self, collection_name, index_name, description=None, cpu_quota=None, scalar_index=None, shard_count=None): params = { "collection_name": collection_name, "index_name": index_name, } if description is not None: params["description"] = description if cpu_quota is not None: params["cpu_quota"] = cpu_quota if scalar_index is not None: params["scalar_index"] = scalar_index if shard_count is not None: params["shard_count"] = shard_count res = await self.async_json_exception("UpdateIndex", {}, json.dumps(params)) def list_embeddings(self, model_name=""): params = {"model_name": model_name} res = self.get_body_exception("ListEmbeddings", {}, json.dumps(params)) print(res) pass def rerank(self, query, content, title=""): params = { "query": query, "content": content, "title": title } res = self.json_exception("Rerank", {}, json.dumps(params)) res = json.loads(res) return res["data"] async def async_rerank(self, query, content, title=""): params = { "query": query, "content": content, "title": title } res = await self.async_json_exception("Rerank", {}, json.dumps(params)) res = json.loads(res) return res["data"] def batch_rerank(self, datas): params = { "datas": datas, } res = self.json_exception("BatchRerank", {}, json.dumps(params)) res = json.loads(res) return res["data"] async def async_batch_rerank(self, datas): params = { "datas": datas, } res = await self.async_json_exception("BatchRerank", {}, json.dumps(params)) res = json.loads(res) return res["data"] def embedding_v2(self, emb_model, raw_data: Union[RawData, List[RawData]], retry=True): """ request embedding service to extract features from text, images, etc. :param emb_model: The name of the collection. :type emb_model: EmbModel :param raw_data: The name of the collection. :type raw_data: RawData or list[RawData] :rtype: list or list[list] :param retry: Whether to retry when QuotaLimiterException occurs. :type retry: bool """ model = {"model_name": emb_model.model_name, "params": emb_model.params} data = [] if isinstance(raw_data, RawData): param = {"data_type": raw_data.data_type} if raw_data.text != "": param["text"] = raw_data.text if raw_data.image != "": param["image"] = raw_data.image data.append(param) elif isinstance(raw_data, List): for item in raw_data: param = {"data_type": item.data_type} if item.text != "": param["text"] = item.text if item.image != "": param["image"] = item.image data.append(param) params = {"model": model, "data": data} remaining = self.retry_option.new_remaining(retry) res = self._retry_request("EmbeddingV2", {}, json.dumps(params), remaining, self.retry_option) res = json.loads(res) return res["data"] async def async_embedding_v2(self, emb_model, raw_data: Union[RawData, List[RawData]]): model = {"model_name": emb_model.model_name, "params": emb_model.params} data = [] if isinstance(raw_data, RawData): param = {"data_type": raw_data.data_type} if raw_data.text != "": param["text"] = raw_data.text if raw_data.image != "": param["image"] = raw_data.image data.append(param) elif isinstance(raw_data, List): for item in raw_data: param = {"data_type": item.data_type} if item.text != "": param["text"] = item.text if item.image != "": param["image"] = item.image data.append(param) params = {"model": model, "data": data} res = await self.async_json_exception("EmbeddingV2", {}, json.dumps(params)) res = json.loads(res) # print(res["data"]) return res["data"] def package_task(self, res_data): collection_name = "" create_time = "" process_info = None task_id = "" task_params = None task_status = "" task_type = "" update_person = "" update_time = "" if "collection_name" in res_data: collection_name = res_data["collection_name"] if "create_time" in res_data: create_time = res_data["create_time"] if "process_info" in res_data: process_info = res_data["process_info"] if "task_id" in res_data: task_id = res_data["task_id"] if "task_params" in res_data: task_params = res_data["task_params"] if "task_status" in res_data: task_status = res_data["task_status"] if "task_type" in res_data: task_type = res_data["task_type"] if "update_person" in res_data: update_person = res_data["update_person"] if "update_time" in res_data: update_time = res_data["update_time"] # print(collection_name, create_time, process_info, task_id, task_params, task_status, task_type, update_person, update_time) return Task(collection_name, create_time, process_info, task_id, task_params, task_status, task_type, update_person, update_time) def create_task(self, task_type, task_params): params = {"task_type": task_type.value, "task_params": task_params} res = self.json_exception("CreateTask", {}, json.dumps(params)) res = json.loads(res) if "data" in res: if "task_id" in res["data"]: return res["data"]["task_id"] return "" def get_task(self, task_id): params = {"task_id": task_id} res = self.json_exception("GetTask", {}, json.dumps(params)) res = json.loads(res) if "data" in res: return self.package_task(res["data"]) else: return None def list_tasks(self): res = self.json_exception("ListTask", {}, json.dumps({})) res = json.loads(res) tasks = [] if "data" in res: for item in res["data"]: tasks.append(self.package_task(item)) return tasks def drop_task(self, task_id): params = {"task_id": task_id} res = self.json_exception("DropTask", {}, json.dumps(params)) def update_task(self, task_id, task_status): params = { "task_id": task_id, "task_status": task_status.value } res = self.json_exception("UpdateTask", {}, json.dumps(params)) ================================================ FILE: volcengine/viking_db/__init__.py ================================================ from .VikingDBService import VikingDBService from .Collection import Collection from .Index import Index from .common import * from .IndexClient import IndexClient from .CollectionClient import CollectionClient ================================================ FILE: volcengine/viking_db/common.py ================================================ # coding:utf-8 import json import random from enum import Enum from typing import List INITIAL_RETRY_DELAY = 0.5 MAX_RETRY_DELAY = 8.0 MAX_RETRIES = 3 class RetryRemaining(object): def __init__(self, remaining_retries, remaining_delay): self.remaining_retries = remaining_retries self.remaining_delay = remaining_delay def has_remaining(self): return self.remaining_retries > 0 and self.remaining_delay > 0 class RetryOption(object): def __init__(self): self.initial_retry_delay = INITIAL_RETRY_DELAY self.max_retry_delay = MAX_RETRY_DELAY self.max_retries = MAX_RETRIES self.retry_when_quota_limit = True self.retry_when_session_timeout = True def new_remaining(self, retry=True): remaining_retries = self.max_retries if retry else 0 remaining_delay = self.max_retry_delay if retry else 0 return RetryRemaining(remaining_retries, remaining_delay) def calculate_retry_timeout(self, remaining): remaining.remaining_retries = remaining.remaining_retries - 1 nb_retries = self.max_retries - remaining.remaining_retries sleep_seconds = min(self.initial_retry_delay * pow(2.0, nb_retries), self.max_retry_delay) jitter = 1 - 0.25 * random.random() timeout = sleep_seconds * jitter remaining.remaining_delay = remaining.remaining_delay - timeout return timeout if timeout >= 0 else 0 class ShardType(Enum): """ type of shard policy """ Auto = "auto" Custom = "custom" class FieldType(Enum): """ type of collection filed """ Vector = "vector" Int64 = "int64" List_Int64 = "list" String = "string" List_String = "list" Float32 = "float32" Bool = "bool" Text = "text" Image = "image" Sparse_Vector = "sparse_vector" class DistanceType(Enum): """ distance type of vector ann index """ L2 = "l2" IP = "ip" COSINE = "cosine" class IndexType(Enum): """ type of vector ann index """ FLAT = "flat" HNSW = "hnsw" IVF = "ivf" DiskANN = "DiskANN" HNSW_HYBRID = "hnsw_hybrid" SORT = "sort" class QuantType(Enum): """ quant type of vector ann index """ Float = "float" Int8 = "int8" Fix16 = "fix16" PQ = "pq" class Order(Enum): """ quant type of vector ann index """ Asc = "asc" Desc = "desc" class TaskType(Enum): Data_Import = "data_import" Filter_Delete = "filter_delete" Data_export = "data_export" Filter_Update = "filter_update" class TaskStatus(Enum): Init = "init" Queued = "queued" Running = "running" Done = "done" Fail = "fail" Confirm = "confirm" Confirmed = "confirmed" class EmbModel(object): def __init__(self, model_name, params=None): self._model_name = model_name self._params = params @property def model_name(self): return self._model_name @property def params(self): return self._params class RawData(object): def __init__(self, data_type, text="", image=""): self._data_type = data_type self._text = text self._image = image @property def data_type(self): return self._data_type @property def text(self): return self._text @property def image(self): return self._image class Field(object): """ Args: """ def __init__(self, field_name, field_type, default_val=None, dim=None, is_primary_key=False, pipeline_name=None): self._field_name = field_name self._field_type = field_type self._default_val = default_val self._dim = dim self._is_primary_key = is_primary_key self._pipeline_name = pipeline_name @property def field_name(self): return self._field_name @property def field_type(self): return self._field_type @property def default_val(self): return self._default_val @property def dim(self): return self._dim @property def is_primary_key(self): return self._is_primary_key @property def pipeline_name(self): return self._pipeline_name class VectorizeTuple(object): def __init__(self, dense, sparse=None): assert isinstance(dense, VectorizeModelConf) if sparse is not None: assert isinstance(sparse, VectorizeModelConf) self._dense = dense self._sparse = sparse @property def dense(self): return self._dense @property def sparse(self): return self._sparse class VectorizeModelConf(object): def __init__(self, model_name, model_version=None, dim=None, text_field=None, image_field=None): self._model_name = model_name self._model_version = model_version self._dim = dim self._text_field = text_field self._image_field = image_field @property def model_name(self): return self._model_name @property def model_version(self): return self._model_version @property def dim(self): return self._dim @property def text_field(self): return self._text_field @property def image_field(self): return self._image_field def convert_vectorize_tuple_to_dict(vectorize_tuple): assert isinstance(vectorize_tuple, VectorizeTuple) result = {} if vectorize_tuple.dense is not None: result['dense'] = convert_vectorize_conf_to_dict(vectorize_tuple.dense) if vectorize_tuple.sparse is not None: result['sparse'] = convert_vectorize_conf_to_dict(vectorize_tuple.sparse) return result def convert_vectorize_conf_to_dict(vectorize_conf): assert isinstance(vectorize_conf, VectorizeModelConf) result = {} if vectorize_conf.text_field is not None: result['text_field'] = vectorize_conf.text_field if vectorize_conf.image_field is not None: result['image_field'] = vectorize_conf.image_field if vectorize_conf.model_name is not None: result['model_name'] = vectorize_conf.model_name if vectorize_conf.model_version is not None: result['model_version'] = vectorize_conf.model_version if vectorize_conf.dim is not None: result['dim'] = vectorize_conf.dim return result def convert_dict_to_vectorize_tuple(vectorize_tuple_dict): assert isinstance(vectorize_tuple_dict, dict) dense_dict = vectorize_tuple_dict.get('dense', None) sparse_dict = vectorize_tuple_dict.get('sparse', None) return VectorizeTuple( dense=convert_dict_to_vectorize_conf(dense_dict), sparse=convert_dict_to_vectorize_conf(sparse_dict), ) def convert_dict_to_vectorize_conf(vectorize_conf_dict): if vectorize_conf_dict is None: return None assert isinstance(vectorize_conf_dict, dict) return VectorizeModelConf( vectorize_conf_dict['model_name'], model_version=vectorize_conf_dict.get('model_version', None), dim=vectorize_conf_dict.get('dim', None), text_field=vectorize_conf_dict.get('text_field', None), image_field=vectorize_conf_dict.get('image_field', None), ) class Text(object): def __init__(self, text=None, url=None, base64=None): self._text = text self._url = url self._base64 = base64 @property def text(self): return self._text @property def url(self): return self._url @property def base64(self): return self._base64 class Data(object): def __init__(self, fields, id=None, TTL=None, timestamp=None, score=None, text=None, dist=None): self._id = id self._fields = fields self._timestamp = timestamp self._TTL = TTL self._score = score self._text = text self._dist = dist @property def text(self): return self._text @property def TTL(self): return self._TTL @property def score(self): return self._score @property def id(self): return self._id @property def fields(self): return self._fields @property def timestamp(self): return self._timestamp @property def dist(self): return self._dist class AggResult(object): def __init__(self, agg_op, group_by_field, agg_result): self._agg_op = agg_op self._group_by_field = group_by_field self._agg_result = agg_result @property def agg_op(self): return self._agg_op @property def group_by_field(self): return self._group_by_field @property def agg_result(self): return self._agg_result class SortResultItem(object): def __init__(self, primary_key, score): self._primary_key = primary_key self._score = score @property def primary_key(self): return self._primary_key @property def score(self): return self._score class IndexSortResult(object): def __init__(self, sort_result: List[SortResultItem], primary_key_not_exist: List): self._sort_result: List[SortResultItem] = sort_result self._primary_key_not_exist = primary_key_not_exist @property def sort_result(self): return self._sort_result @property def primary_key_not_exist(self): return self._primary_key_not_exist class VectorIndexParams(object): def __init__(self, distance, index_type=IndexType.HNSW, quant=QuantType.Int8, **kwargs): self._index_type = index_type # 强感知distance参数 if not distance: raise ValueError("distance is required") self._distance = distance self._quant = quant self._hnsw_m = kwargs.get("hnsw_m", 20) self._hnsw_cef = kwargs.get("hnsw_cef", 400) self._hnsw_sef = kwargs.get("hnsw_sef", 800) def dic(self): return {"distance": self.distance.value, "index_type": self.index_type.value, "quant": self.quant.value, "hnsw_m": self.hnsw_m, "hnsw_cef": self.hnsw_cef, "hnsw_sef": self.hnsw_sef} @property def index_type(self): return self._index_type @property def distance(self): return self._distance @property def quant(self): return self._quant @property def hnsw_m(self): return self._hnsw_m @property def hnsw_cef(self): return self._hnsw_cef @property def hnsw_sef(self): return self._hnsw_sef class VectorOrder(object): def __init__(self, vector=None, sparse_vectors=None ,id=None): self._vector = vector self._id = id self._sparse_vectors = sparse_vectors @property def vector(self): return self._vector @property def sparse_vectors(self): return self._sparse_vectors @property def id(self): return self._id class ScalarOrder(object): def __init__(self, field_name, order): self._field_name = field_name self._order = order @property def field_name(self): return self._field_name @property def order(self): return self._order class MyClassEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, VectorIndexParams): return {"distance": obj.distance, "index_type": obj.index_type, "quant": obj.quant, "hnsw_m": obj.hnsw_m, "hnsw_cef": obj.hnsw_cef, "hnsw_sef": obj.hnsw_sef} # if isinstance(obj, IndexType): # return {'FLAT': obj.FLAT, 'HNSW': obj.HNSW} # if isinstance(obj, QuantType): # return {'Float': obj.Float, 'Int8': obj.Int8} return super().default(obj) ================================================ FILE: volcengine/viking_db/exception.py ================================================ # coding:utf-8 class VikingDBServerException(Exception): def __init__(self, code, request_id, message=None): self.code = code self.request_id = request_id self.message = "message:{}, code:{}, request_id:{}".format(message, self.code, self.request_id) def __str__(self): return self.message class UnauthorizedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class NoPermissionException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidRequestException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CollectionExistException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CollectionNotExistException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class OperationNotAllowedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexExistException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexNotExistException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class QueryOpFailedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DataNotFoundException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DelOpFailedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class UpsertOpFailedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class TokenMismatchException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidQueryVecException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidPrimaryKeyException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidPartitionException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidScalarCondException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidProxyServiceException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexRecallException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexFetchDataException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexNotReadyException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class APINotImplementedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CalcEmbeddingFailedException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class ListEmbeddingModelsException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class QuotaLimiterException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class RerankException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CollectionAliasNotExistException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class UserNoOrderException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class UserOverdueException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class HTTPErrException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class TaskNotFoundException(VikingDBServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class VikingDBException(VikingDBServerException): def __init__(self, code, request_id, message=None): self.code = code self.request_id = request_id if message is not None: self.message = message else: self.message = "unknown error, please contact customer service, request_id:{}".format(self.request_id) def __str__(self): return self.message ERRCODE_EXCEPTION = { 1000001: UnauthorizedException, 1000002: NoPermissionException, 1000003: InvalidRequestException, 1000004: CollectionExistException, 1000005: CollectionNotExistException, 1000006: OperationNotAllowedException, 1000007: IndexExistException, 1000008: IndexNotExistException, 1000010: QueryOpFailedException, 1000011: DataNotFoundException, 1000013: DelOpFailedException, 1000014: UpsertOpFailedException, 1000015: TokenMismatchException, 1000016: InvalidQueryVecException, 1000017: InvalidPrimaryKeyException, 1000018: InvalidPartitionException, 1000019: InvalidScalarCondException, 1000020: InvalidProxyServiceException, 1000021: IndexRecallException, 1000022: IndexFetchDataException, 1000023: IndexNotReadyException, 1000024: APINotImplementedException, 1000025: CalcEmbeddingFailedException, 1000026: ListEmbeddingModelsException, 1000028: VikingDBException, 1000029: QuotaLimiterException, 1000030: RerankException, 1000031: CollectionAliasNotExistException, 1000032: UserNoOrderException, 1000033: UserOverdueException, 1000034: HTTPErrException, 1000035: TaskNotFoundException, } # volcanoOK errCode = 0 # volcanoErrUnauthorized errCode = 1000001 # volcanoErrNoPermission errCode = 1000002 # volcanoErrInvalidRequest errCode = 1000003 # volcanoErrCollectionExist errCode = 1000004 # volcanoErrCollectionNotExist errCode = 1000005 # volcanoErrOperationNotAllowed errCode = 1000006 # volcanoErrIndexExist errCode = 1000007 # volcanoErrIndexNotExist errCode = 1000008 # volcanoErrQueryOpFailed errCode = 1000010 # volcanoErrDataNotFound errCode = 1000011 # volcanoErrDelOpFailed errCode = 1000013 # volcanoErrUpsertOpFailed errCode = 1000014 # volcanoErrTokenMismatch errCode = 1000015 # volcanoErrInvalidQueryVec errCode = 1000016 # volcanoErrInvalidPrimaryKey errCode = 1000017 # volcanoErrInvalidPartition errCode = 1000018 # volcanoErrInvalidScalarCond errCode = 1000019 # volcanoErrInvalidProxyService errCode = 1000020 # volcanoErrIndexRecall errCode = 1000021 # volcanoErrIndexFetchData errCode = 1000022 # volcanoErrIndexNotReady errCode = 1000023 # volcanoErrAPINotImplemented errCode = 1000024 # volcanoErrCalcEmbeddingFailed errCode = 1000025 # volcanoErrListEmbeddingModels errCode = 1000026 # volcanoErrInternal errCode = 1000028 ================================================ FILE: volcengine/viking_knowledgebase/Collection.py ================================================ # coding:utf-8 import json from .Doc import Doc from .Point import Point from .common import Field class Collection(object): """ KnowledgeBase Collection """ def __init__(self, viking_knowledgebase_service, collection_name, kwargs=None): self.viking_knowledgebase_service = viking_knowledgebase_service self.collection_name = collection_name if kwargs is not None: self.description = kwargs.get("description") self.doc_num = kwargs.get("doc_num") self.create_time = kwargs.get("create_time") self.update_time = kwargs.get("update_time") self.creator = kwargs.get("creator") self.pipeline_list = kwargs.get("pipeline_list") self.preprocessing = kwargs.get("preprocessing") self.fields = [Field(field) for field in kwargs.get("fields", [])] self.project = kwargs.get("project") self.resource_id = kwargs.get("resource_id") self.data_type = kwargs.get("data_type", "") def add_doc(self, add_type, doc_id=None, doc_name=None, doc_type=None, description=None, tos_path=None, url=None, lark_file=None, meta=None, dedup=None, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "add_type": add_type, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name if description is not None: params["description"] = description if dedup is not None: params["dedup"] = dedup if add_type == "tos" : params["tos_path"] = tos_path elif add_type == "url" : params["doc_id"] = doc_id params["doc_name"] = doc_name params["doc_type"] = doc_type params["url"] = url if meta is not None: params["meta"] = meta elif add_type == "lark" : params["doc_type"] = doc_type params["lark_file"] = lark_file if doc_id is not None: params["doc_id"] = doc_id if meta is not None: params["meta"] = meta self.viking_knowledgebase_service.json_exception("AddDoc", {}, json.dumps(params), headers=headers) async def async_add_doc(self, add_type, doc_id=None, doc_name=None, doc_type=None, description=None, tos_path=None, url=None, lark_file=None, meta=None, dedup=None, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "add_type": add_type, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name if description is not None: params["description"] = description if dedup is not None: params["dedup"] = dedup if add_type == "tos" : params["tos_path"] = tos_path elif add_type == "url" : params["doc_id"] = doc_id params["doc_name"] = doc_name params["doc_type"] = doc_type params["url"] = url if meta is not None: params["meta"] = meta elif add_type == "lark" : params["doc_type"] = doc_type params["lark_file"] = lark_file if doc_id is not None: params["doc_id"] = doc_id if meta is not None: params["meta"] = meta await self.viking_knowledgebase_service.async_json_exception("AddDoc", {}, json.dumps(params), headers=headers) def delete_doc(self, doc_id, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name self.viking_knowledgebase_service.json_exception("DeleteDoc", {}, json.dumps(params), headers=headers) async def async_delete_doc(self, doc_id, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name await self.viking_knowledgebase_service.async_json_exception("DeleteDoc", {}, json.dumps(params), headers=headers) def get_doc(self, doc_id, return_token_usage=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name if return_token_usage: params["return_token_usage"] = return_token_usage res = self.viking_knowledgebase_service.json_exception("GetDocInfo", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] data['project'] = project if resource_id is not None : data['resource_id'] = resource_id return Doc(data) async def async_get_doc(self, doc_id, return_token_usage=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "project":project} if resource_id is not None: params["resource_id"] = resource_id if collection_name is not None: params["collection_name"] = collection_name if return_token_usage: params["return_token_usage"] = return_token_usage res = await self.viking_knowledgebase_service.async_json_exception("GetDocInfo", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] data['project'] = project if resource_id is not None : data['resource_id'] = resource_id return Doc(data) def list_docs(self, offset=0, limit=-1, doc_type=None, return_token_usage=False, project="default", collection_name=None, filter=None, headers=None): params = {"collection_name": self.collection_name, "offset": offset, "limit": limit, "doc_type": doc_type, "project":project, "filter": filter} if collection_name is not None: params["collection_name"] = collection_name if return_token_usage: params["return_token_usage"] = return_token_usage res = self.viking_knowledgebase_service.json_exception("ListDocs", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] docs = [] for item in data["doc_list"]: item['project'] = project docs.append(Doc(item)) return docs async def async_list_docs(self, offset=0, limit=-1, doc_type=None, return_token_usage=False, project="default", collection_name=None, filter=None, headers=None): params = {"collection_name": self.collection_name, "offset": offset, "limit": limit, "doc_type": doc_type, "project":project, "filter": filter} if collection_name is not None: params["collection_name"] = collection_name if return_token_usage: params["return_token_usage"] = return_token_usage res = await self.viking_knowledgebase_service.async_json_exception("ListDocs", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] docs = [] for item in data["doc_list"]: item['project'] = project docs.append(Doc(item)) return docs def update_meta(self, doc_id, meta, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "meta": meta, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id self.viking_knowledgebase_service.json_exception("UpdateDocMeta", {}, json.dumps(params), headers=headers) async def async_update_meta(self, doc_id, meta, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "doc_id": doc_id, "meta": meta, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id await self.viking_knowledgebase_service.async_json_exception("UpdateDocMeta", {}, json.dumps(params), headers=headers) def update_doc(self, doc_id, doc_name, project="default", resource_id=None, collection_name=None, headers=None): params= {"collection_name": self.collection_name, "doc_id": doc_id, "doc_name": doc_name, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id return self.viking_knowledgebase_service.json_exception("UpdateDoc", {}, json.dumps(params), headers=headers) async def async_update_doc(self, doc_id, doc_name, project="default", resource_id=None, collection_name=None, headers=None): params= {"collection_name": self.collection_name, "doc_id": doc_id, "doc_name": doc_name, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id return await self.viking_knowledgebase_service.async_json_exception("UpdateDoc", {}, json.dumps(params), headers=headers) def get_point(self, point_id, get_attachment_link=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if get_attachment_link: params["get_attachment_link"] = get_attachment_link res = self.viking_knowledgebase_service.json_exception("GetPointInfo", {}, json.dumps(params), headers=headers) res = json.loads(res) res["data"]["project"] = project if resource_id is not None : res["data"]["resource_id"] = resource_id return Point(res["data"]) async def async_get_point(self, point_id, get_attachment_link=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if get_attachment_link: params["get_attachment_link"] = get_attachment_link res = await self.viking_knowledgebase_service.async_json_exception("GetPointInfo", {}, json.dumps(params), headers=headers) res = json.loads(res) res["data"]["project"] = project if resource_id is not None : res["data"]["resource_id"] = resource_id return Point(res["data"]) def list_points(self, offset=0, limit=-1, doc_ids=None, point_ids=None, get_attachment_link=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "offset": offset, "limit": limit, "doc_ids": doc_ids, "project":project, "get_attachment_link": get_attachment_link} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if point_ids is not None: params["point_ids"] = point_ids res = self.viking_knowledgebase_service.json_exception("ListPoints", {}, json.dumps(params), headers=headers) point_list = json.loads(res)["data"].get("point_list", []) points = [] for item in point_list: item["project"] = project points.append(Point(item)) return points async def async_list_points(self, offset=0, limit=-1, doc_ids=None, point_ids=None, get_attachment_link=False, project="default", resource_id=None, collection_name=None, headers=None): params = {"collection_name": self.collection_name, "offset": offset, "limit": limit, "doc_ids": doc_ids, "project":project, "get_attachment_link": get_attachment_link} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if point_ids is not None: params["point_ids"] = point_ids res = await self.viking_knowledgebase_service.async_json_exception("ListPoints", {}, json.dumps(params), headers=headers) point_list = json.loads(res)["data"].get("point_list", []) points = [] for item in point_list: item["project"] = project points.append(Point(item)) return points def add_point(self, doc_id, chunk_type, project="default", resource_id=None, collection_name=None, chunk_title=None, content=None, question=None, fields=None, headers=None): params= {"collection_name": self.collection_name, "doc_id": doc_id, "project":project, "chunk_type": chunk_type} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if chunk_title is not None: params["chunk_title"] = chunk_title if content is not None: params["content"] = content if question is not None: params["question"] = question if fields is not None: params["fields"] = fields return self.viking_knowledgebase_service.json_exception("AddPoint", {}, json.dumps(params), headers=headers) async def async_add_point(self, doc_id, chunk_type, project="default", resource_id=None, collection_name=None, chunk_title=None, content=None, question=None, fields=None, headers=None): params= {"collection_name": self.collection_name, "doc_id": doc_id, "project":project, "chunk_type": chunk_type} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if chunk_title is not None: params["chunk_title"] = chunk_title if content is not None: params["content"] = content if question is not None: params["question"] = question if fields is not None: params["fields"] = fields return await self.viking_knowledgebase_service.async_json_exception("AddPoint", {}, json.dumps(params), headers=headers) def update_point(self, point_id, project="default", resource_id=None, collection_name=None, chunk_title=None, content=None, question=None, fields=None, headers=None): params= {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if chunk_title is not None: params["chunk_title"] = chunk_title if content is not None: params["content"] = content if question is not None: params["question"] = question if fields is not None: params["fields"] = fields return self.viking_knowledgebase_service.json_exception("UpdatePoint", {}, json.dumps(params), headers=headers) async def async_update_point(self, point_id, project="default", resource_id=None, collection_name=None, chunk_title=None, content=None, question=None, fields=None, headers=None): params= {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id if chunk_title is not None: params["chunk_title"] = chunk_title if content is not None: params["content"] = content if question is not None: params["question"] = question if fields is not None: params["fields"] = fields return await self.viking_knowledgebase_service.async_json_exception("UpdatePoint", {}, json.dumps(params), headers=headers) def delete_point(self, point_id, project="default", resource_id=None, collection_name=None, headers=None): params= {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id return self.viking_knowledgebase_service.json_exception("DeletePoint", {}, json.dumps(params), headers=headers) async def async_delete_point(self, point_id, project="default", resource_id=None, collection_name=None, headers=None): params= {"collection_name": self.collection_name, "point_id": point_id, "project":project} if collection_name is not None: params["collection_name"] = collection_name if resource_id is not None: params["resource_id"] = resource_id return await self.viking_knowledgebase_service.async_json_exception("DeletePoint", {}, json.dumps(params), headers=headers) ================================================ FILE: volcengine/viking_knowledgebase/Doc.py ================================================ from .common import Field import json class Doc(object): """ KnowledgeBase Doc data wrapper """ def __init__(self, kwargs): self.collection_name = kwargs.get("collection_name") self.doc_name = kwargs.get("doc_name") self.doc_id = kwargs.get("doc_id") self.doc_type = kwargs.get("doc_type") self.create_time = kwargs.get("create_time") self.added_by = kwargs.get("added_by") self.update_time = kwargs.get("update_time") self.url = kwargs.get("url") self.tos_path = kwargs.get("tos_path") self.point_num = kwargs.get("point_num") self.status = kwargs.get("status") self.title = kwargs.get("title") self.source = kwargs.get("source") self.total_tokens = kwargs.get("total_tokens") self.doc_summary_tokens = kwargs.get("doc_summary_tokens") self.fields = [] meta = kwargs.get("doc_meta") or kwargs.get("meta") if meta is not None: meta = json.loads(meta) self.fields = [Field(field) for field in meta] self.project = kwargs.get("project", "default") self.resource_id = kwargs.get("resource_id") self.raw_data = kwargs ================================================ FILE: volcengine/viking_knowledgebase/Point.py ================================================ from .Doc import Doc class Point(object): """ Knowledge Point data wrapper """ def __init__(self, kwargs): self.collection_name = kwargs.get("collection_name") self.point_id = kwargs.get("point_id") self.chunk_title = kwargs.get("chunk_title") self.original_question = kwargs.get("original_question") self.process_time = kwargs.get("process_time") self.content = kwargs.get("content") self.rerank_score = kwargs.get("rerank_score") self.score = kwargs.get("score") self.doc_info = Doc(kwargs.get("doc_info")) self.chunk_id = kwargs.get("chunk_id") self.chunk_attachment = kwargs.get("chunk_attachment") self.project = kwargs.get("project", "default") self.resource_id = kwargs.get("resource_id") self.table_chunk_fields = kwargs.get("table_chunk_fields") self.raw_data = kwargs @property def doc_id(self): # The 'doc_id' property is deprecated. Use 'doc_info.doc_id' instead. return self.doc_info.doc_id ================================================ FILE: volcengine/viking_knowledgebase/RespIter.py ================================================ import json from typing import Any, Dict, Generator class RespIter: def __init__(self, generator: Generator[Dict[str, Any], None, None]): self.generator = generator self.usage = {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0, "prompt_tokens_details": {"cached_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 0}} def __iter__(self): return self._wrapped_generator() def _wrapped_generator(self): for part in self.generator: usage =part.get("usage") if not (usage == "" or usage == None): self.usage = json.loads(usage) yield part['generated_answer'] def token_usage(self): return self.usage ================================================ FILE: volcengine/viking_knowledgebase/VikingKnowledgeBaseService.py ================================================ # coding:utf-8 import json import os import threading import aiohttp from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.auth.SignerV4 import SignerV4 from volcengine.base.Service import Service from .Collection import Collection from .Point import Point from .RespIter import RespIter from .common import EnumEncoder, CollectionVersion from .exception import ERRCODE_EXCEPTION, VikingKnowledgeBaseException def _get_common_viking_request_header(): common_header = {'Accept': 'application/json', 'Content-Type': 'application/json'} debug_mode = os.getenv("VOLC_VIKING_DEBUG", None) if debug_mode and debug_mode == "1": common_header["X-Viking-Debug"] = "1" return common_header class VikingKnowledgeBaseService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VikingKnowledgeBaseService, "_instance"): with VikingKnowledgeBaseService._instance_lock: if not hasattr(VikingKnowledgeBaseService, "_instance"): VikingKnowledgeBaseService._instance = object.__new__(cls) return VikingKnowledgeBaseService._instance def __init__(self, host="api-knowledgebase.mlp.cn-beijing.volces.com", region="cn-beijing", ak="", sk="", sts_token="", scheme='http', connection_timeout=30, socket_timeout=30): self.service_info = VikingKnowledgeBaseService.get_service_info(host, region, scheme, connection_timeout, socket_timeout) self.api_info = VikingKnowledgeBaseService.get_api_info() super(VikingKnowledgeBaseService, self).__init__(self.service_info, self.api_info) if ak: self.set_ak(ak) if sk: self.set_sk(sk) if sts_token: self.set_session_token(session_token=sts_token) try: self.get_body("Ping", {}, json.dumps({})) except Exception as e: raise VikingKnowledgeBaseException(1000028, "missed", "host or region is incorrect: {}".format(str(e))) from None def setHeader(self, header): api_info = VikingKnowledgeBaseService.get_api_info() for key in api_info: for item in header: api_info[key].header[item] = header[item] self.api_info = api_info @staticmethod def get_service_info(host, region, scheme, connection_timeout, socket_timeout): service_info = ServiceInfo(host, {"Host": host}, Credentials('', '', 'air', region), connection_timeout, socket_timeout, scheme=scheme) return service_info @staticmethod def get_api_info(): api_info = { # Collection "CreateCollection": ApiInfo("POST", "/api/knowledge/collection/create", {}, {}, _get_common_viking_request_header()), "GetCollection": ApiInfo("POST", "/api/knowledge/collection/info", {}, {}, _get_common_viking_request_header()), "DropCollection": ApiInfo("POST", "/api/knowledge/collection/delete", {}, {}, _get_common_viking_request_header()), "ListCollections": ApiInfo("POST", "/api/knowledge/collection/list", {}, {}, _get_common_viking_request_header()), "UpdateCollection": ApiInfo("POST", "/api/knowledge/collection/update", {}, {}, _get_common_viking_request_header()), "SearchCollection": ApiInfo("POST", "/api/knowledge/collection/search", {}, {}, _get_common_viking_request_header()), "SearchAndGenerate": ApiInfo("POST", "/api/knowledge/collection/search_and_generate", {}, {}, _get_common_viking_request_header()), "SearchKnowledge": ApiInfo("POST", "/api/knowledge/collection/search_knowledge", {}, {}, _get_common_viking_request_header()), # Doc "AddDoc": ApiInfo("POST", "/api/knowledge/doc/add", {}, {}, _get_common_viking_request_header()), "DeleteDoc": ApiInfo("POST", "/api/knowledge/doc/delete", {}, {}, _get_common_viking_request_header()), "GetDocInfo": ApiInfo("POST", "/api/knowledge/doc/info", {}, {}, _get_common_viking_request_header()), "ListDocs": ApiInfo("POST", "/api/knowledge/doc/list", {}, {}, _get_common_viking_request_header()), "UpdateDocMeta": ApiInfo("POST", "/api/knowledge/doc/update_meta", {}, {}, _get_common_viking_request_header()), "UpdateDoc": ApiInfo("POST", "/api/knowledge/doc/update", {}, {}, _get_common_viking_request_header()), # Point "GetPointInfo": ApiInfo("POST", "/api/knowledge/point/info", {}, {}, _get_common_viking_request_header()), "ListPoints": ApiInfo("POST", "/api/knowledge/point/list", {}, {}, _get_common_viking_request_header()), "AddPoint": ApiInfo("POST", "/api/knowledge/point/add", {}, {}, _get_common_viking_request_header()), "UpdatePoint": ApiInfo("POST", "/api/knowledge/point/update", {}, {}, _get_common_viking_request_header()), "DeletePoint": ApiInfo("POST", "/api/knowledge/point/delete", {}, {}, _get_common_viking_request_header()), # Service "Ping": ApiInfo("GET", "/ping", {}, {}, _get_common_viking_request_header()), "Rerank": ApiInfo("POST", "/api/knowledge/service/rerank", {}, {}, _get_common_viking_request_header()), # Chat "ChatCompletion": ApiInfo("POST", "/api/knowledge/chat/completions", {}, {}, _get_common_viking_request_header()), } return api_info def get_body(self, api, params, body): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) r.headers['Content-Type'] = 'application/json' r.body = body SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.get(url, headers=r.headers, data=r.body, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return json.dumps(resp.json()) else: raise Exception(resp.text.encode("utf-8")) async def async_json(self, api, params, body, headers=None): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) if headers: for key in headers: r.headers[key] = headers[key] r.headers['Content-Type'] = 'application/json' debug_mode = os.getenv("VOLC_VIKING_DEBUG", None) if debug_mode and debug_mode == "1": r.headers["X-Viking-Debug"] = "1" r.body = body SignerV4.sign(r, self.service_info.credentials) timeout = aiohttp.ClientTimeout(connect=self.service_info.connection_timeout, sock_connect=self.service_info.socket_timeout) url = r.build() async with aiohttp.request("POST", url, headers=r.headers, data=r.body, timeout=timeout) as r: resp = await r.text(encoding="utf-8") if r.status == 200: return resp else: raise Exception(resp) def get_body_exception(self, api, params, body): try: res = self.get_body(api, params, body) except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingKnowledgeBaseException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingKnowledgeBaseException)(code, request_id, message) from None if res == '': raise VikingKnowledgeBaseException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res def get_exception(self, api, params): try: res = self.get(api, params) except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingKnowledgeBaseException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingKnowledgeBaseException)(code, request_id, message) from None if res == '': raise VikingKnowledgeBaseException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res def json(self, api, params, body): return self._json(api, params, body, headers=None) def json_exception(self, api, params, body, headers=None): try: res = self._json(api, params, body, headers=headers) except Exception as e: try: err_msg = e.args[0].decode("utf-8") if isinstance(e.args[0], bytes) else str(e.args[0]) res_json = json.loads(err_msg) except: raise VikingKnowledgeBaseException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingKnowledgeBaseException)(code, request_id, message) from None if res == '': raise VikingKnowledgeBaseException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res def _stream_json_exception(self, api, params, body, headers=None): try: res_stream = self._stream_json(api, params, body, headers=headers) for res in res_stream: yield res except Exception as e: try: res_json = json.loads(e.args[0].decode("utf-8")) except: raise VikingKnowledgeBaseException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingKnowledgeBaseException)(code, request_id, message) from None if res == '': raise VikingKnowledgeBaseException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res def _stream_json(self, api, params, body, headers=None): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) if headers: for key in headers: r.headers[key] = headers[key] r.headers['Content-Type'] = 'application/json' r.headers['Accept'] = 'text/event-stream' r.body = body SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.post(url, headers=r.headers, data=r.body, stream=True, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: for line in resp.iter_lines(): decode_line = line.decode('utf-8') if decode_line == "": continue data_str = decode_line.split("data:")[1] data_dict = json.loads(data_str) yield json.dumps(data_dict) if 'end' in data_dict['data']: break else: raise Exception(resp.text.encode("utf-8")) def _json(self, api, params, body, headers=None): if not (api in self.api_info): raise Exception("no such api") api_info = self.api_info[api] r = self.prepare_request(api_info, params) if headers: for key in headers: r.headers[key] = headers[key] r.headers['Content-Type'] = 'application/json' r.body = body debug_mode = os.getenv("VOLC_VIKING_DEBUG", None) if debug_mode and debug_mode == "1": r.headers["X-Viking-Debug"] = "1" SignerV4.sign(r, self.service_info.credentials) url = r.build() resp = self.session.post(url, headers=r.headers, data=r.body, timeout=(self.service_info.connection_timeout, self.service_info.socket_timeout)) if resp.status_code == 200: return json.dumps(resp.json()) else: raise Exception(resp.text.encode("utf-8")) async def async_json_exception(self, api, params, body, headers=None): try: res = await self.async_json(api, params, body, headers=headers) except Exception as e: try: err_msg = e.args[0].decode("utf-8") if isinstance(e.args[0], bytes) else str(e.args[0]) res_json = json.loads(err_msg) except: raise VikingKnowledgeBaseException(1000028, "missed", "json load res error, res:{}".format(str(e))) from None code = res_json.get("code", 1000028) request_id = res_json.get("request_id", 1000028) message = res_json.get("message", None) raise ERRCODE_EXCEPTION.get(code, VikingKnowledgeBaseException)(code, request_id, message) from None if res == '': raise VikingKnowledgeBaseException(1000028, "missed", "empty response due to unknown error, please contact customer service") from None return res def create_collection(self, collection_name, version:CollectionVersion.UltimateVersion, index=None, description="", preprocessing=None, project="default", data_type="unstructured_data", table_config=None, doc_summary_config=None, headers=None): params = {"name": collection_name, "description": description, "project": project, "version": version} if doc_summary_config is not None: params["doc_summary_config"] = doc_summary_config if preprocessing is not None: params["preprocessing"] = preprocessing if version == CollectionVersion.UltimateVersion: params["data_type"] = data_type if index is not None: params["index"] = index if table_config is not None: params["table_config"] = table_config elif version == CollectionVersion.StandardVersion: pass res = self.json_exception("CreateCollection", {}, json.dumps(params, cls=EnumEncoder), headers=headers) data = json.loads(res)["data"] params["resource_id"] = data["resource_id"] if index is not None and index.get("index_config") is not None: fields = index["index_config"].get("fields") if fields is not None: assert isinstance(fields, list) params["fields"] = fields return Collection(self, collection_name, params) async def async_create_collection(self, collection_name, version:CollectionVersion.UltimateVersion, index=None, description="", preprocessing=None, project="default", data_type="unstructured_data", table_config=None, doc_summary_config=None, headers=None): params = {"name": collection_name, "description": description, "project": project, "version": version} if doc_summary_config is not None: params["doc_summary_config"] = doc_summary_config if preprocessing is not None: params["preprocessing"] = preprocessing if version == CollectionVersion.UltimateVersion: params["data_type"] = data_type if index is not None: params["index"] = index if table_config is not None: params["table_config"] = table_config elif version == CollectionVersion.StandardVersion: pass res = await self.async_json_exception("CreateCollection", {}, json.dumps(params, cls=EnumEncoder), headers=headers) data = json.loads(res)["data"] params["resource_id"] = data["resource_id"] if index is not None and index.get("index_config") is not None: fields = index["index_config"]["fields"] assert isinstance(fields, list) params["fields"] = fields return Collection(self, collection_name, params) def get_collection(self, collection_name, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id res = self.json_exception("GetCollection", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] now_index_list = data["pipeline_list"][0]["index_list"][0] fields = now_index_list["index_config"]["fields"] data["fields"] = fields return Collection(self, collection_name, data) async def async_get_collection(self, collection_name, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id res = await self.async_json_exception("GetCollection", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] now_index_list = data["pipeline_list"][0]["index_list"][0] fields = now_index_list["index_config"]["fields"] data["fields"] = fields return Collection(self, collection_name, data) def drop_collection(self, collection_name, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id self.json_exception("DropCollection", {}, json.dumps(params), headers=headers) async def async_drop_collection(self, collection_name, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id await self.async_json_exception("DropCollection", {}, json.dumps(params), headers=headers) def list_collections(self, project=None, brief=False, headers=None): params = {"brief": brief} if project is not None: params["project"] = project res = self.json_exception("ListCollections", {}, json.dumps(params), headers=headers) collection_list = json.loads(res)["data"]["collection_list"] collections = [] for collection in collection_list: now_index_list = collection["pipeline_list"][0]["index_list"][0] fields = now_index_list["index_config"]["fields"] collection["fields"] = fields collections.append(Collection(self, collection["collection_name"], collection)) return collections async def async_list_collections(self, project=None, brief=False, headers=None): params = {"brief": brief} if project is not None: params["project"] = project res = await self.async_json_exception("ListCollections", {}, json.dumps(params), headers=headers) collection_list = json.loads(res)["data"]["collection_list"] collections = [] for collection in collection_list: now_index_list = collection["pipeline_list"][0]["index_list"][0] fields = now_index_list["index_config"]["fields"] collection["fields"] = fields collections.append(Collection(self, collection["collection_name"], collection)) return collections def update_collection(self, collection_name, description=None, cpu_quota=None, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id if description != None: params["description"] = description if cpu_quota != None: params["cpu_quota"] = cpu_quota self.json_exception("UpdateCollection", {}, json.dumps(params), headers=headers) async def async_update_collection(self, collection_name, description=None, cpu_quota=None, project="default", resource_id=None, headers=None): params = {"name": collection_name, "project": project} if resource_id != None: params["resource_id"] = resource_id if description != None: params["description"] = description if cpu_quota != None: params["cpu_quota"] = cpu_quota await self.async_json_exception("UpdateCollection", {}, json.dumps(params), headers=headers) def search_collection(self, collection_name, query, query_param=None, limit=10, dense_weight=0.5, rerank_switch=False, project="default", resource_id=None, retrieve_count=None, endpoint_id=None, rerank_model="Doubao-pro-4k-rerank", rerank_only_chunk=False, headers=None): params = {"name": collection_name, "query": query, "limit": limit, "dense_weight": dense_weight, "rerank_switch": rerank_switch, "project": project, "rerank_model": rerank_model, "rerank_only_chunk": rerank_only_chunk, } if resource_id != None: params["resource_id"] = resource_id if query_param != None: params["query_param"] = query_param if retrieve_count != None: params["retrieve_count"] = retrieve_count if endpoint_id != None: params["endpoint_id"] = endpoint_id res = self.json_exception("SearchCollection", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] results = data.get("result_list") points = [] if results is not None: for result in results: result['collection_name'] = collection_name result['project'] = project if resource_id is not None: result['resource_id'] = resource_id points.append(Point(result)) return points async def async_search_collection(self, collection_name, query, query_param=None, limit=10, dense_weight=0.5, rerank_switch=False, project="default", resource_id=None, retrieve_count=None, endpoint_id=None, rerank_model="Doubao-pro-4k-rerank", rerank_only_chunk=False, headers=None): params = {"name": collection_name, "query": query, "limit": limit, "dense_weight": dense_weight, "rerank_switch": rerank_switch, "project": project, "rerank_model": rerank_model, "rerank_only_chunk": rerank_only_chunk, } if resource_id != None: params["resource_id"] = resource_id if query_param != None: params["query_param"] = query_param if retrieve_count != None: params["retrieve_count"] = retrieve_count if endpoint_id != None: params["endpoint_id"] = endpoint_id res = await self.async_json_exception("SearchCollection", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] results = data.get("result_list") points = [] if results is not None: for result in results: result['collection_name'] = collection_name result['project'] = project if resource_id is not None: result['resource_id'] = resource_id points.append(Point(result)) return points def search_and_generate(self, collection_name, query, query_param=None, retrieve_param=None, llm_param=None, project="default", resource_id=None, headers=None): params = {"name": collection_name, "query": query, "project": project } if resource_id != None: params["resource_id"] = resource_id if query_param != None: params["query_param"] = query_param if retrieve_param != None: params["retrieve_param"] = retrieve_param if llm_param != None: params["llm_param"] = llm_param res = self.json_exception("SearchAndGenerate", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] results = data.get("result_list") points = [] if results is not None: for result in results: result['collection_name'] = collection_name points.append(Point(result)) ret = { "collection_name": data.get("collection_name"), "count": data.get("count"), "generated_answer": data.get("generated_answer"), "prompt": data.get("prompt"), "usage": data.get("usage"), "refs": points } return ret async def async_search_and_generate(self, collection_name, query, query_param=None, retrieve_param=None, llm_param=None, project="default", resource_id=None, headers=None): params = {"name": collection_name, "query": query, "project": project } if resource_id != None: params["resource_id"] = resource_id if query_param != None: params["query_param"] = query_param if retrieve_param != None: params["retrieve_param"] = retrieve_param if llm_param != None: params["llm_param"] = llm_param res = await self.async_json_exception("SearchAndGenerate", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] results = data.get("result_list") points = [] if results is not None: for result in results: result['collection_name'] = collection_name points.append(Point(result)) ret = { "collection_name": data.get("collection_name"), "count": data.get("count"), "generated_answer": data.get("generated_answer"), "prompt": data.get("prompt"), "usage": data.get("usage"), "refs": points } return ret def rerank(self, datas, rerank_model="Doubao-pro-4k-rerank", endpoint_id=None, headers=None): params = { "datas": datas, "rerank_model": rerank_model } if endpoint_id != None: params["endpoint_id"] = endpoint_id res = self.json_exception("Rerank", {}, json.dumps(params), headers=headers) return json.loads(res) async def async_rerank(self, datas, rerank_model="Doubao-pro-4k-rerank", endpoint_id=None, headers=None): params = { "datas": datas, "rerank_model": rerank_model } if endpoint_id != None: params["endpoint_id"] = endpoint_id res = await self.async_json_exception("Rerank", {}, json.dumps(params), headers=headers) return json.loads(res) def search_knowledge(self, collection_name, query, image_query=None, pre_processing=None, query_param=None, limit=10, dense_weight=0.5, post_processing=None, project="default", resource_id=None, headers=None): params = { "name": collection_name, "query": query, "project": project, "limit": limit, "dense_weight": dense_weight, } if resource_id is not None: params["resource_id"] = resource_id if image_query is not None: params["image_query"] = image_query if query_param is not None: params["query_param"] = query_param if post_processing is not None: params["post_processing"] = post_processing if pre_processing is not None: params["pre_processing"] = pre_processing res = self.json_exception("SearchKnowledge", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] ret = { "rewrite_query": data.get("rewrite_query"), "result_list": data.get("result_list") } return ret async def async_search_knowledge(self, collection_name, query, image_query=None, pre_processing=None, query_param=None, limit=10, dense_weight=0.5, post_processing=None, project="default", resource_id=None, headers=None): params = { "name": collection_name, "query": query, "project": project, "limit": limit, "dense_weight": dense_weight, } if resource_id is not None: params["resource_id"] = resource_id if image_query is not None: params["image_query"] = image_query if query_param is not None: params["query_param"] = query_param if post_processing is not None: params["post_processing"] = post_processing if pre_processing is not None: params["pre_processing"] = pre_processing res = await self.async_json_exception("SearchKnowledge", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] ret = { "rewrite_query": data.get("rewrite_query"), "result_list": data.get("result_list") } return ret def chat_completion(self, model, messages, model_version=None, thinking=None, max_tokens=4096, temperature=0.1, return_token_usage=True, api_key=None, stream=False, headers=None): params = { "model": model, "messages": messages, "return_token_usage": return_token_usage, "max_tokens": max_tokens, "temperature": temperature } if model_version is not None: params["model_version"] = model_version if thinking is not None: params["thinking"] = thinking if api_key is not None: params["api_key"] = api_key if stream: params['stream'] = True res_stream = self._stream_json_exception("ChatCompletion", {}, json.dumps(params), headers=headers) return RespIter(self._generate_responses(res_stream)) else: res = self.json_exception("ChatCompletion", {}, json.dumps(params), headers) data = json.loads(res)["data"] ret = { "generated_answer": data.get("generated_answer"), "usage": data.get("usage") } return ret async def async_chat_completion(self, model, messages, model_version=None, thinking=None, max_tokens=4096, temperature=0.1, return_token_usage=True, api_key=None, headers=None): params = { "model": model, "messages": messages, "return_token_usage": return_token_usage, "max_tokens": max_tokens, "temperature": temperature } if model_version is not None: params["model_version"] = model_version if thinking is not None: params["thinking"] = thinking if api_key is not None: params["api_key"] = api_key res = await self.async_json_exception("ChatCompletion", {}, json.dumps(params), headers=headers) data = json.loads(res)["data"] ret = { "generated_answer": data.get("generated_answer"), "usage": data.get("usage") } return ret def _generate_responses(self, res_stream): for res in res_stream: data = json.loads(res)["data"] yield { "generated_answer": data.get("generated_answer"), "usage": data.get("usage") } ================================================ FILE: volcengine/viking_knowledgebase/__init__.py ================================================ from .VikingKnowledgeBaseService import VikingKnowledgeBaseService from .Collection import Collection from .Doc import Doc from .Point import Point from .common import * ================================================ FILE: volcengine/viking_knowledgebase/common.py ================================================ # coding:utf-8 import json from enum import Enum class FieldType(Enum): Int64 = "int64" List_Int64 = "list" String = "string" List_String = "list" Float32 = "float32" Bool = "bool" class EmbddingModelType(Enum): EmbeddingModelBgeLargeZhAndM3 = "bge-large-zh-and-m3" EmbeddingModelBgeLargeZh = "bge-large-zh" EmbeddingModelBgeM3 = "bge-m3" EmbeddingModelDoubao = "doubao-embedding" EmbeddingModelDoubaoAndM3 = "doubao-embedding-and-m3" EmbeddingModelDoubaoLarge = "doubao-embedding-large" EmbeddingModelDoubaoLargeAndM3 = "doubao-embedding-large-and-m3" class IndexType(Enum): FLAT = "flat" HNSW = "hnsw" HNSW_HYBRID = "hnsw_hybrid" class QuantType(Enum): Float = "float" Int8 = "int8" Fix16 = "fix16" class Field(object): def __init__(self, kwargs): self._field_name = kwargs.get("field_name") self._field_type = kwargs.get("field_type") self._field_val = kwargs.get("default_val") if kwargs.get("default_val") \ is not None else kwargs.get("field_value") self._dim = kwargs.get("dim", 1) self._is_primary_key = kwargs.get("is_primary_key", False) self._pipeline_name = kwargs.get("pipeline_name") @property def field_name(self): return self._field_name @property def field_type(self): return self._field_type @property def field_val(self): return self._field_val @property def dim(self): return self._dim @property def is_primary_key(self): return self._is_primary_key @property def pipeline_name(self): return self._pipeline_name class EnumEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, Enum): return obj.value if isinstance(obj, dict): return {k: self.default(v) for k, v in obj.items()} return super().default(obj) class CollectionVersion(object): UltimateVersion = 4 StandardVersion = 2 ================================================ FILE: volcengine/viking_knowledgebase/exception.py ================================================ # coding:utf-8 class VikingKnowledgeBaseServerException(Exception): def __init__(self, code, request_id, message=None): self.code = code self.request_id = request_id self.message = "{}, code:{},request_id:{}".format(message, self.code, self.request_id) def __str__(self): return self.message class UnauthorizedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class NoPermissionException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidRequestException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CollectionExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CollectionNotExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class OperationNotAllowedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexNotExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class QueryOpFailedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DataNotFoundException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DelOpFailedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class UpsertOpFailedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class TokenMismatchException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidQueryVecException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidPrimaryKeyException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidPartitionException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidScalarCondException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class InvalidProxyServiceException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexRecallException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexFetchDataException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class IndexNotReadyException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class APINotImplementedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class CalcEmbeddingFailedException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class ListEmbeddingModelsException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class VikingKnowledgeBaseException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): self.code = code self.request_id = request_id if message is not None: self.message = message else: self.message = "unknown error, please contact customer service, request_id:{}".format(self.request_id) def __str__(self): return self.message class QuotaLimiterException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class RerankException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DocNotExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class DocIsFullException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) class PointNotExistException(VikingKnowledgeBaseServerException): def __init__(self, code, request_id, message=None): super().__init__(code, request_id, message) ERRCODE_EXCEPTION = { 1000001: UnauthorizedException, 1000002: NoPermissionException, 1000003: InvalidRequestException, 1000004: CollectionExistException, 1000005: CollectionNotExistException, 1000006: OperationNotAllowedException, 1000007: IndexExistException, 1000008: IndexNotExistException, 1000010: QueryOpFailedException, 1000011: DataNotFoundException, 1000013: DelOpFailedException, 1000014: UpsertOpFailedException, 1000015: TokenMismatchException, 1000016: InvalidQueryVecException, 1000017: InvalidPrimaryKeyException, 1000018: InvalidPartitionException, 1000019: InvalidScalarCondException, 1000020: InvalidProxyServiceException, 1000021: IndexRecallException, 1000022: IndexFetchDataException, 1000023: IndexNotReadyException, 1000024: APINotImplementedException, 1000025: CalcEmbeddingFailedException, 1000026: ListEmbeddingModelsException, 1000028: VikingKnowledgeBaseException, 1000029: QuotaLimiterException, 1000030: RerankException, 1001001: DocNotExistException, 1001010: DocIsFullException, 1002001: PointNotExistException, } ================================================ FILE: volcengine/visual/README.md ================================================ ## Example 调用代码示例均在`volcengine/example/visual`文件夹下,以下为银行卡OCR调用示例 ```python # coding:utf-8 from __future__ import print_function from volc.visual.VisualService import VisualService if __name__ == '__main__': visual_service = VisualService() # call below method if you dont set ak and sk in $HOME/.volc/config visual_service.set_ak('ak') visual_service.set_sk('sk') # visual_service.set_host('host') params = dict() form = { "image_base64": "image_base64_str" } resp = visual_service.bank_card(form) print(resp) ``` 运行代码方式,在根目录下执行 ```bash python volcengine/example/visual/example_bank_card.py ``` ## 接口文档 文档链接请点击[这里](https://www.volcengine.cn/docs) 并在【视觉智能】列表查看 ================================================ FILE: volcengine/visual/VisualService.py ================================================ # coding:utf-8 import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo class VisualService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VisualService, "_instance"): with VisualService._instance_lock: if not hasattr(VisualService, "_instance"): VisualService._instance = object.__new__(cls) return VisualService._instance def __init__(self): self.service_info = VisualService.get_service_info() self.api_info = VisualService.get_api_info() super(VisualService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(): service_info = ServiceInfo("visual.volcengineapi.com", {}, Credentials('', '', 'cv', 'cn-north-1'), 30, 30) return service_info @staticmethod def get_api_info(): api_info = { "JPCartoonCut": ApiInfo("POST", "/", {"Action": "JPCartoonCut", "Version": "2020-08-26"}, {}, {}), "JPCartoon": ApiInfo("POST", "/", {"Action": "JPCartoon", "Version": "2020-08-26"}, {}, {}), "IDCard": ApiInfo("POST", "/", {"Action": "IDCard", "Version": "2020-08-26"}, {}, {}), "FaceSwap": ApiInfo("POST", "/", {"Action": "FaceSwap", "Version": "2020-08-26"}, {}, {}), "OCRNormal": ApiInfo("POST", "/", {"Action": "OCRNormal", "Version": "2020-08-26"}, {}, {}), "BankCard": ApiInfo("POST", "/", {"Action": "BankCard", "Version": "2020-08-26"}, {}, {}), "HumanSegment": ApiInfo("POST", "/", {"Action": "HumanSegment", "Version": "2020-08-26"}, {}, {}), "GeneralSegment": ApiInfo("POST", "/", {"Action": "GeneralSegment", "Version": "2020-08-26"}, {}, {}), "EnhancePhoto": ApiInfo("POST", "/", {"Action": "EnhancePhoto", "Version": "2020-08-26"}, {}, {}), "ConvertPhoto": ApiInfo("POST", "/", {"Action": "ConvertPhoto", "Version": "2020-08-26"}, {}, {}), "ConvertPhotoV2": ApiInfo("POST", "/", {"Action": "ConvertPhotoV2", "Version": "2022-08-31"}, {}, {}), "VideoSceneDetect": ApiInfo("POST", "/", {"Action": "VideoSceneDetect", "Version": "2020-08-26"}, {}, {}), "OverResolution": ApiInfo("POST", "/", {"Action": "OverResolution", "Version": "2020-08-26"}, {}, {}), "GoodsSegment": ApiInfo("POST", "/", {"Action": "GoodsSegment", "Version": "2020-08-26"}, {}, {}), "ImageOutpaint": ApiInfo("POST", "/", {"Action": "ImageOutpaint", "Version": "2020-08-26"}, {}, {}), "ImageInpaint": ApiInfo("POST", "/", {"Action": "ImageInpaint", "Version": "2020-08-26"}, {}, {}), "ImageCut": ApiInfo("POST", "/", {"Action": "ImageCut", "Version": "2020-08-26"}, {}, {}), "EntityDetect": ApiInfo("POST", "/", {"Action": "EntityDetect", "Version": "2020-08-26"}, {}, {}), "GoodsDetect": ApiInfo("POST", "/", {"Action": "GoodsDetect", "Version": "2020-08-26"}, {}, {}), "VideoSummarizationSubmitTask": ApiInfo("POST", "/",{"Action": "VideoSummarizationSubmitTask", "Version": "2020-08-26"},{}, {}), "VideoSummarizationQueryTask": ApiInfo("GET", "/",{"Action": "VideoSummarizationQueryTask", "Version": "2020-08-26"},{}, {}), "VideoOverResolutionSubmitTask": ApiInfo("POST", "/", {"Action": "VideoOverResolutionSubmitTask","Version": "2020-08-26"}, {}, {}), "VideoOverResolutionQueryTask": ApiInfo("GET", "/",{"Action": "VideoOverResolutionQueryTask", "Version": "2020-08-26"},{}, {}), "VideoRetargetingSubmitTask": ApiInfo("POST", "/",{"Action": "VideoRetargetingSubmitTask", "Version": "2020-08-26"}, {},{}), "VideoRetargetingQueryTask": ApiInfo("GET", "/",{"Action": "VideoRetargetingQueryTask", "Version": "2020-08-26"}, {},{}), "VideoInpaintSubmitTask": ApiInfo("POST", "/",{"Action": "VideoInpaintSubmitTask", "Version": "2020-08-26"}, {}, {}), "VideoInpaintQueryTask": ApiInfo("GET", "/", {"Action": "VideoInpaintQueryTask", "Version": "2020-08-26"},{}, {}), "CarPlateDetection": ApiInfo("POST", "/", {"Action": "CarPlateDetection", "Version": "2020-08-26"}, {}, {}), "DistortionFree": ApiInfo("POST", "/", {"Action": "DistortionFree", "Version": "2020-08-26"}, {}, {}), "StretchRecovery": ApiInfo("POST", "/", {"Action": "StretchRecovery", "Version": "2020-08-26"}, {}, {}), "ImageFlow": ApiInfo("POST", "/", {"Action": "ImageFlow", "Version": "2020-08-26"}, {}, {}), "ImageScore": ApiInfo("POST", "/", {"Action": "ImageScore", "Version": "2020-08-26"}, {}, {}), "PoemMaterial": ApiInfo("POST", "/", {"Action": "PoemMaterial", "Version": "2020-08-26"}, {}, {}), "EmoticonEdit": ApiInfo("POST", "/", {"Action": "EmoticonEdit", "Version": "2020-08-26"}, {}, {}), "EyeClose2Open": ApiInfo("POST", "/", {"Action": "EyeClose2Open", "Version": "2020-08-26"}, {}, {}), "CarSegment": ApiInfo("POST", "/", {"Action": "CarSegment", "Version": "2020-08-26"}, {}, {}), "CarDetection": ApiInfo("POST", "/", {"Action": "CarDetection", "Version": "2020-08-26"}, {}, {}), "SkySegment": ApiInfo("POST", "/", {"Action": "SkySegment", "Version": "2020-08-26"}, {}, {}), "ImageSearchImageAdd": ApiInfo("POST", "/", {"Action": "ImageSearchImageAdd", "Version": "2020-08-26"}, {},{}), "ImageSearchImageDelete": ApiInfo("POST", "/",{"Action": "ImageSearchImageDelete", "Version": "2020-08-26"}, {}, {}), "ImageSearchImageSearch": ApiInfo("POST", "/",{"Action": "ImageSearchImageSearch", "Version": "2020-08-26"}, {}, {}), "ProductSearchAddImage": ApiInfo("POST", "/", {"Action": "ProductSearchAddImage", "Version": "2022-06-16"},{}, {}), "ProductSearchDeleteImage": ApiInfo("POST", "/",{"Action": "ProductSearchDeleteImage", "Version": "2022-06-16"}, {},{}), "ProductSearchSearchImage": ApiInfo("POST", "/",{"Action": "ProductSearchSearchImage", "Version": "2022-06-16"}, {},{}), "ClueLicense": ApiInfo("POST", "/", {"Action": "OcrClueLicense", "Version": "2020-08-26"}, {}, {}), "DrivingLicense": ApiInfo("POST", "/", {"Action": "DrivingLicense", "Version": "2020-08-26"}, {}, {}), "VehicleLicense": ApiInfo("POST", "/", {"Action": "VehicleLicense", "Version": "2020-08-26"}, {}, {}), "TaxiInvoice": ApiInfo("POST", "/", {"Action": "OcrTaxiInvoice", "Version": "2020-08-26"}, {}, {}), "TrainTicket": ApiInfo("POST", "/", {"Action": "OcrTrainTicket", "Version": "2020-08-26"}, {}, {}), "FlightInvoice": ApiInfo("POST", "/", {"Action": "OcrFlightInvoice", "Version": "2020-08-26"}, {}, {}), "VatInvoice": ApiInfo("POST", "/", {"Action": "OcrVatInvoice", "Version": "2020-08-26"}, {}, {}), "QuotaInvoice": ApiInfo("POST", "/", {"Action": "OcrQuotaInvoice", "Version": "2020-08-26"}, {}, {}), "HairStyle": ApiInfo("POST", "/", {"Action": "HairStyle", "Version": "2020-08-26"}, {}, {}), "HairStyleV2": ApiInfo("POST", "/", {"Action": "HairStyle", "Version": "2022-08-31"}, {}, {}), "FacePretty": ApiInfo("POST", "/", {"Action": "FacePretty", "Version": "2020-08-26"}, {}, {}), "ImageAnimation": ApiInfo("POST", "/", {"Action": "ImageAnimation", "Version": "2020-08-26"}, {}, {}), "CoverVideo": ApiInfo("POST", "/", {"Action": "CoverVideo", "Version": "2020-08-26"}, {}, {}), "DollyZoom": ApiInfo("POST", "/", {"Action": "DollyZoom", "Version": "2020-08-26"}, {}, {}), "Img2Video3D": ApiInfo("POST", "/", {"Action": "Img2Video3D", "Version": "2022-08-31"}, {}, {}), "PotraitEffect": ApiInfo("POST", "/", {"Action": "PotraitEffect", "Version": "2020-08-26"}, {}, {}), "ImageStyleConversion": ApiInfo("POST", "/", {"Action": "ImageStyleConversion", "Version": "2020-08-26"},{}, {}), "3DGameCartoon": ApiInfo("POST", "/", {"Action": "3DGameCartoon", "Version": "2020-08-26"}, {}, {}), "HairSegment": ApiInfo("POST", "/", {"Action": "HairSegment", "Version": "2020-08-26"}, {}, {}), "OcrSeal": ApiInfo("POST", "/", {"Action": "OcrSeal", "Version": "2021-08-23"}, {}, {}), "OcrPassInvoice": ApiInfo("POST", "/", {"Action": "OcrPassInvoice", "Version": "2021-08-23"}, {}, {}), "OCRTrade": ApiInfo("POST", "/", {"Action": "OCRTrade", "Version": "2020-12-21"}, {}, {}), "OCRRuanzhu": ApiInfo("POST", "/", {"Action": "OCRRuanzhu", "Version": "2020-12-21"}, {}, {}), "OCRCosmeticProduct": ApiInfo("POST", "/", {"Action": "OCRCosmeticProduct", "Version": "2020-12-21"}, {},{}), "OCRPdf": ApiInfo("POST", "/", {"Action": "OCRPdf", "Version": "2021-08-23"}, {}, {}), "OCRTable": ApiInfo("POST", "/", {"Action": "OCRTable", "Version": "2021-08-23"}, {}, {}), "VideoCoverSelection": ApiInfo("POST", "/", {"Action": "VideoCoverSelection", "Version": "2020-08-26"}, {},{}), "VideoHighlightExtractionSubmitTask": ApiInfo("POST", "/", {"Action": "VideoHighlightExtractionSubmitTask","Version": "2020-08-26"}, {}, {}), "VideoHighlightExtractionQueryTask": ApiInfo("GET", "/", {"Action": "VideoHighlightExtractionQueryTask","Version": "2020-08-26"}, {}, {}), "CertToken": ApiInfo("POST", "/", {"Action": "CertToken", "Version": "2022-08-31"}, {}, {}), "CertVerifyQuery": ApiInfo("POST", "/", {"Action": "CertVerifyQuery", "Version": "2022-08-31"}, {}, {}), "T2ILDM": ApiInfo("POST", "/", {"Action": "T2ILDM", "Version": "2022-08-31"}, {}, {}), "Img2ImgStyle": ApiInfo("POST", "/", {"Action": "Img2ImgStyle", "Version": "2022-08-31"}, {}, {}), "Img2ImgAnime": ApiInfo("POST", "/", {"Action": "Img2ImgAnime", "Version": "2022-08-31"}, {}, {}), "ImageScoreV2": ApiInfo("POST", "/", {"Action": "ImageScoreV2", "Version": "2022-08-31"}, {}, {}), "EnhancePhotoV2": ApiInfo("POST", "/", {"Action": "EnhancePhotoV2", "Version": "2022-08-31"}, {}, {}), "OverResolutionV2": ApiInfo("POST", "/", {"Action": "OverResolutionV2", "Version": "2022-08-31"}, {}, {}), "VideoOverResolutionSubmitTaskV2": ApiInfo("POST", "/", {"Action": "VideoOverResolutionSubmitTaskV2","Version": "2022-08-31"}, {}, {}), "VideoOverResolutionQueryTaskV2": ApiInfo("POST", "/", {"Action": "VideoOverResolutionQueryTaskV2","Version": "2022-08-31"}, {}, {}), "ImageCorrection": ApiInfo("POST", "/", {"Action": "ImageCorrection", "Version": "2022-08-31"}, {}, {}), "AllAgeGeneration": ApiInfo("POST", "/", {"Action": "AllAgeGeneration", "Version": "2022-08-31"}, {}, {}), "BodyDetection": ApiInfo("POST", "/", {"Action": "BodyDetection", "Version": "2022-08-31"}, {}, {}), "FaceFusionMovieSubmitTask": ApiInfo("POST", "/", {"Action": "FaceFusionMovieSubmitTask", "Version": "2022-08-31"}, {},{}), "FaceFusionMovieGetResult": ApiInfo("POST", "/", {"Action": "FaceFusionMovieGetResult", "Version": "2022-08-31"}, {},{}), "FaceFusionMovie": ApiInfo("POST", "/", {"Action": "FaceFusionMovie", "Version": "2022-08-31"}, {}, {}), "TupoCartoon": ApiInfo("POST", "/", {"Action": "TupoCartoon", "Version": "2022-08-31"}, {}, {}), "LensVidaVideoSubmitTaskV2": ApiInfo("POST", "/",{"Action": "LensVidaVideoSubmitTaskV2", "Version": "2022-08-31"}, {},{}), "LensVidaVideoGetResultV2": ApiInfo("POST", "/",{"Action": "LensVidaVideoGetResultV2", "Version": "2022-08-31"}, {},{}), "CertSrcFaceComp": ApiInfo("POST", "/", {"Action": "CertSrcFaceComp", "Version": "2022-08-31"}, {}, {}), "AIGufeng": ApiInfo("POST", "/", {"Action": "AIGufeng", "Version": "2022-08-31"}, {}, {}), "CertConfigInit": ApiInfo("POST", "/", {"Action": "CertConfigInit", "Version": "2022-08-31"}, {}, {}), "CertConfigGet": ApiInfo("POST", "/", {"Action": "CertConfigInit", "Version": "2022-08-31"}, {}, {}), "FaceCompare": ApiInfo("POST", "/", {"Action": "FaceCompare", "Version": "2022-08-31"}, {}, {}), "StillLivenessImg": ApiInfo("POST", "/", {"Action": "StillLivenessImg", "Version": "2022-08-31"}, {}, {}), "CertAuth": ApiInfo("POST", "/", {"Action": "CertAuth", "Version": "2022-08-31"}, {}, {}), "CertVerify": ApiInfo("POST", "/", {"Action": "CertVerify", "Version": "2022-08-31"}, {}, {}), "FaceSwapV2": ApiInfo("POST", "/", {"Action": "FaceSwap", "Version": "2022-08-31"}, {}, {}), "FaceswapAI": ApiInfo("POST", "/", {"Action": "FaceswapAI", "Version": "2022-08-31"}, {}, {}), "CertH5ConfigInit": ApiInfo("POST", "/", {"Action": "CertH5ConfigInit", "Version": "2022-08-31"}, {}, {}), "CertH5Token": ApiInfo("POST", "/", {"Action": "CertH5Token", "Version": "2022-08-31"}, {}, {}), "HighAesSmartDrawing": ApiInfo("POST", "/", {"Action": "HighAesSmartDrawing", "Version": "2022-08-31"}, {},{}), "EmotionPortrait": ApiInfo("POST", "/", {"Action": "EmotionPortrait", "Version": "2022-08-31"}, {}, {}), "Img2ImgInpainting": ApiInfo("POST", "/", {"Action": "Img2ImgInpainting", "Version": "2022-08-31"}, {}, {}), "Img2ImgInpaintingEdit": ApiInfo("POST", "/", {"Action": "Img2ImgInpaintingEdit", "Version": "2022-08-31"},{}, {}), "Img2ImgOutpainting": ApiInfo("POST", "/", {"Action": "Img2ImgOutpainting", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateDisneyStyleNoFace": ApiInfo("POST", "/", {"Action": "Img2ImgCreateDisneyStyleNoFace","Version": "2022-08-31"}, {}, {}), "Img2ImgCreatePastelBoys2D": ApiInfo("POST", "/",{"Action": "Img2ImgCreatePastelBoys2D", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateAesBlueline": ApiInfo("POST", "/",{"Action": "Img2ImgCreateAesBlueline", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateEtherRealMix": ApiInfo("POST", "/",{"Action": "Img2ImgCreateEtherRealMix", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateToonyou": ApiInfo("POST", "/", {"Action": "Img2ImgCreateToonyou", "Version": "2022-08-31"},{}, {}), "Img2ImgCreateAnyloraMakoto": ApiInfo("POST", "/",{"Action": "Img2ImgCreateAnyloraMakoto", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateRevAnimated": ApiInfo("POST", "/",{"Action": "Img2ImgCreateRevAnimated", "Version": "2022-08-31"}, {},{}), "Img2ImgCreateInkAndWater": ApiInfo("POST", "/",{"Action": "Img2ImgCreateInkAndWater", "Version": "2022-08-31"}, {},{}), "Img2ImgWaterColorStyle": ApiInfo("POST", "/",{"Action": "Img2ImgWaterColorStyle", "Version": "2022-08-31"}, {}, {}), "OCRPdfSubmitTask": ApiInfo("POST", "/", {"Action": "OCRPdfSubmitTask", "Version": "2021-08-23"}, {}, {}), "OCRPdfQueryTask": ApiInfo("POST", "/", {"Action": "OCRPdfQueryTask", "Version": "2021-08-23"}, {}, {}), "EntitySegment": ApiInfo("POST", "/", {"Action": "EntitySegment", "Version": "2022-08-31"}, {}, {}), "Img2ImgAnimeAcceleratedMaintainID": ApiInfo("POST", "/", {"Action": "Img2ImgAnimeAcceleratedMaintainID","Version": "2022-08-31"}, {}, {}), "Img2ImgComicsStyle": ApiInfo("POST", "/", {"Action": "Img2ImgComicsStyle", "Version": "2022-08-31"}, {},{}), "Img2ImgExquisiteStyle": ApiInfo("POST", "/", {"Action": "Img2ImgExquisiteStyle", "Version": "2022-08-31"},{}, {}), "Text2ImgXLSft": ApiInfo("POST", "/", {"Action": "Text2ImgXLSft", "Version": "2022-08-31"}, {}, {}), "Img2ImgXLSft": ApiInfo("POST", "/", {"Action": "Img2ImgXLSft", "Version": "2022-08-31"}, {}, {}), "CVGetResult": ApiInfo("POST", "/", {"Action": "CVGetResult", "Version": "2022-08-31"}, {}, {}), "CVSubmitTask": ApiInfo("POST", "/", {"Action": "CVSubmitTask", "Version": "2022-08-31"}, {}, {}), "CVSync2AsyncGetResult": ApiInfo("POST", "/", {"Action": "CVSync2AsyncGetResult", "Version": "2022-08-31"},{}, {}), "CVSync2AsyncSubmitTask": ApiInfo("POST", "/",{"Action": "CVSync2AsyncSubmitTask", "Version": "2022-08-31"}, {}, {}), "CVProcess": ApiInfo("POST", "/", {"Action": "CVProcess", "Version": "2022-08-31"}, {}, {}), "CertLivenessVerifyQuery": ApiInfo("POST", "/", {"Action": "CertLivenessVerifyQuery", "Version": "2022-08-31"}, {}, {}), "CVCancelTask": ApiInfo("POST", "/", {"Action": "CVCancelTask", "Version": "2024-06-06"}, {}, {}), } return api_info def common_handler(self, api, form): params = dict() try: res = self.post(api, params, form) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def common_get_handler(self, api, params): try: res = self.get(api, params) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def common_json_handler(self, api, form): params = dict() try: res = self.json(api, params, json.dumps(form)) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def cv_json_api(self, action, form): try: res_json = self.common_json_handler(action, form) return res_json except Exception as e: raise Exception(str(e)) def cv_form_api(self, action, form): try: res_json = self.common_handler(action, form) return res_json except Exception as e: raise Exception(str(e)) def cv_process(self, form): try: res_json = self.common_json_handler("CVProcess", form) return res_json except Exception as e: raise Exception(str(e)) def cv_submit_task(self, form): try: res_json = self.common_json_handler("CVSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def cv_get_result(self, form): try: res_json = self.common_json_handler("CVGetResult", form) return res_json except Exception as e: raise Exception(str(e)) def cv_sync2async_submit_task(self, form): try: res_json = self.common_json_handler("CVSync2AsyncSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def cv_sync2async_get_result(self, form): try: res_json = self.common_json_handler("CVSync2AsyncGetResult", form) return res_json except Exception as e: raise Exception(str(e)) def cv_cancel_task(self, form): try: res_json = self.common_json_handler("CVCancelTask", form) return res_json except Exception as e: raise Exception(str(e)) def cert_pro_liveness_verify_query(self, form): try: res_json = self.common_json_handler("CertLivenessVerifyQuery", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_xl_sft(self, form): try: res_json = self.common_json_handler("Img2ImgXLSft", form) return res_json except Exception as e: raise Exception(str(e)) def text2img_xl_sft(self, form): try: res_json = self.common_json_handler("Text2ImgXLSft", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_comics_style(self, form): try: res_json = self.common_json_handler("Img2ImgComicsStyle", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_exquisite_style(self, form): try: res_json = self.common_json_handler("Img2ImgExquisiteStyle", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_anime_accelerated_maintain_id(self, form): try: res_json = self.common_json_handler("Img2ImgAnimeAcceleratedMaintainID", form) return res_json except Exception as e: raise Exception(str(e)) def entity_segment(self, form): try: res_json = self.common_json_handler("EntitySegment", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_pdf_submit_task(self, form): try: res_json = self.common_json_handler("OCRPdfSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_pdf_query_task(self, form): try: res_json = self.common_json_handler("OCRPdfQueryTask", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_disney_style_no_face(self, form): try: res_json = self.common_json_handler("Img2ImgCreateDisneyStyleNoFace", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_pastel_boys2d(self, form): try: res_json = self.common_json_handler("Img2ImgCreatePastelBoys2D", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_ether_real_mix(self, form): try: res_json = self.common_json_handler("Img2ImgCreateEtherRealMix", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_toonyou(self, form): try: res_json = self.common_json_handler("Img2ImgCreateToonyou", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_anylora_makoto(self, form): try: res_json = self.common_json_handler("Img2ImgCreateAnyloraMakoto", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_rev_animated(self, form): try: res_json = self.common_json_handler("Img2ImgCreateRevAnimated", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_aes_blueline(self, form): try: res_json = self.common_json_handler("Img2ImgCreateAesBlueline", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_create_ink_and_water(self, form): try: res_json = self.common_json_handler("Img2ImgCreateInkAndWater", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_water_color_style(self, form): try: res_json = self.common_json_handler("Img2ImgWaterColorStyle", form) return res_json except Exception as e: raise Exception(str(e)) def high_aes_smart_drawing_v2(self, form): try: res_json = self.common_json_handler("HighAesSmartDrawing", form) return res_json except Exception as e: raise Exception(str(e)) def jpcartoon_cut(self, form): try: res_json = self.common_handler("JPCartoonCut", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_inpainting(self, form): try: res_json = self.common_json_handler("Img2ImgInpainting", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_inpainting_edit(self, form): try: res_json = self.common_json_handler("Img2ImgInpaintingEdit", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_outpainting(self, form): try: res_json = self.common_json_handler("Img2ImgOutpainting", form) return res_json except Exception as e: raise Exception(str(e)) def jpcartoon(self, form): try: res_json = self.common_handler("JPCartoon", form) return res_json except Exception as e: raise Exception(str(e)) def id_card(self, form): try: res_json = self.common_handler("IDCard", form) return res_json except Exception as e: raise Exception(str(e)) def high_aes_smart_drawing(self, form): try: res_json = self.common_json_handler("HighAesSmartDrawing", form) return res_json except Exception as e: raise Exception(str(e)) def face_swap(self, form): try: res_json = self.common_handler("FaceSwap", form) return res_json except Exception as e: raise Exception(str(e)) def face_swap_v2(self, form): try: res_json = self.common_json_handler("FaceSwapV2", form) return res_json except Exception as e: raise Exception(str(e)) def faceswap_ai(self, form): try: res_json = self.common_json_handler("FaceswapAI", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_normal(self, form): try: res_json = self.common_handler("OCRNormal", form) return res_json except Exception as e: raise Exception(str(e)) def bank_card(self, form): try: res_json = self.common_handler("BankCard", form) return res_json except Exception as e: raise Exception(str(e)) def human_segment(self, form): try: res_json = self.common_handler("HumanSegment", form) return res_json except Exception as e: raise Exception(str(e)) def general_segment(self, form): try: res_json = self.common_handler("GeneralSegment", form) return res_json except Exception as e: raise Exception(str(e)) def enhance_photo(self, form): try: res_json = self.common_handler("EnhancePhoto", form) return res_json except Exception as e: raise Exception(str(e)) def convert_photo(self, form): try: res_json = self.common_handler("ConvertPhoto", form) return res_json except Exception as e: raise Exception(str(e)) def convert_photo_v2(self, form): try: res_json = self.common_json_handler("ConvertPhotoV2", form) return res_json except Exception as e: raise Exception(str(e)) def cert_h5_config_init(self, form): try: res_json = self.common_json_handler("CertH5ConfigInit", form) return res_json except Exception as e: raise Exception(str(e)) def cert_h5_token(self, form): try: res_json = self.common_json_handler("CertH5Token", form) return res_json except Exception as e: raise Exception(str(e)) def video_scene_detect(self, form): try: res_json = self.common_handler("VideoSceneDetect", form) return res_json except Exception as e: raise Exception(str(e)) def over_resolution(self, form): try: res_json = self.common_handler("OverResolution", form) return res_json except Exception as e: raise Exception(str(e)) def goods_segment(self, form): try: res_json = self.common_handler("GoodsSegment", form) return res_json except Exception as e: raise Exception(str(e)) def image_outpaint(self, form): try: res_json = self.common_handler("ImageOutpaint", form) return res_json except Exception as e: raise Exception(str(e)) def image_inpaint(self, form): try: res_json = self.common_handler("ImageInpaint", form) return res_json except Exception as e: raise Exception(str(e)) def image_cut(self, form): try: res_json = self.common_handler("ImageCut", form) return res_json except Exception as e: raise Exception(str(e)) def entity_detect(self, form): try: res_json = self.common_handler("EntityDetect", form) return res_json except Exception as e: raise Exception(str(e)) def goods_detect(self, form): try: res_json = self.common_handler("GoodsDetect", form) return res_json except Exception as e: raise Exception(str(e)) def video_summarization_submit_task(self, form): try: res_json = self.common_handler( "VideoSummarizationSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def video_summarization_query_task(self, params): try: res_json = self.common_get_handler( "VideoSummarizationQueryTask", params) return res_json except Exception as e: raise Exception(str(e)) def video_over_resolution_submit_task(self, form): try: res_json = self.common_handler( "VideoOverResolutionSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def video_over_resolution_query_task(self, params): try: res_json = self.common_get_handler( "VideoOverResolutionQueryTask", params) return res_json except Exception as e: raise Exception(str(e)) def video_retargeting_submit_task(self, form): try: res_json = self.common_handler( "VideoRetargetingSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def video_retargeting_query_task(self, params): try: res_json = self.common_get_handler( "VideoRetargetingQueryTask", params) return res_json except Exception as e: raise Exception(str(e)) def video_inpaint_submit_task(self, form): try: res_json = self.common_handler( "VideoInpaintSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def video_inpaint_query_task(self, params): try: res_json = self.common_get_handler( "VideoInpaintQueryTask", params) return res_json except Exception as e: raise Exception(str(e)) def car_plate_detection(self, form): try: res_json = self.common_handler("CarPlateDetection", form) return res_json except Exception as e: raise Exception(str(e)) def distortion_free(self, form): try: res_json = self.common_handler("DistortionFree", form) return res_json except Exception as e: raise Exception(str(e)) def stretch_recovery(self, form): try: res_json = self.common_handler("StretchRecovery", form) return res_json except Exception as e: raise Exception(str(e)) def image_flow(self, form): try: res_json = self.common_handler("ImageFlow", form) return res_json except Exception as e: raise Exception(str(e)) def image_score(self, form): try: res_json = self.common_handler("ImageScore", form) return res_json except Exception as e: raise Exception(str(e)) def poem_material(self, form): try: res_json = self.common_handler("PoemMaterial", form) return res_json except Exception as e: raise Exception(str(e)) def emoticon_edit(self, form): try: res_json = self.common_handler("EmoticonEdit", form) return res_json except Exception as e: raise Exception(str(e)) def eye_close2open(self, form): try: res_json = self.common_handler("EyeClose2Open", form) return res_json except Exception as e: raise Exception(str(e)) def car_segment(self, form): try: res_json = self.common_handler("CarSegment", form) return res_json except Exception as e: raise Exception(str(e)) def car_detection(self, form): try: res_json = self.common_handler("CarDetection", form) return res_json except Exception as e: raise Exception(str(e)) def sky_segment(self, form): try: res_json = self.common_handler("SkySegment", form) return res_json except Exception as e: raise Exception(str(e)) def image_search_image_add(self, form): try: res_json = self.common_handler("ImageSearchImageAdd", form) return res_json except Exception as e: raise Exception(str(e)) def image_search_image_delete(self, form): try: res_json = self.common_handler("ImageSearchImageDelete", form) return res_json except Exception as e: raise Exception(str(e)) def image_search_image_search(self, form): try: res_json = self.common_handler("ImageSearchImageSearch", form) return res_json except Exception as e: raise Exception(str(e)) def product_search_add_image(self, params): try: res_json = self.json("ProductSearchAddImage", [], json.dumps(params)) return res_json except Exception as e: raise Exception(str(e)) def product_search_delete_image(self, params): try: res_json = self.json("ProductSearchDeleteImage", [], json.dumps(params)) return res_json except Exception as e: raise Exception(str(e)) def product_search_search_image(self, params): try: res_json = self.json("ProductSearchSearchImage", [], json.dumps(params)) return res_json except Exception as e: raise Exception(str(e)) def clue_license(self, form): try: res_json = self.common_handler("ClueLicense", form) return res_json except Exception as e: raise Exception(str(e)) def driving_license(self, form): try: res_json = self.common_handler("DrivingLicense", form) return res_json except Exception as e: raise Exception(str(e)) def vehicle_license(self, form): try: res_json = self.common_handler("VehicleLicense", form) return res_json except Exception as e: raise Exception(str(e)) def taxi_invoice(self, form): try: res_json = self.common_handler("TaxiInvoice", form) return res_json except Exception as e: raise Exception(str(e)) def train_ticket(self, form): try: res_json = self.common_handler("TrainTicket", form) return res_json except Exception as e: raise Exception(str(e)) def flight_invoice(self, form): try: res_json = self.common_handler("FlightInvoice", form) return res_json except Exception as e: raise Exception(str(e)) def vat_invoice(self, form): try: res_json = self.common_handler("VatInvoice", form) return res_json except Exception as e: raise Exception(str(e)) def quota_invoice(self, form): try: res_json = self.common_handler("QuotaInvoice", form) return res_json except Exception as e: raise Exception(str(e)) def hair_style(self, form): try: res_json = self.common_handler("HairStyle", form) return res_json except Exception as e: raise Exception(str(e)) def hair_style_v2(self, form): try: res_json = self.common_json_handler("HairStyleV2", form) return res_json except Exception as e: raise Exception(str(e)) def face_pretty(self, form): try: res_json = self.common_handler("FacePretty", form) return res_json except Exception as e: raise Exception(str(e)) def image_animation(self, form): try: res_json = self.common_handler("ImageAnimation", form) return res_json except Exception as e: raise Exception(str(e)) def cover_video(self, form): try: res_json = self.common_handler("CoverVideo", form) return res_json except Exception as e: raise Exception(str(e)) def dolly_zoom(self, form): try: res_json = self.common_handler("DollyZoom", form) return res_json except Exception as e: raise Exception(str(e)) def img2video3d(self, form): try: res_json = self.common_json_handler("Img2Video3D", form) return res_json except Exception as e: raise Exception(str(e)) def ai_gufeng(self, form): try: res_json = self.common_json_handler("AIGufeng", form) return res_json except Exception as e: raise Exception(str(e)) def potrait_effect(self, form): try: res_json = self.common_handler("PotraitEffect", form) return res_json except Exception as e: raise Exception(str(e)) def image_style_conversion(self, form): try: res_json = self.common_handler("ImageStyleConversion", form) return res_json except Exception as e: raise Exception(str(e)) def three_d_game_cartoon(self, form): try: res_json = self.common_handler("3DGameCartoon", form) return res_json except Exception as e: raise Exception(str(e)) def hair_segment(self, form): try: res_json = self.common_handler("HairSegment", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_seal(self, form): try: res_json = self.common_handler("OcrSeal", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_pass_invoice(self, form): try: res_json = self.common_handler("OcrPassInvoice", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_trade(self, form): try: res_json = self.common_handler("OCRTrade", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_ruanzhu(self, form): try: res_json = self.common_handler("OCRRuanzhu", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_cosmetic_product(self, form): try: res_json = self.common_handler("OCRCosmeticProduct", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_pdf(self, form): try: res_json = self.common_handler("OCRPdf", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_table(self, form): try: res_json = self.common_handler("OCRTable", form) return res_json except Exception as e: raise Exception(str(e)) def video_cover_selection(self, form): try: res_json = self.common_handler("VideoCoverSelection", form) return res_json except Exception as e: raise Exception(str(e)) def video_highlight_extraction_submit_task(self, form): try: res_json = self.common_handler( "VideoHighlightExtractionSubmitTask", form) return res_json except Exception as e: raise Exception(str(e)) def video_highlight_extraction_query_task(self, params): try: res_json = self.common_get_handler( "VideoHighlightExtractionQueryTask", params) return res_json except Exception as e: raise Exception(str(e)) def cert_token(self, form): try: res_json = self.common_json_handler("CertToken", form) return res_json except Exception as e: raise Exception(str(e)) def cert_verify_query(self, form): try: res_json = self.common_json_handler("CertVerifyQuery", form) return res_json except Exception as e: raise Exception(str(e)) def t2i_ldm(self, form): try: res_json = self.common_json_handler("T2ILDM", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_style(self, form): try: res_json = self.common_json_handler("Img2ImgStyle", form) return res_json except Exception as e: raise Exception(str(e)) def img2img_anime(self, form): try: res_json = self.common_json_handler("Img2ImgAnime", form) return res_json except Exception as e: raise Exception(str(e)) def ocr_api(self, action, form): try: res_json = self.common_handler(action, form) return res_json except Exception as e: raise Exception(str(e)) def ocr_async_api(self, action, form): try: res_json = self.common_json_handler(action, form) return res_json except Exception as e: raise Exception(str(e)) def image_score_v2(self, body): try: res_json = self.common_json_handler("ImageScoreV2", body) return res_json except Exception as e: raise Exception(str(e)) def enhance_photo_v2(self, body): try: res_json = self.common_json_handler("EnhancePhotoV2", body) return res_json except Exception as e: raise Exception(str(e)) def over_resolution_v2(self, body): try: res_json = self.common_json_handler("OverResolutionV2", body) return res_json except Exception as e: raise Exception(str(e)) def video_over_resolution_submit_task_v2(self, body): try: res_json = self.common_json_handler("VideoOverResolutionSubmitTaskV2", body) return res_json except Exception as e: raise Exception(str(e)) def video_over_resolution_get_result_v2(self, body): try: res_json = self.common_json_handler("VideoOverResolutionQueryTaskV2", body) return res_json except Exception as e: raise Exception(str(e)) def image_correction(self, body): try: res_json = self.common_json_handler("ImageCorrection", body) return res_json except Exception as e: raise Exception(str(e)) def all_age_generation(self, body): try: res_json = self.common_json_handler("AllAgeGeneration", body) return res_json except Exception as e: raise Exception(str(e)) def body_detection(self, body): try: res_json = self.common_json_handler("BodyDetection", body) return res_json except Exception as e: raise Exception(str(e)) def face_fusion_movie_submit_task(self, body): try: res_json = self.common_json_handler("FaceFusionMovieSubmitTask", body) return res_json except Exception as e: raise Exception(str(e)) def face_fusion_movie_get_result(self, body): try: res_json = self.common_json_handler("FaceFusionMovieGetResult", body) return res_json except Exception as e: raise Exception(str(e)) def face_fusion_movie(self, body): try: res_json = self.common_json_handler("FaceFusionMovie", body) return res_json except Exception as e: raise Exception(str(e)) def tupo_cartoon(self, body): try: res_json = self.common_json_handler("TupoCartoon", body) return res_json except Exception as e: raise Exception(str(e)) def lens_vida_video_submit_task_v2(self, body): try: res_json = self.common_json_handler("LensVidaVideoSubmitTaskV2", body) return res_json except Exception as e: raise Exception(str(e)) def lens_vida_video_get_result_v2(self, body): try: res_json = self.common_json_handler("LensVidaVideoGetResultV2", body) return res_json except Exception as e: raise Exception(str(e)) def cert_src_face_comp(self, body): try: res_json = self.common_json_handler("CertSrcFaceComp", body) return res_json except Exception as e: raise Exception(str(e)) def cert_config_init(self, form): try: res_json = self.common_json_handler("CertConfigInit", form) return res_json except Exception as e: raise Exception(str(e)) def cert_config_get(self, body): try: res_json = self.common_json_handler("CertConfigGet", body) return res_json except Exception as e: raise Exception(str(e)) def face_compare(self, body): try: res_json = self.common_json_handler("FaceCompare", body) return res_json except Exception as e: raise Exception(str(e)) def still_liveness_img(self, body): try: res_json = self.common_json_handler("StillLivenessImg", body) return res_json except Exception as e: raise Exception(str(e)) def emotion_portrait(self, body): try: res_json = self.common_json_handler("EmotionPortrait", body) return res_json except Exception as e: raise Exception(str(e)) def cert_auth(self, body): try: res_json = self.common_json_handler("CertAuth", body) return res_json except Exception as e: raise Exception(str(e)) def cert_verify(self, body): try: res_json = self.common_json_handler("CertVerify", body) return res_json except Exception as e: raise Exception(str(e)) def set_api_info(self, action, version): self.api_info[action] = ApiInfo("POST", "/", {"Action": action, "Version": version}, {}, {}) ================================================ FILE: volcengine/visual/__init__.py ================================================ ================================================ FILE: volcengine/vms/VmsService.py ================================================ # coding:utf-8 import json import threading import redo from retry import retry from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.Policy import * from requests import delete, exceptions SERVICE_VERSION = "2022-01-01" class VmsService(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(VmsService, "_instance"): with VmsService._instance_lock: if not hasattr(VmsService, "_instance"): VmsService._instance = object.__new__(cls) return VmsService._instance def __init__(self, region='cn-north-1'): self.service_info = VmsService.get_service_info(region) self.api_info = VmsService.get_api_info() self.domain_cache = {} self.fallback_domain_weights = {} self.update_interval = 10 self.lock = threading.Lock() super(VmsService, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("cloud-vms.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vms', 'cn-north-1'), 10, 10), } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info @staticmethod def get_api_info(): api_info = { "BindAXB": ApiInfo("POST", "/", {"Action": "BindAXB", "Version": SERVICE_VERSION}, {}, {}), "SelectNumberAndBindAXB": ApiInfo("POST", "/", {"Action": "SelectNumberAndBindAXB", "Version": SERVICE_VERSION}, {}, {}), "UnbindAXB": ApiInfo("POST", "/", {"Action": "UnbindAXB", "Version": SERVICE_VERSION}, {}, {}), "QuerySubscription": ApiInfo("POST", "/", {"Action": "QuerySubscription", "Version": SERVICE_VERSION}, {}, {}), "QuerySubscriptionForList": ApiInfo("POST", "/", {"Action": "QuerySubscriptionForList", "Version": SERVICE_VERSION}, {}, {}), "UpgradeAXToAXB": ApiInfo("POST", "/", {"Action": "UpgradeAXToAXB", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXB": ApiInfo("POST", "/", {"Action": "UpdateAXB", "Version": SERVICE_VERSION}, {}, {}), "BindAXN": ApiInfo("POST", "/", {"Action": "BindAXN", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXN": ApiInfo("POST", "/", {"Action": "UpdateAXN", "Version": SERVICE_VERSION}, {}, {}), "UnbindAXN": ApiInfo("POST", "/", {"Action": "UnbindAXN", "Version": SERVICE_VERSION}, {}, {}), "SelectNumberAndBindAXN": ApiInfo("POST", "/", {"Action": "SelectNumberAndBindAXN", "Version": SERVICE_VERSION}, {}, {}), "Click2Call": ApiInfo("POST", "/", {"Action": "Click2Call", "Version": SERVICE_VERSION}, {}, {}), "CancelClick2Call": ApiInfo("POST", "/", {"Action": "CancelClick2Call", "Version": SERVICE_VERSION}, {}, {}), "Click2CallLite": ApiInfo("POST", "/", {"Action": "Click2CallLite", "Version": SERVICE_VERSION}, {}, {}), "BindAXNE": ApiInfo("POST", "/", {"Action": "BindAXNE", "Version": SERVICE_VERSION}, {}, {}), "UnbindAXNE": ApiInfo("POST", "/", {"Action": "UnbindAXNE", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXNE": ApiInfo("POST", "/", {"Action": "UpdateAXNE", "Version": SERVICE_VERSION}, {}, {}), "BindAXBForAXNE": ApiInfo("POST", "/", {"Action": "BindAXBForAXNE", "Version": SERVICE_VERSION}, {}, {}), "BindAXYB": ApiInfo("POST", "/", {"Action": "BindAXYB", "Version": SERVICE_VERSION}, {}, {}), "BindYBForAXYB": ApiInfo("POST", "/", {"Action": "BindYBForAXYB", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXYB": ApiInfo("POST", "/", {"Action": "UpdateAXYB", "Version": SERVICE_VERSION}, {}, {}), "UnbindAXYB": ApiInfo("POST", "/", {"Action": "UnbindAXYB", "Version": SERVICE_VERSION}, {}, {}), "BindAXG": ApiInfo("POST", "/", {"Action": "BindAXG", "Version": SERVICE_VERSION}, {}, {}), "UnbindAXG": ApiInfo("POST", "/", {"Action": "UnbindAXG", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXG": ApiInfo("POST", "/", {"Action": "UpdateAXG", "Version": SERVICE_VERSION}, {}, {}), "CreateAXGGroup": ApiInfo("POST", "/", {"Action": "CreateAXGGroup", "Version": SERVICE_VERSION}, {}, {}), "UpdateAXGGroup": ApiInfo("POST", "/", {"Action": "UpdateAXGGroup", "Version": SERVICE_VERSION}, {}, {}), "DeleteAXGGroup": ApiInfo("POST", "/", {"Action": "DeleteAXGGroup", "Version": SERVICE_VERSION}, {}, {}), "RegisterIndustrialId": ApiInfo("POST", "/", {"Action": "RegisterIndustrialId", "Version": SERVICE_VERSION}, {}, {}), "RouteAAuth": ApiInfo("POST", "/", {"Action": "RouteAAuth", "Version": SERVICE_VERSION}, {}, {}), "NumberPoolList": ApiInfo("POST", "/", {"Action": "NumberPoolList", "Version": SERVICE_VERSION}, {}, {}), "NumberList": ApiInfo("GET", "/", {"Action": "NumberList", "Version": SERVICE_VERSION}, {}, {}), "CreateNumberPool": ApiInfo("POST", "/", {"Action": "CreateNumberPool", "Version": SERVICE_VERSION}, {}, {}), "UpdateNumberPool": ApiInfo("POST", "/", {"Action": "UpdateNumberPool", "Version": SERVICE_VERSION}, {}, {}), "EnableOrDisableNumber": ApiInfo("POST", "/", {"Action": "EnableOrDisableNumber", "Version": SERVICE_VERSION}, {}, {}), "SelectNumber": ApiInfo("GET", "/", {"Action": "SelectNumber", "Version": SERVICE_VERSION}, {}, {}), "QueryCanCall": ApiInfo("POST", "/", {"Action": "QueryCanCall", "Version": SERVICE_VERSION}, {}, {}), "QueryCallRecordMsg": ApiInfo("POST", "/", {"Action": "QueryCallRecordMsg", "Version": SERVICE_VERSION}, {}, {}), "QueryAudioRecordFileUrl": ApiInfo("POST", "/", {"Action": "QueryAudioRecordFileUrl", "Version": SERVICE_VERSION}, {}, {}), "QueryAudioRecordToTextFileUrl": ApiInfo("POST", "/", {"Action": "QueryAudioRecordToTextFileUrl", "Version": SERVICE_VERSION}, {}, {}), "CreateTask": ApiInfo("POST", "/", {"Action": "CreateTask", "Version": SERVICE_VERSION}, {}, {}), "BatchAppend": ApiInfo("POST", "/", {"Action": "BatchAppend", "Version": SERVICE_VERSION}, {}, {}), "PauseTask": ApiInfo("POST", "/", {"Action": "PauseTask", "Version": SERVICE_VERSION}, {}, {}), "ResumeTask": ApiInfo("POST", "/", {"Action": "ResumeTask", "Version": SERVICE_VERSION}, {}, {}), "StopTask": ApiInfo("POST", "/", {"Action": "StopTask", "Version": SERVICE_VERSION}, {}, {}), "UpdateTask": ApiInfo("POST", "/", {"Action": "UpdateTask", "Version": SERVICE_VERSION}, {}, {}), "SingleBatchAppend": ApiInfo("POST", "/", {"Action": "SingleBatchAppend", "Version": SERVICE_VERSION}, {}, {}), "SingleInfo": ApiInfo("GET", "/", {"Action": "SingleInfo", "Version": SERVICE_VERSION}, {}, {}), "SingleCancel": ApiInfo("GET", "/", {"Action": "SingleCancel", "Version": SERVICE_VERSION}, {}, {}), "FetchResource": ApiInfo("POST", "/", {"Action": "FetchResource", "Version": SERVICE_VERSION}, {}, {}), "OpenCreateTts": ApiInfo("POST", "/", {"Action": "OpenCreateTts", "Version": SERVICE_VERSION}, {}, {}), "OpenDeleteResource": ApiInfo("POST", "/", {"Action": "OpenDeleteResource", "Version": SERVICE_VERSION}, {}, {}), "GetResourceUploadUrl": ApiInfo("POST", "/", {"Action": "GetResourceUploadUrl", "Version": SERVICE_VERSION}, {}, {}), "CommitResourceUpload": ApiInfo("POST", "/", {"Action": "CommitResourceUpload", "Version": SERVICE_VERSION}, {}, {}), "OpenUpdateResource": ApiInfo("POST", "/", {"Action": "OpenUpdateResource", "Version": SERVICE_VERSION}, {}, {}), "QueryUsableResource": ApiInfo("POST", "/", {"Action": "QueryUsableResource", "Version": SERVICE_VERSION}, {}, {}), "QueryOpenGetResource": ApiInfo("POST", "/", {"Action": "QueryOpenGetResource", "Version": SERVICE_VERSION}, {}, {}), } return api_info def common_handler(self, api, form): params = dict() try: res = self.post(api, params, form) res_json = json.loads(res) return res_json except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def do_query_handler(self, api, params): try: res = self.get(api, params) return json.loads(res) except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def do_json_handler(self, api, body, params=dict()): try: res = self.json(api, params, json.dumps(body)) return json.loads(res) except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) def do_post_handler(self, api, form, params=dict()): try: res = self.post(api, params, form) return json.loads(res) except Exception as e: res = str(e) try: res_json = json.loads(res) return res_json except: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axb(self, form): try: return self.common_handler("BindAXB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def select_number_and_bind_axb(self, form): try: return self.common_handler("SelectNumberAndBindAXB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def unbind_axb(self, form): try: return self.common_handler("UnbindAXB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_subscription(self, form): try: return self.common_handler("QuerySubscription", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_subscription_for_list(self, form): try: return self.common_handler("QuerySubscriptionForList", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def upgrade_ax_to_axb(self, form): try: return self.common_handler("UpgradeAXToAXB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axb(self, form): try: return self.common_handler("UpdateAXB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axn(self, form): try: return self.common_handler("BindAXN", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axn(self, form): try: return self.common_handler("UpdateAXN", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def unbind_axn(self, form): try: return self.common_handler("UnbindAXN", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def select_number_and_bind_axn(self, form): try: return self.common_handler("SelectNumberAndBindAXN", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def click2_call(self, form): try: return self.common_handler("Click2Call", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def cancel_click2_call(self, form): try: return self.common_handler("CancelClick2Call", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def click2_call_lite(self, form): try: return self.common_handler("Click2CallLite", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axne(self, form): try: return self.common_handler("BindAXNE", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def unbind_axne(self, form): try: return self.common_handler("UnbindAXNE", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axne(self, form): try: return self.common_handler("UpdateAXNE", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axb_for_axne(self, form): try: return self.common_handler("BindAXBForAXNE", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axyb(self, form): try: return self.common_handler("BindAXYB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_yb_for_axyb(self, form): try: return self.common_handler("BindYBForAXYB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axyb(self, form): try: return self.common_handler("UpdateAXYB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def unbind_axyb(self, form): try: return self.common_handler("UnbindAXYB", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def bind_axg(self, body): try: res_json = self.do_json_handler("BindAXG", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def unbind_axg(self, body): try: res_json = self.do_json_handler("UnbindAXG", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axg(self, body): try: res_json = self.do_json_handler("UpdateAXG", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def create_axg_group(self, body): try: res_json = self.do_json_handler("CreateAXGGroup", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_axg_group(self, body): try: res_json = self.do_json_handler("UpdateAXGGroup", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def delete_axg_group(self, body): try: res_json = self.do_json_handler("DeleteAXGGroup", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def register_industrial_id(self, body): try: res_json = self.do_json_handler("RegisterIndustrialId", body) return res_json except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def route_a_auth(self, form): try: return self.common_handler("RouteAAuth", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def number_pool_list(self, form): try: return self.common_handler("NumberPoolList", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def number_list(self, params): try: return self.do_query_handler("NumberList", params) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def create_number_pool(self, form): try: return self.common_handler("CreateNumberPool", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def update_number_pool(self, form): try: return self.common_handler("UpdateNumberPool", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def enable_or_disable_number(self, form): try: return self.common_handler("EnableOrDisableNumber", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def select_number(self, params): try: return self.do_query_handler("SelectNumber", params) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_call_call(self, form): try: return self.common_handler("QueryCanCall", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_call_record_msg(self, form): try: return self.common_handler("QueryCallRecordMsg", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_audio_record_file_url(self, form): try: return self.common_handler("QueryAudioRecordFileUrl", form) except Exception as e: raise Exception(str(e)) @retry(tries=2, delay=0) def query_audio_record_to_text_file_url(self, form): try: return self.common_handler("QueryAudioRecordToTextFileUrl", form) except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_task(self, body): try: res_json = self.do_json_handler("CreateTask", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def batch_append_task(self, body): try: res_json = self.do_json_handler("BatchAppend", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def update_task(self, body): try: res_json = self.do_json_handler("UpdateTask", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def pause_task(self, params): try: res_json = self.do_json_handler("PauseTask", dict(), params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def resume_task(self, params): try: res_json = self.do_json_handler("ResumeTask", dict(), params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def stop_task(self, params): try: res_json = self.do_json_handler("StopTask", dict(), params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def single_batch_append(self, body): try: res_json = self.do_json_handler("SingleBatchAppend", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def single_info(self, params): try: res_json = self.do_query_handler("SingleInfo", params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def single_cancel(self, params): try: res_json = self.do_query_handler("SingleCancel", params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def fetch_resource(self, body): try: res_json = self.do_json_handler("FetchResource", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def create_tts(self, body): try: res_json = self.do_json_handler("OpenCreateTts", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def delete_resource(self, params): try: res_json = self.do_json_handler("OpenDeleteResource", dict(), params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def get_resource_upload_url(self, body): try: res_json = self.do_json_handler("GetResourceUploadUrl", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def commit_resource_upload(self, body): try: res_json = self.do_json_handler("CommitResourceUpload", body) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def open_update_resource(self, params): try: res_json = self.do_post_handler("OpenUpdateResource", {}, params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def query_usable_resource(self, params): try: res_json = self.do_post_handler("QueryUsableResource", {}, params) return res_json except Exception as e: raise Exception(str(e)) @redo.retriable(sleeptime=0.1, jitter=0.01, attempts=2, retry_exceptions=(exceptions.ConnectionError, exceptions.ConnectTimeout)) def query_open_get_resource(self, body): try: res_json = self.do_json_handler("QueryOpenGetResource", body) return res_json except Exception as e: raise Exception(str(e)) ================================================ FILE: volcengine/vms/__init__.py ================================================ ================================================ FILE: volcengine/vod/VodService.py ================================================ # coding:utf-8 # Code generated by protoc-gen-volcengine-sdk # source: VodService # DO NOT EDIT! from __future__ import print_function from volcengine.Policy import * from google.protobuf.json_format import * from volcengine.vod.VodServiceConfig import VodServiceConfig from retry import retry from zlib import crc32 import os import sys import time import datetime import volcengine.vod from volcengine.const.Const import FILE_TYPE_OBJECT from volcengine.util.Util import Util from volcengine.vod.helper.FileSectionReader import FileSectionReader from volcengine.vod.models.request.request_vod_pb2 import * from volcengine.vod.models.response.response_vod_pb2 import * MinChunkSize = 1024 * 1024 * 20 LargeFileSize = 1024 * 1024 * 1024 # # Generated from protobuf service VodService # class VodService(VodServiceConfig): def get_private_drm_play_auth_token(self, request, expire): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) if expire > 0: params['X-Expires'] = str(expire) data = self.get_sign_url('GetPrivateDrmPlayAuth', params) return data except Exception as Argument: raise Argument def create_hls_drm_auth_token(self, auth_algorithm, expire_seconds): try: if expire_seconds == 0: raise Exception("invalid expire") deadline = int(time.mktime(datetime.datetime.now().timetuple())) + expire_seconds deadTime = datetime.datetime.utcfromtimestamp(deadline).strftime("%Y%m%dT%H%M%SZ") if sys.version_info[0] == 3: kDate = Util.hmac_sha256(bytes(self.service_info.credentials.sk, encoding='utf-8'), deadTime) else: kDate = Util.hmac_sha256(bytes(self.service_info.credentials.sk.encode('utf-8')), deadTime) kRegion = Util.hmac_sha256(kDate, self.service_info.credentials.region) kService = Util.hmac_sha256(kRegion, 'vod') kCredentials = Util.hmac_sha256(kService, 'request') key = Util.to_hex(kCredentials) signDataString = '&'.join([auth_algorithm, '2.0', str(deadline)]) if auth_algorithm == 'HMAC-SHA1': if sys.version_info[0] == 3: signBytes = Util.hmac_sha1(bytes(key, encoding='utf-8'), signDataString) else: signBytes = Util.hmac_sha1(bytes(key.encode('utf-8')), signDataString) else: raise Exception('invalid authAlgorithm') sign = base64.b64encode(signBytes).decode('utf-8') token = ':'.join([auth_algorithm, '2.0', str(deadline), self.service_info.credentials.ak, sign]) params = dict() params['DrmAuthToken'] = token params['X-Expires'] = str(expire_seconds) getAuth = self.get_sign_url("GetHlsDecryptionKey", params) return getAuth except Exception as e: raise e def get_sha1_hls_drm_auth_token(self, expire_seconds): try: return self.create_hls_drm_auth_token('HMAC-SHA1', expire_seconds) except Exception as Argument: raise Argument def get_play_auth_token(self, request, expire): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) if expire > 0: params['X-Expires'] = str(expire) token = self.get_sign_url('GetPlayInfo', params) ret = {'TokenVersion': 'V2', 'GetPlayInfoToken': token} data = json.dumps(ret) except Exception as Argument: raise Argument else: if sys.version_info[0] == 3: return base64.b64encode(data.encode('utf-8')).decode('utf-8') else: return base64.b64encode(data.decode('utf-8')) def get_subtitle_auth_token(self, request, expire): try: if request.Vid == "": raise Exception("Vid is None") params = {"Vid": request.Vid} params["Status"] = "Published" if expire > 0: params['X-Expires'] = str(expire) token = self.get_sign_url('GetSubtitleInfoList', params) ret = {'GetSubtitleAuthToken': token} data = json.dumps(ret) except Exception as Argument: raise Argument else: if sys.version_info[0] == 3: return base64.b64encode(data.encode('utf-8')).decode('utf-8') else: return base64.b64encode(data.decode('utf-8')) def upload_media(self, request): file_path = request.FilePath if request.SupportParseManifest and file_path.lower().endswith('.m3u8'): # Parse m3u8 manifest and upload segments segments = self.parse_m3u8_manifest(request.SpaceName, file_path) self.upload_m3u8_segments(request, segments) oid, session_key, avg_speed = self.upload_tob(request.SpaceName, request.FilePath, "", request.FileName, request.FileExtension, request.StorageClass, request.ClientNetWorkMode, request.ClientIDCMode, request.UploadHostPrefer, request.ChunkSize) req = VodCommitUploadInfoRequest() req.SpaceName = request.SpaceName req.SessionKey = session_key req.Functions = request.Functions req.CallbackArgs = request.CallbackArgs req.ExpireTime = request.ExpireTime resp = self.commit_upload_info(req) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.RequestId) raise Exception(resp.ResponseMetadata.Error) return resp def parse_m3u8_manifest(self, space_name, manifest_path): # Recursively parse manifest and collect all segments segments = [] seen_files = set() def parse(current_path, relative_path_prefix): with open(current_path, 'r', encoding='utf-8') as f: manifest_content = f.read() parse_req = VodParseUploadManifestRequest() parse_req.SpaceName = space_name parse_req.ManifestContent = manifest_content parse_resp = self.parse_upload_manifest(parse_req) if parse_resp.ResponseMetadata.Error.Code != '': print(parse_resp.ResponseMetadata.RequestId) raise Exception(parse_resp.ResponseMetadata.Error) manifest_dir = os.path.dirname(current_path) if parse_resp.Result and parse_resp.Result.Data: for segment in parse_resp.Result.Data.MediaSegments: segment_path = os.path.join(manifest_dir, segment) if segment_path in seen_files: continue seen_files.add(segment_path) segment_file_name = segment if relative_path_prefix: segment_file_name = os.path.join(relative_path_prefix, segment_file_name) if segment_path.lower().endswith('.m3u8'): sub_relative_path_prefix = os.path.dirname(segment_file_name) if sub_relative_path_prefix == '.': sub_relative_path_prefix = '' parse(segment_path, sub_relative_path_prefix) segments.append({ 'file_path': segment_path, 'file_name': segment_file_name }) parse(manifest_path, '') return segments def upload_m3u8_segments(self, request, segments): # Get path prefix path_prefix = '' if request.FileName: path_prefix = os.path.dirname(request.FileName) if path_prefix != '': path_prefix += '/' max_retries = 2 retry_delay = 1 # Upload each segment with retry for segment in segments: segment_file_path = segment['file_path'] segment_file_name = path_prefix + segment['file_name'] file_ext = os.path.splitext(segment_file_name)[1] last_exception = None for attempt in range(max_retries + 1): try: _, _, _ = self.upload_tob( request.SpaceName, segment_file_path, FILE_TYPE_OBJECT, segment_file_name, file_ext, request.StorageClass, request.ClientNetWorkMode, request.ClientIDCMode, request.UploadHostPrefer, request.ChunkSize ) break except Exception as e: last_exception = e if attempt < max_retries: print(f"Upload segment {segment_file_name} failed (attempt {attempt + 1}/{max_retries + 1}), retrying... Error: {e}") time.sleep(retry_delay) else: print(f"Upload segment {segment_file_name} failed after {max_retries + 1} attempts. Error: {e}") raise last_exception def upload_tob(self, space_name, file_path, file_type, file_name, file_extension, storage_class, client_network_mode, client_idc_mode, upload_host_prefer, chunk_size): if not os.path.isfile(file_path): raise Exception("no such file on file path") if chunk_size < MinChunkSize: chunk_size = MinChunkSize file_size = os.path.getsize(file_path) apply_req = VodApplyUploadInfoRequest() apply_req.SpaceName = space_name apply_req.FileSize = file_size apply_req.FileType = file_type apply_req.FileName = file_name apply_req.FileExtension = file_extension apply_req.StorageClass = storage_class apply_req.ClientNetWorkMode = client_network_mode apply_req.ClientIDCMode = client_idc_mode apply_req.NeedFallback = True apply_req.UploadHostPrefer = upload_host_prefer resp = self.apply_upload_info(apply_req) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.RequestId) raise Exception(resp.ResponseMetadata.Error) vpc_upload_address = resp.Result.Data.VpcTosUploadAddress if vpc_upload_address: upload_address = resp.Result.Data.UploadAddress oid = upload_address.StoreInfos[0].StoreUri session_key = upload_address.SessionKey start = time.time() if vpc_upload_address.UploadMode != "": self.vpc_upload(vpc_upload_address, file_path, file_size) cost = (time.time() - start) * 1000 avg_speed = float(file_size) / float(cost) return oid, session_key, avg_speed # using candidate address first candidate_upload_address = resp.Result.Data.CandidateUploadAddresses all_upload_address = [] if candidate_upload_address: all_upload_address.extend(candidate_upload_address.MainUploadAddresses) all_upload_address.extend(candidate_upload_address.BackupUploadAddresses) all_upload_address.extend(candidate_upload_address.FallbackUploadAddresses) if len(all_upload_address) > 0: file_size = os.path.getsize(file_path) for i, upload_address in enumerate(all_upload_address): if len(upload_address.UploadHosts) == 0 or len(upload_address.StoreInfos) == 0 or not \ upload_address.StoreInfos[0]: continue tos_host = upload_address.UploadHosts[0] oid = upload_address.StoreInfos[0].StoreUri session_key = upload_address.SessionKey auth = upload_address.StoreInfos[0].Auth start = time.time() try: if file_size < chunk_size: self.direct_upload(tos_host, oid, auth, file_path, storage_class) else: self.chunk_upload(file_path, tos_host, oid, auth, file_size, True, storage_class, chunk_size) except Exception as e: print("upload failed, switch host to retry.. reason: {}".format(e)) continue else: cost = (time.time() - start) * 1000 avg_speed = float(file_size) / float(cost) return oid, session_key, avg_speed raise Exception("upload failed") else: upload_address = resp.Result.Data.UploadAddress oid = upload_address.StoreInfos[0].StoreUri session_key = upload_address.SessionKey auth = upload_address.StoreInfos[0].Auth host = upload_address.UploadHosts[0] start = time.time() file_size = os.path.getsize(file_path) if file_size < chunk_size: self.direct_upload(host, oid, auth, file_path, storage_class) else: self.chunk_upload(file_path, host, oid, auth, file_size, True, storage_class, chunk_size) cost = (time.time() - start) * 1000 file_size = os.path.getsize(file_path) avg_speed = float(file_size) / float(cost) return oid, session_key, avg_speed def vpc_upload(self, vpc_upload_address, file_path, file_size): if vpc_upload_address.QuickCompleteMode == "enable": return if vpc_upload_address.UploadMode == "direct": self.vpc_put(vpc_upload_address, file_path) elif vpc_upload_address.UploadMode == "part": self.vpc_part_upload(vpc_upload_address.PartUploadInfo, file_path, file_size) def vpc_put(self, vpc_upload_address, file_path): put_url = vpc_upload_address.PutUrl put_headers = vpc_upload_address.PutUrlHeaders with open(file_path, 'rb') as f: resp = self.session.put(put_url, headers=put_headers, data=f) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("vpc put error, logId: {}".format(log_id)) def vpc_part_put(self, put_url, content): resp = self.session.put(put_url, data=content) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("vpc part put error, logId: {}".format(log_id)) etag = resp.headers.get("ETag", "") return etag def vpc_post(self, post_url, data, headers): resp = self.session.post(post_url, data=data, headers=headers) if resp.status_code != 200: log_id = resp.headers.get("x-tos-request-id", "") raise Exception("vpc post error, logId: {}".format(log_id)) def vpc_part_upload(self, part_upload_info, file_path, file_size): chunk_size = part_upload_info.PartSize total_num = file_size // chunk_size if file_size % chunk_size == 0: total_num -= 1 if len(part_upload_info.PartPutUrls) != total_num + 1: raise Exception("mismatch part upload") offset = 0 etag_list = [] with open(file_path, 'rb') as f: for i in range(0, total_num): put_url = part_upload_info.PartPutUrls[i] sr = FileSectionReader(f, chunk_size, init_offset=offset, can_reset=True) etag = self.vpc_part_put(put_url, sr) etag_list.append(etag) offset += chunk_size last_chunk_size = file_size - offset put_url = part_upload_info.PartPutUrls[total_num] sr = FileSectionReader(f, last_chunk_size, init_offset=offset, can_reset=True) etag = self.vpc_part_put(put_url, sr) etag_list.append(etag) post_data = self.vpc_generate_body(etag_list) self.vpc_post(part_upload_info.CompletePartUrl, post_data, part_upload_info.CompleteUrlHeaders) def vpc_generate_body(self, etag_list): if len(etag_list) == 0: raise Exception('etag list empty') s = [] for i in range(len(etag_list)): s.append("{" + '"PartNumber": {}, "ETag": {}'.format(i + 1, etag_list[i]) + "}") comma = ',' return '{"Parts":[' + comma.join(s) + ']}' @retry(tries=3, delay=1, backoff=2) def direct_upload(self, host, oid, auth, file_path, storage_class): with open(file_path, 'rb') as f: data = f.read() check_sum = crc32(data) & 0xFFFFFFFF check_sum = "%08x" % check_sum url = 'https://{}/{}'.format(host, oid) headers = {'Content-CRC32': check_sum, 'Authorization': auth} if storage_class == volcengine.vod.models.business.vod_upload_pb2.Archive: headers['X-Upload-Storage-Class'] = 'archive' if storage_class == volcengine.vod.models.business.vod_upload_pb2.IA: headers['X-Upload-Storage-Class'] = 'ia' upload_status, resp = self.put(url, file_path, headers) resp_text = str(resp, encoding='utf8') if not upload_status: raise Exception("direct upload error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) resp = json.loads(resp) if resp.get('success') is None or resp['success'] != 0: raise Exception("direct upload error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) def chunk_upload(self, file_path, host, oid, auth, size, is_large_file, storage_class, chunk_size): upload_id = self.init_upload_part(host, oid, auth, is_large_file, storage_class) n = size // chunk_size last_num = n - 1 parts = [] meta = {} with open(file_path, 'rb') as f: for i in range(0, last_num): data = f.read(chunk_size) part_number = i if is_large_file: part_number = i + 1 part, payload = self.upload_part(host, oid, auth, upload_id, part_number, data, is_large_file, storage_class) if part_number == 1: meta = payload['meta'] parts.append(part) data = f.read() if is_large_file: last_num = last_num + 1 part, payload = self.upload_part(host, oid, auth, upload_id, last_num, data, is_large_file, storage_class) if last_num == 1: meta = payload["meta"] parts.append(part) return self.upload_merge_part(host, oid, auth, upload_id, parts, is_large_file, storage_class, meta) @retry(tries=3, delay=1, backoff=2) def init_upload_part(self, host, oid, auth, is_large_file, storage_class): url = 'https://{}/{}?uploads'.format(host, oid) headers = {'Authorization': auth} if is_large_file: headers['X-Storage-Mode'] = 'gateway' if storage_class == volcengine.vod.models.business.vod_upload_pb2.Archive: headers['X-Upload-Storage-Class'] = 'archive' if storage_class == volcengine.vod.models.business.vod_upload_pb2.IA: headers['X-Upload-Storage-Class'] = 'ia' upload_status, resp = self.put_data(url, None, headers) resp_text = str(resp, encoding='utf8') if not upload_status: raise Exception("init upload error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) resp = json.loads(resp) if resp.get('success') is None or resp['success'] != 0: raise Exception("init upload error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) return resp['payload']['uploadID'] @retry(tries=3, delay=1, backoff=2) def upload_part(self, host, oid, auth, upload_id, part_number, data, is_large_file, storage_class): url = 'https://{}/{}?partNumber={}&uploadID={}'.format(host, oid, part_number, upload_id) check_sum = crc32(data) & 0xFFFFFFFF check_sum = "%08x" % check_sum headers = {'Content-CRC32': check_sum, 'Authorization': auth} if is_large_file: headers['X-Storage-Mode'] = 'gateway' if storage_class == volcengine.vod.models.business.vod_upload_pb2.Archive: headers['X-Upload-Storage-Class'] = 'archive' if storage_class == volcengine.vod.models.business.vod_upload_pb2.IA: headers['X-Upload-Storage-Class'] = 'ia' upload_status, resp = self.put_data(url, data, headers) resp_text = str(resp, encoding='utf8') if not upload_status: raise Exception("upload part error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) resp = json.loads(resp) if resp.get('success') is None or resp['success'] != 0: raise Exception("upload part error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) return check_sum, resp['payload'] @staticmethod def generate_merge_body(check_sum_list): if len(check_sum_list) == 0: raise Exception('crc32 list empty') s = [] for i in range(len(check_sum_list)): s.append('{}:{}'.format(i, check_sum_list[i])) comma = ',' return comma.join(s) @retry(tries=3, delay=1, backoff=2) def upload_merge_part(self, host, oid, auth, upload_id, check_sum_list, is_large_file, storage_class, meta): object_content_type = '' if (meta is not None) and (meta.get("ObjectContentType") is not None): object_content_type = meta['ObjectContentType'] url = 'https://{}/{}?uploadID={}&ObjectContentType={}'.format(host, oid, upload_id, object_content_type) data = self.generate_merge_body(check_sum_list) headers = {'Authorization': auth} if is_large_file: headers['X-Storage-Mode'] = 'gateway' if storage_class == volcengine.vod.models.business.vod_upload_pb2.Archive: headers['X-Upload-Storage-Class'] = 'archive' if storage_class == volcengine.vod.models.business.vod_upload_pb2.IA: headers['X-Upload-Storage-Class'] = 'ia' upload_status, resp = self.put_data(url, data, headers) resp_text = str(resp, encoding='utf8') if not upload_status: raise Exception("commit upload part error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) resp = json.loads(resp) if resp.get('success') is None or resp['success'] != 0: raise Exception("commit upload part error: {}, logid: {}".format(resp_text, headers["X-Tt-Logid"])) def get_upload_sts2_with_expired_time(self, expired_time): actions = ["vod:ApplyUploadInfo", "vod:CommitUploadInfo"] resources = [] statement = Statement.new_allow_statement(actions, resources) inline_policy = Policy([statement]) return self.sign_sts2(inline_policy, expired_time) def get_upload_sts2(self): return self.get_upload_sts2_with_expired_time(60 * 60) def upload_material(self, request): oid, session_key, avg_speed = self.upload_tob(request.SpaceName, request.FilePath, request.FileType, request.FileName, request.FileExtension, 0, request.ClientNetWorkMode, request.ClientIDCMode, request.UploadHostPrefer, request.ChunkSize) req = VodCommitUploadInfoRequest() req.SpaceName = request.SpaceName req.SessionKey = session_key req.Functions = request.Functions req.CallbackArgs = request.CallbackArgs resp = self.commit_upload_info(req) if resp.ResponseMetadata.Error.Code != '': print(resp.ResponseMetadata.RequestId) raise Exception(resp.ResponseMetadata.Error) return resp # # SubmitDirectEditTaskAsync. # # @param request VodSubmitDirectEditTaskAsyncRequest # @return VodSubmitDirectEditTaskAsyncResponse # @raise Exception def submit_direct_edit_task_async(self, request): try: params = MessageToDict(request, False, True) params['EditParam'] = json.loads(request.EditParam) res = self.json("SubmitDirectEditTaskAsync", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodSubmitDirectEditTaskAsyncResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return res # # SubmitDirectEditTaskSync. # # @param request VodSubmitDirectEditTaskSyncRequest # @return VodSubmitDirectEditTaskSyncResponse # @raise Exception def submit_direct_edit_task_sync(self, request): try: params = MessageToDict(request, False, True) params['EditParam'] = json.loads(request.EditParam) res = self.json("SubmitDirectEditTaskSync", {}, json.dumps(params)) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodSubmitDirectEditTaskSyncResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return res # # GetDirectEditResult. # # @param request VodGetDirectEditResultRequest # @return VodGetDirectEditResultResponse # @raise Exception def get_direct_edit_result(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("GetDirectEditResult", {}, jsonData) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetDirectEditResultResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return res # # GetDirectEditProgress. # # @param request VodGetDirectEditProgressRequest # @return VodGetDirectEditProgressResponse # @raise Exception def get_direct_edit_progress(self, request): try: params = MessageToDict(request, False, True) if sys.version_info[0] == 3: for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetDirectEditProgress", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetDirectEditProgressResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return res # # CancelDirectEditTask. # # @param request VodCancelDirectEditTaskRequest # @return VodCancelDirectEditTaskResponse # @raise Exception def cancel_direct_edit_task(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("CancelDirectEditTask", {}, jsonData) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCancelDirectEditTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error) else: return res # # AsyncVCreativeTask. # # @param request VodAsyncVCreativeTaskRequest # @return VodAsyncVCreativeTaskResponse # @raise Exception def async_v_creative_task(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("AsyncVCreativeTask", {}, jsonData) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodAsyncVCreativeTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error) else: return res # # GetVCreativeTaskResult. # # @param request VodGetVCreativeTaskResultRequest # @return VodGetVCreativeTaskResultResponse # @raise Exception def get_v_creative_task_result(self, request): try: params = MessageToDict(request, False, True) if sys.version_info[0] == 3: for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetVCreativeTaskResult", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetVCreativeTaskResultResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return res # # GetAllPlayInfo. # # @param request VodGetAllPlayInfoRequest # @return VodGetAllPlayInfoResponse # @raise Exception def get_all_play_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAllPlayInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAllPlayInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAllPlayInfoResponse(), True) # # GetPlayInfo. # # @param request VodGetPlayInfoRequest # @return VodGetPlayInfoResponse # @raise Exception def get_play_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetPlayInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetPlayInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetPlayInfoResponse(), True) # # GetPrivateDrmPlayAuth. # # @param request VodGetPrivateDrmPlayAuthRequest # @return VodGetPrivateDrmPlayAuthResponse # @raise Exception def get_private_drm_play_auth(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetPrivateDrmPlayAuth", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetPrivateDrmPlayAuthResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetPrivateDrmPlayAuthResponse(), True) # # GetHlsDecryptionKey. # # @param request VodGetHlsDecryptionKeyRequest # @return VodGetHlsDecryptionKeyResponse # @raise Exception def get_hls_decryption_key(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetHlsDecryptionKey", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetHlsDecryptionKeyResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetHlsDecryptionKeyResponse(), True) # # CreateHlsDecryptionKey. # # @param request VodCreateHlsDecryptionKeyRequest # @return VodCreateHlsDecryptionKeyResponse # @raise Exception def create_hls_decryption_key(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CreateHlsDecryptionKey", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateHlsDecryptionKeyResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateHlsDecryptionKeyResponse(), True) # # GetPlayInfoWithLiveTimeShiftScene. # # @param request VodGetPlayInfoWithLiveTimeShiftSceneRequest # @return VodGetPlayInfoWithLiveTimeShiftSceneResponse # @raise Exception def get_play_info_with_live_time_shift_scene(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetPlayInfoWithLiveTimeShiftScene", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetPlayInfoWithLiveTimeShiftSceneResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetPlayInfoWithLiveTimeShiftSceneResponse(), True) # # SubmitBlockObjectTasks. # # @param request VodSubmitBlockObjectTasksRequest # @return VodSubmitBlockObjectTasksResponse # @raise Exception def submit_block_object_tasks(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("SubmitBlockObjectTasks",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodSubmitBlockObjectTasksResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodSubmitBlockObjectTasksResponse(), True) # # ListBlockObjectTasks. # # @param request VodListBlockObjectTasksRequest # @return VodListBlockObjectTasksResponse # @raise Exception def list_block_object_tasks(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("ListBlockObjectTasks",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListBlockObjectTasksResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListBlockObjectTasksResponse(), True) # # UploadMediaByUrl. # # @param request VodUrlUploadRequest # @return VodUrlUploadResponse # @raise Exception def upload_media_by_url(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("UploadMediaByUrl",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUrlUploadResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUrlUploadResponse(), True) # # QueryUploadTaskInfo. # # @param request VodQueryUploadTaskInfoRequest # @return VodQueryUploadTaskInfoResponse # @raise Exception def query_upload_task_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("QueryUploadTaskInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodQueryUploadTaskInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodQueryUploadTaskInfoResponse(), True) # # ApplyUploadInfo. # # @param request VodApplyUploadInfoRequest # @return VodApplyUploadInfoResponse # @raise Exception def apply_upload_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ApplyUploadInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodApplyUploadInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodApplyUploadInfoResponse(), True) # # CommitUploadInfo. # # @param request VodCommitUploadInfoRequest # @return VodCommitUploadInfoResponse # @raise Exception def commit_upload_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CommitUploadInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCommitUploadInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCommitUploadInfoResponse(), True) # # ParseUploadManifest. # # @param request VodParseUploadManifestRequest # @return VodParseUploadManifestResponse # @raise Exception def parse_upload_manifest(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("ParseUploadManifest",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodParseUploadManifestResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodParseUploadManifestResponse(), True) # # ListFileMetaInfosByFileNames. # # @param request VodListFileMetaInfosByFileNamesRequest # @return VodListFileMetaInfosByFileNamesResponse # @raise Exception def list_file_meta_infos_by_file_names(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("ListFileMetaInfosByFileNames",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListFileMetaInfosByFileNamesResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListFileMetaInfosByFileNamesResponse(), True) # # UpdateMediaInfo. # # @param request VodUpdateMediaInfoRequest # @return VodUpdateMediaInfoResponse # @raise Exception def update_media_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateMediaInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateMediaInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateMediaInfoResponse(), True) # # UpdateMediaPublishStatus. # # @param request VodUpdateMediaPublishStatusRequest # @return VodUpdateMediaPublishStatusResponse # @raise Exception def update_media_publish_status(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateMediaPublishStatus", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateMediaPublishStatusResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateMediaPublishStatusResponse(), True) # # UpdateMediaStorageClass. # # @param request VodUpdateMediaStorageClassRequest # @return VodUpdateMediaStorageClassResponse # @raise Exception def update_media_storage_class(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateMediaStorageClass", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateMediaStorageClassResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateMediaStorageClassResponse(), True) # # GetMediaInfos. # # @param request VodGetMediaInfosRequest # @return VodGetMediaInfosResponse # @raise Exception def get_media_infos(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMediaInfos", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMediaInfosResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMediaInfosResponse(), True) # # GetMediaInfos20230701. # # @param request VodGetMediaInfosRequest # @return VodGetMediaInfosResponse # @raise Exception def get_media_infos20230701(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMediaInfos20230701", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMediaInfosResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMediaInfosResponse(), True) # # GetRecommendedPoster. # # @param request VodGetRecommendedPosterRequest # @return VodGetRecommendedPosterResponse # @raise Exception def get_recommended_poster(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetRecommendedPoster", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetRecommendedPosterResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetRecommendedPosterResponse(), True) # # DeleteMedia. # # @param request VodDeleteMediaRequest # @return VodDeleteMediaResponse # @raise Exception def delete_media(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteMedia", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteMediaResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteMediaResponse(), True) # # DeleteTranscodes. # # @param request VodDeleteTranscodesRequest # @return VodDeleteTranscodesResponse # @raise Exception def delete_transcodes(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteTranscodes", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteTranscodesResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteTranscodesResponse(), True) # # GetFileInfos. # # @param request VodGetFileInfosRequest # @return VodGetFileInfosResponse # @raise Exception def get_file_infos(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetFileInfos", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetFileInfosResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetFileInfosResponse(), True) # # UpdateFileStorageClass. # # @param request VodUpdateFileStorageClassRequest # @return VodUpdateFileStorageClassResponse # @raise Exception def update_file_storage_class(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("UpdateFileStorageClass",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateFileStorageClassResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateFileStorageClassResponse(), True) # # GetInnerAuditURLs. # # @param request VodGetInnerAuditURLsRequest # @return VodGetInnerAuditURLsResponse # @raise Exception def get_inner_audit_u_r_ls(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("GetInnerAuditURLs",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodGetInnerAuditURLsResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetInnerAuditURLsResponse(), True) # # GetAdAuditResultByVid. # # @param request VodGetAdAuditResultByVidRequest # @return VodGetAdAuditResultByVidResponse # @raise Exception def get_ad_audit_result_by_vid(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("GetAdAuditResultByVid",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodGetAdAuditResultByVidResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAdAuditResultByVidResponse(), True) # # DeleteMediaTosFile. # # @param request VodDeleteMediaTosFileRequest # @return VodDeleteMediaTosFileResponse # @raise Exception def delete_media_tos_file(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("DeleteMediaTosFile",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteMediaTosFileResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteMediaTosFileResponse(), True) # # GetMediaList. # # @param request VodGetMediaListRequest # @return VodGetMediaListResponse # @raise Exception def get_media_list(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMediaList", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMediaListResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMediaListResponse(), True) # # DeleteMaterial. # # @param request VodDeleteMaterialRequest # @return VodDeleteMaterialResponse # @raise Exception def delete_material(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteMaterial", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteMaterialResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteMaterialResponse(), True) # # GetSubtitleInfoList. # # @param request VodGetSubtitleInfoListRequest # @return VodGetSubtitleInfoListResponse # @raise Exception def get_subtitle_info_list(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetSubtitleInfoList", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetSubtitleInfoListResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetSubtitleInfoListResponse(), True) # # UpdateSubtitleStatus. # # @param request VodUpdateSubtitleStatusRequest # @return VodUpdateSubtitleStatusResponse # @raise Exception def update_subtitle_status(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateSubtitleStatus", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateSubtitleStatusResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateSubtitleStatusResponse(), True) # # UpdateSubtitleInfo. # # @param request VodUpdateSubtitleInfoRequest # @return VodUpdateSubtitleInfoResponse # @raise Exception def update_subtitle_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateSubtitleInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateSubtitleInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateSubtitleInfoResponse(), True) # # GetAuditFramesForAudit. # # @param request VodGetAuditFramesForAuditRequest # @return VodGetAuditFramesForAuditResponse # @raise Exception def get_audit_frames_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAuditFramesForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAuditFramesForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAuditFramesForAuditResponse(), True) # # GetMLFramesForAudit. # # @param request VodGetMLFramesForAuditRequest # @return VodGetMLFramesForAuditResponse # @raise Exception def get_m_l_frames_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMLFramesForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMLFramesForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMLFramesForAuditResponse(), True) # # GetBetterFramesForAudit. # # @param request VodGetBetterFramesForAuditRequest # @return VodGetBetterFramesForAuditResponse # @raise Exception def get_better_frames_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetBetterFramesForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetBetterFramesForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetBetterFramesForAuditResponse(), True) # # GetAudioInfoForAudit. # # @param request VodGetAudioInfoForAuditRequest # @return VodGetAudioInfoForAuditResponse # @raise Exception def get_audio_info_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAudioInfoForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAudioInfoForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAudioInfoForAuditResponse(), True) # # GetAutomaticSpeechRecognitionForAudit. # # @param request VodGetAutomaticSpeechRecognitionForAuditRequest # @return VodGetAutomaticSpeechRecognitionForAuditResponse # @raise Exception def get_automatic_speech_recognition_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAutomaticSpeechRecognitionForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAutomaticSpeechRecognitionForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAutomaticSpeechRecognitionForAuditResponse(), True) # # GetAudioEventDetectionForAudit. # # @param request VodGetAudioEventDetectionForAuditRequest # @return VodGetAudioEventDetectionForAuditResponse # @raise Exception def get_audio_event_detection_for_audit(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAudioEventDetectionForAudit", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAudioEventDetectionForAuditResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAudioEventDetectionForAuditResponse(), True) # # CreateVideoClassification. # # @param request VodCreateVideoClassificationRequest # @return VodCreateVideoClassificationResponse # @raise Exception def create_video_classification(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CreateVideoClassification", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateVideoClassificationResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateVideoClassificationResponse(), True) # # UpdateVideoClassification. # # @param request VodUpdateVideoClassificationRequest # @return VodUpdateVideoClassificationResponse # @raise Exception def update_video_classification(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateVideoClassification", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateVideoClassificationResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateVideoClassificationResponse(), True) # # DeleteVideoClassification. # # @param request VodDeleteVideoClassificationRequest # @return VodDeleteVideoClassificationResponse # @raise Exception def delete_video_classification(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteVideoClassification", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteVideoClassificationResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteVideoClassificationResponse(), True) # # ListVideoClassifications. # # @param request VodListVideoClassificationsRequest # @return VodListVideoClassificationsResponse # @raise Exception def list_video_classifications(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListVideoClassifications", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListVideoClassificationsResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListVideoClassificationsResponse(), True) # # ListSnapshots. # # @param request VodListSnapshotsRequest # @return VodListSnapshotsResponse # @raise Exception def list_snapshots(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListSnapshots", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListSnapshotsResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListSnapshotsResponse(), True) # # ExtractMediaMetaTask. # # @param request VodExtractMediaMetaTaskRequest # @return VodExtractMediaMetaTaskResponse # @raise Exception def extract_media_meta_task(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ExtractMediaMetaTask", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodExtractMediaMetaTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodExtractMediaMetaTaskResponse(), True) # # GetMediaEntityList. # # @param request VodGetMediaEntityListRequest # @return VodGetMediaEntityListResponse # @raise Exception def get_media_entity_list(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMediaEntityList", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMediaEntityListResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMediaEntityListResponse(), True) # # GetMediaEntity. # # @param request VodGetMediaEntityRequest # @return VodGetMediaEntityResponse # @raise Exception def get_media_entity(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetMediaEntity", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetMediaEntityResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetMediaEntityResponse(), True) # # DeleteMediaEntity. # # @param request VodDeleteMediaEntityRequest # @return VodDeleteMediaEntityResponse # @raise Exception def delete_media_entity(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("DeleteMediaEntity",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteMediaEntityResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteMediaEntityResponse(), True) # # StartWorkflow. # # @param request VodStartWorkflowRequest # @return VodStartWorkflowResponse # @raise Exception def start_workflow(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("StartWorkflow", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodStartWorkflowResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodStartWorkflowResponse(), True) # # RetrieveTranscodeResult. # # @param request VodRetrieveTranscodeResultRequest # @return VodRetrieveTranscodeResultResponse # @raise Exception def retrieve_transcode_result(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("RetrieveTranscodeResult", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodRetrieveTranscodeResultResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodRetrieveTranscodeResultResponse(), True) # # GetWorkflowExecution. # # @param request VodGetWorkflowExecutionStatusRequest # @return VodGetWorkflowExecutionStatusResponse # @raise Exception def get_workflow_execution(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetWorkflowExecution", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetWorkflowExecutionStatusResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetWorkflowExecutionStatusResponse(), True) # # GetWorkflowExecutionResult. # # @param request VodGetWorkflowResultRequest # @return VodGetWorkflowResultResponse # @raise Exception def get_workflow_execution_result(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetWorkflowExecutionResult", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetWorkflowResultResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetWorkflowResultResponse(), True) # # CreateTaskTemplate. # # @param request VodCreateTaskTemplateRequest # @return VodCreateTaskTemplateResponse # @raise Exception def create_task_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("CreateTaskTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateTaskTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateTaskTemplateResponse(), True) # # UpdateTaskTemplate. # # @param request VodUpdateTaskTemplateRequest # @return VodUpdateTaskTemplateResponse # @raise Exception def update_task_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("UpdateTaskTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateTaskTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateTaskTemplateResponse(), True) # # GetTaskTemplate. # # @param request VodGetTaskTemplateRequest # @return VodGetTaskTemplateResponse # @raise Exception def get_task_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetTaskTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetTaskTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetTaskTemplateResponse(), True) # # ListTaskTemplate. # # @param request VodListTaskTemplateRequest # @return VodListTaskTemplateResponse # @raise Exception def list_task_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListTaskTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListTaskTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListTaskTemplateResponse(), True) # # DeleteTaskTemplate. # # @param request VodDeleteTaskTemplateRequest # @return VodDeleteTaskTemplateResponse # @raise Exception def delete_task_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("DeleteTaskTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteTaskTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteTaskTemplateResponse(), True) # # CreateWorkflowTemplate. # # @param request VodCreateWorkflowTemplateRequest # @return VodCreateWorkflowTemplateResponse # @raise Exception def create_workflow_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("CreateWorkflowTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateWorkflowTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateWorkflowTemplateResponse(), True) # # UpdateWorkflowTemplate. # # @param request VodUpdateWorkflowTemplateRequest # @return VodUpdateWorkflowTemplateResponse # @raise Exception def update_workflow_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("UpdateWorkflowTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateWorkflowTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateWorkflowTemplateResponse(), True) # # GetWorkflowTemplate. # # @param request VodGetWorkflowTemplateRequest # @return VodGetWorkflowTemplateResponse # @raise Exception def get_workflow_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetWorkflowTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetWorkflowTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetWorkflowTemplateResponse(), True) # # ListWorkflowTemplate. # # @param request VodListWorkflowTemplateRequest # @return VodListWorkflowTemplateResponse # @raise Exception def list_workflow_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListWorkflowTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListWorkflowTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListWorkflowTemplateResponse(), True) # # DeleteWorkflowTemplate. # # @param request VodDeleteWorkflowTemplateRequest # @return VodDeleteWorkflowTemplateResponse # @raise Exception def delete_workflow_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("DeleteWorkflowTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteWorkflowTemplateResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteWorkflowTemplateResponse(), True) # # CreateWatermarkTemplate. # # @param request VodCreateWatermarkRequest # @return VodCreateWatermarkResponse # @raise Exception def create_watermark_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("CreateWatermarkTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateWatermarkResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateWatermarkResponse(), True) # # UpdateWatermarkTemplate. # # @param request VodUpdateWatermarkRequest # @return VodUpdateWatermarkResponse # @raise Exception def update_watermark_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("UpdateWatermarkTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateWatermarkResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateWatermarkResponse(), True) # # GetWatermarkTemplate. # # @param request VodGetWatermarkRequest # @return VodGetWatermarkResponse # @raise Exception def get_watermark_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetWatermarkTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetWatermarkResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetWatermarkResponse(), True) # # ListWatermarkTemplate. # # @param request VodListWatermarkRequest # @return VodListWatermarkResponse # @raise Exception def list_watermark_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListWatermarkTemplate", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListWatermarkResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListWatermarkResponse(), True) # # DeleteWatermarkTemplate. # # @param request VodDeleteWatermarkRequest # @return VodDeleteWatermarkResponse # @raise Exception def delete_watermark_template(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("DeleteWatermarkTemplate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteWatermarkResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteWatermarkResponse(), True) # # DeleteSpace. # # @param request VodDeleteSpaceRequest # @return VodDeleteSpaceResponse # @raise Exception def delete_space(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteSpace", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteSpaceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteSpaceResponse(), True) # # CreateSpace. # # @param request VodCreateSpaceRequest # @return VodCreateSpaceResponse # @raise Exception def create_space(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CreateSpace", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateSpaceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateSpaceResponse(), True) # # ListSpace. # # @param request VodListSpaceRequest # @return VodListSpaceResponse # @raise Exception def list_space(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListSpace", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListSpaceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListSpaceResponse(), True) # # GetSpaceDetail. # # @param request VodGetSpaceDetailRequest # @return VodGetSpaceDetailResponse # @raise Exception def get_space_detail(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetSpaceDetail", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetSpaceDetailResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetSpaceDetailResponse(), True) # # UpdateSpace. # # @param request VodUpdateSpaceRequest # @return VodUpdateSpaceResponse # @raise Exception def update_space(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateSpace", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateSpaceResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateSpaceResponse(), True) # # UpdateSpaceUploadConfig. # # @param request VodUpdateSpaceUploadConfigRequest # @return VodUpdateSpaceUploadConfigResponse # @raise Exception def update_space_upload_config(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateSpaceUploadConfig", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateSpaceUploadConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateSpaceUploadConfigResponse(), True) # # DescribeUploadSpaceConfig. # # @param request VodDescribeUploadSpaceConfigRequest # @return VodDescribeUploadSpaceConfigResponse # @raise Exception def describe_upload_space_config(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeUploadSpaceConfig", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeUploadSpaceConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeUploadSpaceConfigResponse(), True) # # UpdateUploadSpaceConfig. # # @param request VodUpdateUploadSpaceConfigRequest # @return VodUpdateUploadSpaceConfigResponse # @raise Exception def update_upload_space_config(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("UpdateUploadSpaceConfig",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodUpdateUploadSpaceConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateUploadSpaceConfigResponse(), True) # # AddDomainToScheduler. # # @param request VodAddDomainToSchedulerRequest # @return VodAddDomainToSchedulerResponse # @raise Exception def add_domain_to_scheduler(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("AddDomainToScheduler", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodAddDomainToSchedulerResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodAddDomainToSchedulerResponse(), True) # # RemoveDomainFromScheduler. # # @param request VodRemoveDomainFromSchedulerRequest # @return VodRemoveDomainFromSchedulerResponse # @raise Exception def remove_domain_from_scheduler(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("RemoveDomainFromScheduler", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodRemoveDomainFromSchedulerResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodRemoveDomainFromSchedulerResponse(), True) # # UpdateDomainPlayRule. # # @param request VodUpdateDomainPlayRuleRequest # @return VodUpdateDomainPlayRuleResponse # @raise Exception def update_domain_play_rule(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateDomainPlayRule", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateDomainPlayRuleResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateDomainPlayRuleResponse(), True) # # StartDomain. # # @param request VodStartDomainRequest # @return VodStartDomainResponse # @raise Exception def start_domain(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("StartDomain", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodStartDomainResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodStartDomainResponse(), True) # # StopDomain. # # @param request VodStopDomainRequest # @return VodStopDomainResponse # @raise Exception def stop_domain(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("StopDomain", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodStopDomainResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodStopDomainResponse(), True) # # DeleteDomain. # # @param request VodDeleteDomainRequest # @return VodDeleteDomainResponse # @raise Exception def delete_domain(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DeleteDomain", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDeleteDomainResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDeleteDomainResponse(), True) # # ListDomain. # # @param request VodListDomainRequest # @return VodListDomainResponse # @raise Exception def list_domain(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListDomain", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListDomainResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListDomainResponse(), True) # # CreateCdnRefreshTask. # # @param request VodCreateCdnRefreshTaskRequest # @return VodCreateCdnRefreshTaskResponse # @raise Exception def create_cdn_refresh_task(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CreateCdnRefreshTask", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateCdnRefreshTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateCdnRefreshTaskResponse(), True) # # CreateCdnPreloadTask. # # @param request VodCreateCdnPreloadTaskRequest # @return VodCreateCdnPreloadTaskResponse # @raise Exception def create_cdn_preload_task(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("CreateCdnPreloadTask", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCreateCdnPreloadTaskResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateCdnPreloadTaskResponse(), True) # # ListCdnTasks. # # @param request VodListCdnTasksRequest # @return VodListCdnTasksResponse # @raise Exception def list_cdn_tasks(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnTasks", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListCdnTasksResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListCdnTasksResponse(), True) # # ListCdnAccessLog. # # @param request VodListCdnAccessLogRequest # @return VodListCdnAccessLogResponse # @raise Exception def list_cdn_access_log(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnAccessLog", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListCdnAccessLogResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListCdnAccessLogResponse(), True) # # ListCdnTopAccessUrl. # # @param request VodListCdnTopAccessUrlRequest # @return VodListCdnTopAccessUrlResponse # @raise Exception def list_cdn_top_access_url(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnTopAccessUrl", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListCdnTopAccessUrlResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListCdnTopAccessUrlResponse(), True) # # ListCdnTopAccess. # # @param request VodListCdnTopAccessRequest # @return VodListCdnTopAccessResponse # @raise Exception def list_cdn_top_access(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnTopAccess", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodListCdnTopAccessResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodListCdnTopAccessResponse(), True) # # ListCdnUsageData. # # @param request VodListCdnUsageDataRequest # @return VodCdnStatisticsCommonResponse # @raise Exception def list_cdn_usage_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnUsageData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCdnStatisticsCommonResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCdnStatisticsCommonResponse(), True) # # ListCdnStatusData. # # @param request VodListCdnStatusDataRequest # @return VodCdnStatisticsCommonResponse # @raise Exception def list_cdn_status_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnStatusData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCdnStatisticsCommonResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCdnStatisticsCommonResponse(), True) # # DescribeIpInfo. # # @param request VodDescribeIPInfoRequest # @return VodDescribeIPInfoResponse # @raise Exception def describe_ip_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeIpInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeIPInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeIPInfoResponse(), True) # # ListCdnPvData. # # @param request VodListCdnPvDataRequest # @return VodCdnStatisticsCommonResponse # @raise Exception def list_cdn_pv_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("ListCdnPvData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodCdnStatisticsCommonResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCdnStatisticsCommonResponse(), True) # # SubmitBlockTasks. # # @param request VodSubmitBlockTasksRequest # @return VodSubmitBlockTasksResponse # @raise Exception def submit_block_tasks(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("SubmitBlockTasks",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodSubmitBlockTasksResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodSubmitBlockTasksResponse(), True) # # GetContentBlockTasks. # # @param request VodGetContentBlockTasksRequest # @return VodGetContentBlockTasksResponse # @raise Exception def get_content_block_tasks(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("GetContentBlockTasks",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetContentBlockTasksResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetContentBlockTasksResponse(), True) # # CreateDomain. # # @param request VodCreateDomainV2Request # @return VodCreateDomainV2Response # @raise Exception def create_domain(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("CreateDomain",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodCreateDomainV2Response(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodCreateDomainV2Response(), True) # # UpdateDomainExpire. # # @param request VodUpdateDomainExpireV2Request # @return VodUpdateDomainExpireV2Response # @raise Exception def update_domain_expire(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateDomainExpire", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateDomainExpireV2Response(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateDomainExpireV2Response(), True) # # UpdateDomainAuthConfig. # # @param request VodUpdateDomainAuthConfigV2Request # @return VodUpdateDomainAuthConfigV2Response # @raise Exception def update_domain_auth_config(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateDomainAuthConfig", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateDomainAuthConfigV2Response(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateDomainAuthConfigV2Response(), True) # # AddOrUpdateCertificate. # # @param request AddOrUpdateCertificateV2Request # @return AddOrUpdateCertificateV2Response # @raise Exception def add_or_update_certificate(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.post("AddOrUpdateCertificate",{},params) except Exception as Argument: try: resp = Parse(Argument.__str__(), AddOrUpdateCertificateV2Response(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, AddOrUpdateCertificateV2Response(), True) # # UpdateDomainUrlAuthConfig. # # @param request VodUpdateDomainUrlAuthConfigV2Request # @return VodUpdateDomainUrlAuthConfigV2Response # @raise Exception def update_domain_url_auth_config(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("UpdateDomainUrlAuthConfig", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodUpdateDomainUrlAuthConfigV2Response(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateDomainUrlAuthConfigV2Response(), True) # # VerifyDomainOwner. # # @param request VodVerifyDomainOwnerRequest # @return VodVerifyDomainOwnerResponse # @raise Exception def verify_domain_owner(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("VerifyDomainOwner", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodVerifyDomainOwnerResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodVerifyDomainOwnerResponse(), True) # # DescribeDomainVerifyContent. # # @param request VodDescribeDomainVerifyContentRequest # @return VodDescribeDomainVerifyContentResponse # @raise Exception def describe_domain_verify_content(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeDomainVerifyContent", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeDomainVerifyContentResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeDomainVerifyContentResponse(), True) # # UpdateDomainConfig. # # @param request VodUpdateDomainConfigRequest # @return VodUpdateDomainConfigResponse # @raise Exception def update_domain_config(self, request): try: jsonData = MessageToJson(request, False, True) res = self.json("UpdateDomainConfig",{},jsonData) except Exception as Argument: try: ArgumentStr = Argument.args[0].decode("utf-8") resp = Parse(ArgumentStr, VodUpdateDomainConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodUpdateDomainConfigResponse(), True) # # DescribeDomainConfig. # # @param request VodDescribeDomainConfigRequest # @return VodDescribeDomainConfigResponse # @raise Exception def describe_domain_config(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeDomainConfig", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeDomainConfigResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeDomainConfigResponse(), True) # # DescribeCdnEdgeIp. # # @param request VodDescribeCdnEdgeIpRequest # @return VodDescribeCdnEdgeIpResponse # @raise Exception def describe_cdn_edge_ip(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeCdnEdgeIp", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeCdnEdgeIpResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeCdnEdgeIpResponse(), True) # # DescribeCdnRegionAndIsp. # # @param request VodDescribeCdnRegionAndIspRequest # @return VodDescribeCdnRegionAndIspResponse # @raise Exception def describe_cdn_region_and_isp(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeCdnRegionAndIsp", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeCdnRegionAndIspResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeCdnRegionAndIspResponse(), True) # # AddCallbackSubscription. # # @param request VodAddCallbackSubscriptionRequest # @return VodAddCallbackSubscriptionResponse # @raise Exception def add_callback_subscription(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("AddCallbackSubscription", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodAddCallbackSubscriptionResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodAddCallbackSubscriptionResponse(), True) # # SetCallbackEvent. # # @param request VodSetCallbackEventRequest # @return VodSetCallbackEventResponse # @raise Exception def set_callback_event(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("SetCallbackEvent", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodSetCallbackEventResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodSetCallbackEventResponse(), True) # # GetSmartStrategyLitePlayInfo. # # @param request VodGetSmartStrategyLitePlayInfoRequest # @return VodGetSmartStrategyLitePlayInfoResponse # @raise Exception def get_smart_strategy_lite_play_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetSmartStrategyLitePlayInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetSmartStrategyLitePlayInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetSmartStrategyLitePlayInfoResponse(), True) # # GetAppInfo. # # @param request VodGetAppInfoRequest # @return VodGetAppInfoResponse # @raise Exception def get_app_info(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("GetAppInfo", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodGetAppInfoResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodGetAppInfoResponse(), True) # # DescribeVodSpaceTranscodeData. # # @param request DescribeVodSpaceTranscodeDataRequest # @return DescribeVodSpaceTranscodeDataResponse # @raise Exception def describe_vod_space_transcode_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceTranscodeData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceTranscodeDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceTranscodeDataResponse(), True) # # DescribeVodSpaceAIStatisData. # # @param request DescribeVodSpaceAIStatisDataRequest # @return DescribeVodSpaceAIStatisDataResponse # @raise Exception def describe_vod_space_a_i_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceAIStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceAIStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceAIStatisDataResponse(), True) # # DescribeVodSpaceSubtitleStatisData. # # @param request DescribeVodSpaceSubtitleStatisDataRequest # @return DescribeVodSpaceSubtitleStatisDataResponse # @raise Exception def describe_vod_space_subtitle_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceSubtitleStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceSubtitleStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceSubtitleStatisDataResponse(), True) # # DescribeVodSpaceDetectStatisData. # # @param request DescribeVodSpaceDetectStatisDataRequest # @return DescribeVodSpaceDetectStatisDataResponse # @raise Exception def describe_vod_space_detect_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceDetectStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceDetectStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceDetectStatisDataResponse(), True) # # DescribeVodSpaceWorkflowDetailData. # # @param request DescribeVodSpaceWorkflowDetailDataRequest # @return DescribeVodSpaceWorkflowDetailDataResponse # @raise Exception def describe_vod_space_workflow_detail_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceWorkflowDetailData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceWorkflowDetailDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceWorkflowDetailDataResponse(), True) # # DescribeVodSpaceEditDetailData. # # @param request DescribeVodSpaceEditDetailDataRequest # @return DescribeVodSpaceEditDetailDataResponse # @raise Exception def describe_vod_space_edit_detail_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceEditDetailData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceEditDetailDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceEditDetailDataResponse(), True) # # DescribeVodSnapshotData. # # @param request DescribeVodSnapshotDataRequest # @return DescribeVodSnapshotDataResponse # @raise Exception def describe_vod_snapshot_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSnapshotData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSnapshotDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSnapshotDataResponse(), True) # # DescribeVodSpaceStorageData. # # @param request VodDescribeVodSpaceStorageDataRequest # @return VodDescribeVodSpaceStorageDataResponse # @raise Exception def describe_vod_space_storage_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceStorageData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeVodSpaceStorageDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeVodSpaceStorageDataResponse(), True) # # DescribeVodDomainTrafficData. # # @param request VodDescribeVodDomainTrafficDataRequest # @return VodDescribeVodDomainTrafficDataResponse # @raise Exception def describe_vod_domain_traffic_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodDomainTrafficData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeVodDomainTrafficDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeVodDomainTrafficDataResponse(), True) # # DescribeVodDomainBandwidthData. # # @param request VodDescribeVodDomainBandwidthDataRequest # @return VodDescribeVodDomainBandwidthDataResponse # @raise Exception def describe_vod_domain_bandwidth_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodDomainBandwidthData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), VodDescribeVodDomainBandwidthDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, VodDescribeVodDomainBandwidthDataResponse(), True) # # DescribeVodEnhanceImageData. # # @param request DescribeVodEnhanceImageDataRequest # @return DescribeVodEnhanceImageDataResponse # @raise Exception def describe_vod_enhance_image_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodEnhanceImageData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodEnhanceImageDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodEnhanceImageDataResponse(), True) # # DescribeVodSpaceEditStatisData. # # @param request DescribeVodSpaceEditStatisDataRequest # @return DescribeVodSpaceEditStatisDataResponse # @raise Exception def describe_vod_space_edit_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodSpaceEditStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodSpaceEditStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodSpaceEditStatisDataResponse(), True) # # DescribeVodPlayedStatisData. # # @param request DescribeVodPlayedStatisDataRequest # @return DescribeVodPlayedStatisDataResponse # @raise Exception def describe_vod_played_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodPlayedStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodPlayedStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodPlayedStatisDataResponse(), True) # # DescribeVodMostPlayedStatisData. # # @param request DescribeVodMostPlayedStatisDataRequest # @return DescribeVodMostPlayedStatisDataResponse # @raise Exception def describe_vod_most_played_statis_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodMostPlayedStatisData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodMostPlayedStatisDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodMostPlayedStatisDataResponse(), True) # # DescribeVodRealtimeMediaData. # # @param request DescribeVodRealtimeMediaDataRequest # @return DescribeVodRealtimeMediaDataResponse # @raise Exception def describe_vod_realtime_media_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodRealtimeMediaData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodRealtimeMediaDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodRealtimeMediaDataResponse(), True) # # DescribeVodRealtimeMediaDetailData. # # @param request DescribeVodRealtimeMediaDetailDataRequest # @return DescribeVodRealtimeMediaDetailDataResponse # @raise Exception def describe_vod_realtime_media_detail_data(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodRealtimeMediaDetailData", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodRealtimeMediaDetailDataResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodRealtimeMediaDetailDataResponse(), True) # # DescribeVodVidTrafficFileLog. # # @param request DescribeVodVidTrafficFileLogRequest # @return DescribeVodVidTrafficFileLogResponse # @raise Exception def describe_vod_vid_traffic_file_log(self, request): try: if sys.version_info[0] == 3: jsonData = MessageToJson(request, False, True) params = json.loads(jsonData) for k, v in params.items(): if isinstance(v, (int, float, bool, str)) is True: continue else: params[k] = json.dumps(v) else: params = MessageToDict(request, False, True) for k, v in params.items(): if isinstance(v, (int, float, bool, str, unicode)) is True: continue else: params[k] = json.dumps(v) res = self.get("DescribeVodVidTrafficFileLog", params) except Exception as Argument: try: resp = Parse(Argument.__str__(), DescribeVodVidTrafficFileLogResponse(), True) except Exception: raise Argument else: raise Exception(resp.ResponseMetadata.Error.Code) else: return Parse(res, DescribeVodVidTrafficFileLogResponse(), True) ================================================ FILE: volcengine/vod/VodServiceConfig.py ================================================ # coding:utf-8 from __future__ import print_function import threading from zlib import crc32 from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service class VodServiceConfig(Service): _instance_lock = threading.Lock() def __new__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): with cls._instance_lock: if not hasattr(cls, "_instance"): cls._instance = object.__new__(cls) return cls._instance def __init__(self, region='cn-north-1'): self.service_info = VodServiceConfig.get_service_info(region) self.api_info = VodServiceConfig.get_api_info() self.domain_cache = {} self.fallback_domain_weights = {} self.update_interval = 10 self.lock = threading.Lock() super(VodServiceConfig, self).__init__(self.service_info, self.api_info) @staticmethod def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("vod.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vod', 'cn-north-1'), 60, 60,"https"), 'ap-southeast-1': ServiceInfo("vod.ap-southeast-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vod', 'ap-southeast-1'), 60, 60,"https"), } service_info = service_info_map.get(region, None) if not service_info: service_info = ServiceInfo("vod.{}.volcengineapi.com".format(region), {'Accept': 'application/json'}, Credentials('', '', 'vod', region), 60, 60, "https") return service_info @staticmethod def get_api_info(): api_info = { # 播放 "GetPlayInfo": ApiInfo("GET", "/", {"Action": "GetPlayInfo", "Version": "2020-08-01"}, {}, {}), "GetAllPlayInfo": ApiInfo("GET", "/", {"Action": "GetAllPlayInfo", "Version": "2022-01-01"}, {}, {}), "GetPrivateDrmPlayAuth": ApiInfo("GET", "/", {"Action": "GetPrivateDrmPlayAuth", "Version": "2020-08-01"}, {}, {}), "CreateHlsDecryptionKey": ApiInfo("GET", "/", {"Action": "CreateHlsDecryptionKey", "Version": "2023-07-01"}, {}, {}), "GetHlsDecryptionKey": ApiInfo("GET", "/", {"Action": "GetHlsDecryptionKey", "Version": "2020-08-01"}, {}, {}), "DescribeDrmDataKey": ApiInfo("GET", "/", {"Action": "DescribeDrmDataKey", "Version": "2023-07-01"}, {}, {}), "GetPlayInfoWithLiveTimeShiftScene": ApiInfo("GET", "/", {"Action": "GetPlayInfoWithLiveTimeShiftScene", "Version": "2021-11-01"}, {}, {}), # 上传 "UploadMediaByUrl": ApiInfo("POST", "/", {"Action": "UploadMediaByUrl", "Version": "2020-08-01"}, {}, {}), "QueryUploadTaskInfo": ApiInfo("GET", "/", {"Action": "QueryUploadTaskInfo", "Version": "2020-08-01"}, {}, {}), "ApplyUploadInfo": ApiInfo("GET", "/", {"Action": "ApplyUploadInfo", "Version": "2022-01-01"}, {}, {}), "CommitUploadInfo": ApiInfo("GET", "/", {"Action": "CommitUploadInfo", "Version": "2022-01-01"}, {}, {}), "ParseUploadManifest": ApiInfo("POST", "/", {"Action": "ParseUploadManifest", "Version": "2022-01-01"}, {}, {}), # 媒资 "GetMediaEntityList": ApiInfo("GET", "/", {"Action": "GetMediaEntityList", "Version": "2023-07-01"}, {}, {}), "GetMediaEntity": ApiInfo("GET", "/", {"Action": "GetMediaEntity", "Version": "2023-07-01"}, {}, {}), "DeleteMediaEntity": ApiInfo("POST", "/", {"Action": "DeleteMediaEntity", "Version": "2023-07-01"}, {}, {}), "UpdateMediaInfo": ApiInfo("GET", "/", {"Action": "UpdateMediaInfo", "Version": "2020-08-01"}, {}, {}), "UpdateMediaPublishStatus": ApiInfo("GET", "/", {"Action": "UpdateMediaPublishStatus", "Version": "2020-08-01"}, {}, {}), "UpdateMediaStorageClass": ApiInfo("GET", "/", {"Action": "UpdateMediaStorageClass", "Version": "2022-12-01"}, {}, {}), "GetInnerAuditURLs": ApiInfo("POST", "/", {"Action": "GetInnerAuditURLs", "Version": "2023-07-01"}, {}, {}), "GetAdAuditResultByVid": ApiInfo("POST", "/", {"Action": "GetAdAuditResultByVid", "Version": "2023-07-01"}, {}, {}), "GetMediaInfos": ApiInfo("GET", "/", {"Action": "GetMediaInfos", "Version": "2022-12-01"}, {}, {}), "GetMediaInfos20230701": ApiInfo("GET", "/", {"Action": "GetMediaInfos", "Version": "2023-07-01"}, {}, {}), "GetRecommendedPoster": ApiInfo("GET", "/", {"Action": "GetRecommendedPoster", "Version": "2020-08-01"}, {}, {}), "DeleteMedia": ApiInfo("GET", "/", {"Action": "DeleteMedia", "Version": "2020-08-01"}, {}, {}), "DeleteTranscodes": ApiInfo("GET", "/", {"Action": "DeleteTranscodes", "Version": "2020-08-01"}, {}, {}), "DeleteMediaTosFile": ApiInfo("POST", "/", {"Action": "DeleteMediaTosFile", "Version": "2022-12-01"}, {}, {}), "GetFileInfos": ApiInfo("GET", "/", {"Action": "GetFileInfos", "Version": "2023-07-01"}, {}, {}), "GetMediaList": ApiInfo("GET", "/", {"Action": "GetMediaList", "Version": "2022-12-01"}, {}, {}), "DeleteMaterial": ApiInfo("GET", "/", {"Action": "DeleteMaterial", "Version": "2023-07-01"}, {}, {}), "GetSubtitleInfoList": ApiInfo("GET", "/", {"Action": "GetSubtitleInfoList", "Version": "2020-08-01"}, {}, {}), "UpdateSubtitleStatus": ApiInfo("GET", "/", {"Action": "UpdateSubtitleStatus", "Version": "2020-08-01"}, {}, {}), "UpdateSubtitleInfo": ApiInfo("GET", "/", {"Action": "UpdateSubtitleInfo", "Version": "2020-08-01"}, {}, {}), "GetAuditFramesForAudit": ApiInfo("GET", "/", {"Action": "GetAuditFramesForAudit", "Version": "2021-11-01"}, {}, {}), "GetMLFramesForAudit": ApiInfo("GET", "/", {"Action": "GetMLFramesForAudit", "Version": "2021-11-01"}, {}, {}), "GetBetterFramesForAudit": ApiInfo("GET", "/", {"Action": "GetBetterFramesForAudit", "Version": "2021-11-01"}, {}, {}), "GetAudioInfoForAudit": ApiInfo("GET", "/", {"Action": "GetAudioInfoForAudit", "Version": "2021-11-01"}, {}, {}), "GetAutomaticSpeechRecognitionForAudit": ApiInfo("GET", "/", {"Action": "GetAutomaticSpeechRecognitionForAudit", "Version": "2021-11-01"}, {}, {}), "GetAudioEventDetectionForAudit": ApiInfo("GET", "/", {"Action": "GetAudioEventDetectionForAudit", "Version": "2021-11-01"}, {}, {}), "CreateVideoClassification": ApiInfo("GET", "/", {"Action": "CreateVideoClassification", "Version": "2021-01-01"}, {}, {}), "UpdateVideoClassification": ApiInfo("GET", "/", {"Action": "UpdateVideoClassification", "Version": "2021-01-01"}, {}, {}), "DeleteVideoClassification": ApiInfo("GET", "/", {"Action": "DeleteVideoClassification", "Version": "2021-01-01"}, {}, {}), "ListVideoClassifications": ApiInfo("GET", "/", {"Action": "ListVideoClassifications", "Version": "2021-01-01"}, {}, {}), "ListSnapshots": ApiInfo("GET", "/", {"Action": "ListSnapshots", "Version": "2021-01-01"}, {}, {}), "ExtractMediaMetaTask": ApiInfo("GET", "/", {"Action": "ExtractMediaMetaTask", "Version": "2022-01-01"}, {}, {}), #Object "SubmitBlockObjectTasks": ApiInfo("POST", "/",{"Action": "SubmitBlockObjectTasks", "Version": "2023-07-01"},{}, {}), "ListBlockObjectTasks": ApiInfo("POST", "/",{"Action": "ListBlockObjectTasks", "Version": "2023-07-01"},{}, {}), # 转码 "StartWorkflow": ApiInfo("GET", "/", {"Action": "StartWorkflow", "Version": "2020-08-01"}, {}, {}), "RetrieveTranscodeResult": ApiInfo("GET", "/", {"Action": "RetrieveTranscodeResult", "Version": "2020-08-01"}, {}, {}), "GetWorkflowExecution": ApiInfo("GET", "/", {"Action": "GetWorkflowExecution", "Version": "2020-08-01"}, {}, {}), "GetWorkflowExecutionResult": ApiInfo("GET", "/", {"Action": "GetWorkflowExecutionResult", "Version": "2022-12-01"}, {}, {}), "GetTaskTemplate": ApiInfo("GET", "/", {"Action": "GetTaskTemplate", "Version": "2023-07-01"}, {},{}), "CreateTaskTemplate": ApiInfo("POST", "/", {"Action": "CreateTaskTemplate", "Version": "2023-07-01"}, {}, {}), "UpdateTaskTemplate": ApiInfo("POST", "/", {"Action": "UpdateTaskTemplate", "Version": "2023-07-01"}, {}, {}), "ListTaskTemplate": ApiInfo("GET", "/", {"Action": "ListTaskTemplate", "Version": "2023-07-01"}, {}, {}), "DeleteTaskTemplate": ApiInfo("POST", "/", {"Action": "DeleteTaskTemplate", "Version": "2023-07-01"}, {}, {}), "GetWorkflowTemplate": ApiInfo("GET", "/", {"Action": "GetWorkflowTemplate", "Version": "2023-07-01"}, {}, {}), "CreateWorkflowTemplate": ApiInfo("POST", "/", {"Action": "CreateWorkflowTemplate", "Version": "2023-07-01"}, {}, {}), "UpdateWorkflowTemplate": ApiInfo("POST", "/", {"Action": "UpdateWorkflowTemplate", "Version": "2023-07-01"}, {}, {}), "ListWorkflowTemplate": ApiInfo("GET", "/", {"Action": "ListWorkflowTemplate", "Version": "2023-07-01"}, {}, {}), "DeleteWorkflowTemplate": ApiInfo("POST", "/", {"Action": "DeleteWorkflowTemplate", "Version": "2023-07-01"}, {},{}), "GetWatermarkTemplate": ApiInfo("GET", "/", {"Action": "GetWatermarkTemplate", "Version": "2023-07-01"}, {}, {}), "CreateWatermarkTemplate": ApiInfo("POST", "/", {"Action": "CreateWatermarkTemplate", "Version": "2023-07-01"}, {}, {}), "UpdateWatermarkTemplate": ApiInfo("POST", "/", {"Action": "UpdateWatermarkTemplate", "Version": "2023-07-01"}, {}, {}), "ListWatermarkTemplate": ApiInfo("GET", "/", {"Action": "ListWatermarkTemplate", "Version": "2023-07-01"}, {}, {}), "DeleteWatermarkTemplate": ApiInfo("POST", "/", {"Action": "DeleteWatermarkTemplate", "Version": "2023-07-01"}, {}, {}), # 空间管理 "DeleteSpace": ApiInfo("GET", "/", {"Action": "DeleteSpace", "Version": "2023-07-01"}, {}, {}), "CreateSpace": ApiInfo("GET", "/", {"Action": "CreateSpace", "Version": "2021-01-01"}, {}, {}), "ListSpace": ApiInfo("GET", "/", {"Action": "ListSpace", "Version": "2021-01-01"}, {}, {}), "GetSpaceDetail": ApiInfo("GET", "/", {"Action": "GetSpaceDetail", "Version": "2022-01-01"}, {}, {}), "UpdateSpace": ApiInfo("GET", "/", {"Action": "UpdateSpace", "Version": "2021-01-01"}, {}, {}), "UpdateSpaceUploadConfig": ApiInfo("GET", "/", {"Action": "UpdateSpaceUploadConfig", "Version": "2022-01-01"}, {}, {}), "DescribeVodSpaceStorageData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceStorageData", "Version": "2023-07-01"}, {}, {}), "DescribeUploadSpaceConfig": ApiInfo("GET", "/", {"Action": "DescribeUploadSpaceConfig", "Version": "2023-07-01"}, {}, {}), "UpdateUploadSpaceConfig": ApiInfo("POST", "/", {"Action": "UpdateUploadSpaceConfig", "Version": "2023-07-01"}, {}, {}), # 分发加速 "AddDomainToScheduler": ApiInfo("GET", "/", {"Action": "AddDomainToScheduler", "Version": "2023-07-01"}, {}, {}), "RemoveDomainFromScheduler": ApiInfo("GET", "/", {"Action": "RemoveDomainFromScheduler", "Version": "2023-07-01"}, {}, {}), "UpdateDomainPlayRule": ApiInfo("GET", "/", {"Action": "UpdateDomainPlayRule", "Version": "2023-07-01"}, {}, {}), "StartDomain": ApiInfo("GET", "/", {"Action": "StartDomain", "Version": "2023-07-01"}, {}, {}), "StopDomain": ApiInfo("GET", "/", {"Action": "StopDomain", "Version": "2023-07-01"}, {}, {}), "DeleteDomain": ApiInfo("GET", "/", {"Action": "DeleteDomain", "Version": "2023-07-01"}, {}, {}), "ListDomain": ApiInfo("GET", "/", {"Action": "ListDomain", "Version": "2023-01-01"}, {}, {}), "CreateCdnRefreshTask": ApiInfo("GET", "/", {"Action": "CreateCdnRefreshTask", "Version": "2021-01-01"}, {}, {}), "CreateCdnPreloadTask": ApiInfo("GET", "/", {"Action": "CreateCdnPreloadTask", "Version": "2021-01-01"}, {}, {}), "ListCdnTasks": ApiInfo("GET", "/", {"Action": "ListCdnTasks", "Version": "2022-01-01"}, {}, {}), "ListCdnAccessLog": ApiInfo("GET", "/", {"Action": "ListCdnAccessLog", "Version": "2022-01-01"}, {}, {}), "ListCdnTopAccessUrl": ApiInfo("GET", "/", {"Action": "ListCdnTopAccessUrl", "Version": "2022-01-01"}, {}, {}), "ListCdnTopAccess": ApiInfo("GET", "/", {"Action": "ListCdnTopAccess", "Version": "2023-07-01"}, {}, {}), "DescribeVodDomainBandwidthData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainBandwidthData", "Version": "2023-07-01"}, {}, {}), "DescribeVodDomainTrafficData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainTrafficData", "Version": "2023-07-01"}, {}, {}), "ListCdnUsageData": ApiInfo("GET", "/", {"Action": "ListCdnUsageData", "Version": "2022-12-01"}, {}, {}), "ListCdnStatusData": ApiInfo("GET", "/", {"Action": "ListCdnStatusData", "Version": "2022-01-01"}, {}, {}), "DescribeIpInfo": ApiInfo("GET", "/", {"Action": "DescribeIpInfo", "Version": "2022-01-01"}, {}, {}), "ListCdnPvData": ApiInfo("GET", "/", {"Action": "ListCdnPvData", "Version": "2022-01-01"}, {}, {}), "SubmitBlockTasks": ApiInfo("POST", "/", {"Action": "SubmitBlockTasks", "Version": "2022-01-01"}, {}, {}), "GetContentBlockTasks": ApiInfo("POST", "/", {"Action": "GetContentBlockTasks", "Version": "2022-01-01"}, {}, {}), "ListFileMetaInfosByFileNames": ApiInfo("POST", "/", {"Action": "ListFileMetaInfosByFileNames", "Version": "2023-07-01"}, {}, {}), "CreateDomain": ApiInfo("POST", "/", {"Action": "CreateDomain", "Version": "2023-02-01"}, {}, {}), "UpdateDomainExpire": ApiInfo("GET", "/", {"Action": "UpdateDomainExpire", "Version": "2023-02-01"}, {}, {}), "UpdateDomainAuthConfig": ApiInfo("GET", "/", {"Action": "UpdateDomainAuthConfig", "Version": "2023-02-01"}, {}, {}), "AddOrUpdateCertificate": ApiInfo("POST", "/",{"Action": "AddOrUpdateCertificate", "Version": "2023-07-01"}, {}, {}), "UpdateDomainUrlAuthConfig": ApiInfo("GET", "/", {"Action": "UpdateDomainUrlAuthConfig", "Version": "2023-07-01"}, {}, {}), "UpdateDomainConfig": ApiInfo("POST", "/", {"Action": "UpdateDomainConfig", "Version": "2023-07-01"}, {}, {}), "DescribeDomainConfig": ApiInfo("GET", "/", {"Action": "DescribeDomainConfig", "Version": "2023-07-01"}, {}, {}), "VerifyDomainOwner": ApiInfo("GET", "/", {"Action": "VerifyDomainOwner", "Version": "2023-07-01"}, {}, {}), "DescribeDomainVerifyContent": ApiInfo("GET", "/", {"Action": "DescribeDomainVerifyContent", "Version": "2023-07-01"}, {}, {}), "DescribeCdnEdgeIp": ApiInfo("GET", "/", {"Action": "DescribeCdnEdgeIp", "Version": "2023-07-01"}, {}, {}), "DescribeCdnRegionAndIsp": ApiInfo("GET", "/", {"Action": "DescribeCdnRegionAndIsp", "Version": "2023-07-01"}, {}, {}), # 回调管理 "AddCallbackSubscription": ApiInfo("GET", "/", {"Action": "AddCallbackSubscription", "Version": "2021-12-01"}, {}, {}), "SetCallbackEvent": ApiInfo("GET", "/", {"Action": "SetCallbackEvent", "Version": "2022-01-01"}, {}, {}), # 视频编辑 "SubmitDirectEditTaskAsync": ApiInfo("POST", "/",{"Action": "SubmitDirectEditTaskAsync", "Version": "2018-01-01"}, {},{}), "SubmitDirectEditTaskSync": ApiInfo("POST", "/",{"Action": "SubmitDirectEditTaskSync", "Version": "2018-01-01"}, {},{}), "GetDirectEditResult": ApiInfo("POST", "/", {"Action": "GetDirectEditResult", "Version": "2018-01-01"}, {}, {}), "GetDirectEditProgress": ApiInfo("GET", "/", {"Action": "GetDirectEditProgress", "Version": "2018-01-01"}, {}, {}), "CancelDirectEditTask": ApiInfo("POST", "/", {"Action": "CancelDirectEditTask", "Version": "2018-01-01"}, {}, {}), "AsyncVCreativeTask": ApiInfo("POST", "/", {"Action": "AsyncVCreativeTask", "Version": "2018-01-01"}, {}, {}), "GetVCreativeTaskResult": ApiInfo("GET", "/", {"Action": "GetVCreativeTaskResult", "Version": "2018-01-01"}, {}, {}), # 计量计费 "DescribeVodSpaceTranscodeData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceTranscodeData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceAIStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceAIStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceSubtitleStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceSubtitleStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceDetectStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceDetectStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSnapshotData": ApiInfo("GET", "/", {"Action": "DescribeVodSnapshotData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceWorkflowDetailData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceWorkflowDetailData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceEditDetailData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceEditDetailData", "Version": "2023-07-01"}, {}, {}), "DescribeVodEnhanceImageData": ApiInfo("GET", "/", {"Action": "DescribeVodEnhanceImageData", "Version": "2023-07-01"}, {}, {}), "DescribeVodSpaceEditStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceEditStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodPlayedStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodMostPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodMostPlayedStatisData", "Version": "2023-07-01"}, {}, {}), "DescribeVodRealtimeMediaData": ApiInfo("GET", "/", {"Action": "DescribeVodRealtimeMediaData", "Version": "2023-07-01"}, {}, {}), "DescribeVodRealtimeMediaDetailData": ApiInfo("GET", "/", {"Action": "DescribeVodRealtimeMediaDetailData", "Version": "2023-07-01"}, {}, {}), "DescribeVodVidTrafficFileLog": ApiInfo("GET", "/", {"Action": "DescribeVodVidTrafficFileLog", "Version": "2023-07-01"}, {}, {}) } return api_info @staticmethod def crc32(file_path): prev = 0 for eachLine in open(file_path, "rb"): prev = crc32(eachLine, prev) return prev & 0xFFFFFFFF ================================================ FILE: volcengine/vod/__init__.py ================================================ ================================================ FILE: volcengine/vod/helper/FileSectionReader.py ================================================ # coding:utf-8 import os class FileSectionReader(object): def __init__(self, file_object, size, init_offset=None, can_reset=False): self.file_object = file_object self.size = size self.offset = 0 self.init_offset = init_offset self.can_reset = can_reset if init_offset: self.file_object.seek(init_offset, os.SEEK_SET) def read(self, amt=None): if self.offset >= self.size: return '' if (amt is None or amt < 0) or (amt + self.offset >= self.size): data = self.file_object.read(self.size - self.offset) self.offset = self.size return data self.offset += amt return self.file_object.read(amt) @property def len(self): return self.size def reset(self): if self.can_reset: self.offset = 0 if self.init_offset is not None: self.file_object.seek(self.init_offset, os.SEEK_SET) ================================================ FILE: volcengine/vod/helper/__init__.py ================================================ ================================================ FILE: volcengine/vod/models/__init__.py ================================================ ================================================ FILE: volcengine/vod/models/business/__init__.py ================================================ ================================================ FILE: volcengine/vod/models/business/vod_apps_manage_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_apps_manage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-volcengine/vod/business/vod_apps_manage.proto\x12\x1eVolcengine.Vod.Models.Business\"Z\n\x13VodGetAppInfoResult\x12\r\n\x05\x41ppId\x18\x01 \x01(\x04\x12\x0e\n\x06Scheme\x18\x02 \x01(\t\x12\x11\n\tAppEnName\x18\x03 \x01(\t\x12\x11\n\tAppCnName\x18\x04 \x01(\tB\xd1\x01\n)com.volcengine.service.vod.model.businessB\rVodAppsManageP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODGETAPPINFORESULT = DESCRIPTOR.message_types_by_name['VodGetAppInfoResult'] VodGetAppInfoResult = _reflection.GeneratedProtocolMessageType('VodGetAppInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETAPPINFORESULT, '__module__' : 'volcengine.vod.business.vod_apps_manage_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetAppInfoResult) }) _sym_db.RegisterMessage(VodGetAppInfoResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\rVodAppsManageP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODGETAPPINFORESULT._serialized_start=81 _VODGETAPPINFORESULT._serialized_end=171 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_callback_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_callback.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*volcengine/vod/business/vod_callback.proto\x12\x1eVolcengine.Vod.Models.Business\"\xd0\x01\n\x0c\x42ianqueEvent\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x11\n\tEventType\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackName\x18\x03 \x01(\t\x12\x14\n\x0c\x43\x61llbackType\x18\x04 \x01(\t\x12\x13\n\x0b\x43\x61llbackUrl\x18\x05 \x01(\t\x12\x17\n\x0f\x43\x61llbackMessage\x18\x07 \x01(\t\x12\x0e\n\x06Status\x18\x08 \x01(\t\x12\x11\n\tEventTime\x18\t \x01(\x01\x12\x14\n\x0c\x45rrorMessage\x18\n \x01(\t\x12\r\n\x05LogId\x18\x0b \x01(\t\"\x81\x01\n\x0f\x43\x61llbackRecords\x12\x44\n\x0e\x43\x61llbackEvents\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.BianqueEvent\x12\x19\n\x11\x43ontinuationToken\x18\x02 \x01(\t\x12\r\n\x05Limit\x18\x03 \x01(\x05*V\n\x13VodCallbackAuthType\x12\x1f\n\x1bVodCallbackAuthTypeDisabled\x10\x00\x12\x1e\n\x1aVodCallbackAuthTypeEnabled\x10\x01\x42\xcf\x01\n)com.volcengine.service.vod.model.businessB\x0bVodCallbackP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODCALLBACKAUTHTYPE = DESCRIPTOR.enum_types_by_name['VodCallbackAuthType'] VodCallbackAuthType = enum_type_wrapper.EnumTypeWrapper(_VODCALLBACKAUTHTYPE) VodCallbackAuthTypeDisabled = 0 VodCallbackAuthTypeEnabled = 1 _BIANQUEEVENT = DESCRIPTOR.message_types_by_name['BianqueEvent'] _CALLBACKRECORDS = DESCRIPTOR.message_types_by_name['CallbackRecords'] BianqueEvent = _reflection.GeneratedProtocolMessageType('BianqueEvent', (_message.Message,), { 'DESCRIPTOR' : _BIANQUEEVENT, '__module__' : 'volcengine.vod.business.vod_callback_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.BianqueEvent) }) _sym_db.RegisterMessage(BianqueEvent) CallbackRecords = _reflection.GeneratedProtocolMessageType('CallbackRecords', (_message.Message,), { 'DESCRIPTOR' : _CALLBACKRECORDS, '__module__' : 'volcengine.vod.business.vod_callback_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CallbackRecords) }) _sym_db.RegisterMessage(CallbackRecords) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\013VodCallbackP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODCALLBACKAUTHTYPE._serialized_start=421 _VODCALLBACKAUTHTYPE._serialized_end=507 _BIANQUEEVENT._serialized_start=79 _BIANQUEEVENT._serialized_end=287 _CALLBACKRECORDS._serialized_start=290 _CALLBACKRECORDS._serialized_end=419 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_cdn_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_cdn.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%volcengine/vod/business/vod_cdn.proto\x12\x1eVolcengine.Vod.Models.Business\x1a(volcengine/vod/business/vod_common.proto\"\x87\x02\n\x13VodDomainConfigInfo\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12P\n\x10PlayInstanceInfo\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodDomainInstanceInfos\x12Q\n\x11ImageInstanceInfo\x18\x03 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodDomainInstanceInfos\x12\x19\n\x11\x44\x65\x66\x61ultPlayDomain\x18\x04 \x01(\t\x12\r\n\x05Total\x18\x05 \x01(\x03\x12\x0e\n\x06Offset\x18\x06 \x01(\x03\"\xb5\x01\n\x16VodDomainInstanceInfos\x12L\n\rByteInstances\x18\x01 \x03(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodDomainInstanceInfo\x12M\n\x0eOtherInstances\x18\x02 \x03(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodDomainInstanceInfo\"X\n\x15VodDomainInstanceInfo\x12?\n\x07\x44omains\x18\x02 \x03(\x0b\x32..Volcengine.Vod.Models.Business.VodDomainoInfo\"\xde\x02\n\x0eVodDomainoInfo\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\r\n\x05\x43name\x18\x02 \x01(\t\x12\x14\n\x0c\x43onfigStatus\x18\x03 \x01(\t\x12\x13\n\x0b\x43nameStatus\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x05 \x01(\t\x12M\n\x0b\x43\x65rtificate\x18\x06 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.VodDomainCertificateInfo\x12\x12\n\nCreateTime\x18\x07 \x01(\t\x12\x12\n\nUpdateTime\x18\x08 \x01(\t\x12\x0e\n\x06Region\x18\t \x01(\t\x12\x44\n\x07Sources\x18\n \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodDomainSourceInfo\x12\x12\n\nLockStatus\x18\x0b \x01(\t\x12\x11\n\tCdnStatus\x18\x0c \x01(\t\"\xca\x01\n\x18VodDomainCertificateInfo\x12\x15\n\rCertificateId\x18\x01 \x01(\t\x12\x17\n\x0f\x43\x65rtificateName\x18\x02 \x01(\t\x12\x16\n\x0e\x43\x65rtificatePub\x18\x03 \x01(\t\x12\x16\n\x0e\x43\x65rtificatePri\x18\x04 \x01(\t\x12\x13\n\x0bHttpsStatus\x18\x05 \x01(\t\x12\x11\n\tExpiredAt\x18\x06 \x01(\t\x12&\n\x1e\x43\x65rtificateCenterCertificateId\x18\x07 \x01(\t\"(\n\x16VodCreateCdnTaskResult\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\"\x89\x01\n\x0eVodContentInfo\x12\x0e\n\x06ItemId\x18\x01 \x01(\t\x12\x0b\n\x03Url\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x04 \x01(\t\x12\x17\n\x0f\x43reateTimestamp\x18\x05 \x01(\x05\x12\x0e\n\x06TaskId\x18\x06 \x01(\t\x12\x0f\n\x07Message\x18\x07 \x01(\t\"\x8f\x01\n\x10VodCdnTaskResult\x12\x12\n\nTotalCount\x18\x01 \x01(\x05\x12\x0f\n\x07PageNum\x18\x02 \x01(\x05\x12\x10\n\x08PageSize\x18\x03 \x01(\x05\x12\x44\n\x0c\x43ontentInfos\x18\x04 \x03(\x0b\x32..Volcengine.Vod.Models.Business.VodContentInfo\"\x7f\n\x16VodCdnAccessLogElement\x12\x13\n\x0b\x44ownloadUrl\x18\x01 \x01(\t\x12\x10\n\x08\x46ileSize\x18\x02 \x01(\x03\x12\x10\n\x08\x46ileName\x18\x03 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x04 \x01(\x05\x12\x14\n\x0c\x45ndTimestamp\x18\x05 \x01(\x05\"\xa5\x01\n\x13VodCdnAccessLogInfo\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12G\n\x07LogList\x18\x02 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodCdnAccessLogElement\x12\x0f\n\x07PageNum\x18\x03 \x01(\x03\x12\x10\n\x08PageSize\x18\x04 \x01(\x03\x12\x12\n\nTotalCount\x18\x05 \x01(\x03\"^\n\x19VodListCdnAccessLogResult\x12\x41\n\x04Logs\x18\x01 \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodCdnAccessLogInfo\"B\n\x19VodCdnTopAccessUrlElement\x12\x0b\n\x03Url\x18\x01 \x01(\t\x12\n\n\x02Pv\x18\x02 \x01(\x03\x12\x0c\n\x04\x46lux\x18\x03 \x01(\x03\"k\n\x1cVodListCdnTopAccessUrlResult\x12K\n\x08UrlInfos\x18\x01 \x03(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodCdnTopAccessUrlElement\"8\n\x16VodCdnTopAccessElement\x12\x0f\n\x07ItemKey\x18\x01 \x01(\t\x12\r\n\x05Value\x18\x02 \x01(\x01\"f\n\x19VodListCdnTopAccessResult\x12I\n\tItemInfos\x18\x01 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodCdnTopAccessElement\"3\n\x10VodBandwidthData\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\x11\n\tBandwidth\x18\x02 \x01(\x01\"\xff\x02\n\'VodDescribeVodDomainBandwidthDataResult\x12\x12\n\nDomainList\x18\x01 \x03(\t\x12\x19\n\x11\x44omainInSpaceList\x18\x02 \x03(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x05\x12\x15\n\rBandwidthType\x18\x06 \x01(\t\x12\x0c\n\x04\x41rea\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x15\n\rPeakBandwidth\x18\t \x01(\x01\x12\x19\n\x11PeakBandwidthTime\x18\n \x01(\t\x12\x17\n\x0fPeak95Bandwidth\x18\x0b \x01(\x01\x12\x1b\n\x13Peak95BandwidthTime\x18\x0c \x01(\t\x12K\n\x11\x42\x61ndwidthDataList\x18\r \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodBandwidthData\"\xb4\x01\n\x14VodCdnStatisticsData\x12\x0c\n\x04Name\x18\x01 \x01(\t\x12\x0e\n\x06Metric\x18\x02 \x01(\t\x12\x10\n\x08\x44\x61taType\x18\x03 \x01(\t\x12\x38\n\x06Points\x18\x04 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.VodPoint\x12\x0e\n\x06Region\x18\x05 \x01(\t\x12\x0b\n\x03Isp\x18\x06 \x01(\t\x12\x15\n\rBillingRegion\x18\x07 \x01(\t\"\x80\x01\n\x1cVodCdnStatisticsCommonResult\x12\x43\n\x05\x44\x61tas\x18\x01 \x03(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodCdnStatisticsData\x12\x1b\n\x13NoPermissionDomains\x18\x02 \x03(\t\"H\n\x0cVodCdnIpInfo\x12\n\n\x02Ip\x18\x01 \x01(\t\x12\r\n\x05\x43\x64nIp\x18\x02 \x01(\x08\x12\x10\n\x08Location\x18\x03 \x01(\t\x12\x0b\n\x03Isp\x18\x04 \x01(\t\"V\n\x17VodDescribeIpInfoResult\x12;\n\x05Infos\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodCdnIpInfo\"/\n\x0eVodTrafficData\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\x0f\n\x07Traffic\x18\x02 \x01(\x01\"\xa5\x02\n%VodDescribeVodDomainTrafficDataResult\x12\x12\n\nDomainList\x18\x01 \x03(\t\x12\x19\n\x11\x44omainInSpaceList\x18\x02 \x03(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x05\x12\x13\n\x0bTrafficType\x18\x06 \x01(\t\x12\x0c\n\x04\x41rea\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x14\n\x0cTotalTraffic\x18\t \x01(\x01\x12G\n\x0fTrafficDataList\x18\n \x03(\x0b\x32..Volcengine.Vod.Models.Business.VodTrafficData\"\xac\x02\n\x13VodDomainSourceInfo\x12U\n\x11SourceStationType\x18\x01 \x01(\x0e\x32:.Volcengine.Vod.Models.Business.VodDomainSourceStationType\x12\x63\n\x18SourceStationAddressType\x18\x02 \x01(\x0e\x32\x41.Volcengine.Vod.Models.Business.VodDomainSourceStationAddressType\x12\x0e\n\x06Origin\x18\x03 \x01(\t\x12I\n\x06\x42ucket\x18\x04 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodDomainOriginBucketInfo\"_\n\x19VodDomainOriginBucketInfo\x12\x12\n\nBucketName\x18\x01 \x01(\t\x12\x18\n\x10\x42ucketSourceType\x18\x02 \x01(\t\x12\x14\n\x0c\x42ucketRegion\x18\x03 \x01(\t\"+\n\x19VodSubmitBlockTasksResult\x12\x0e\n\x06TaskID\x18\x01 \x01(\t\"\x8c\x01\n\x1dVodGetContentBlockTasksResult\x12\r\n\x05Total\x18\x01 \x01(\x03\x12\x0f\n\x07PageNum\x18\x02 \x01(\x03\x12\x10\n\x08PageSize\x18\x03 \x01(\x03\x12\x39\n\x04\x44\x61ta\x18\x04 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.ContentTask\"`\n\x0b\x43ontentTask\x12\x0b\n\x03Url\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\x12\x10\n\x08TaskType\x18\x03 \x01(\t\x12\x12\n\nCreateTime\x18\x04 \x01(\x03\x12\x0e\n\x06TaskID\x18\x05 \x01(\t\"\x16\n\x04IPv6\x12\x0e\n\x06Switch\x18\x01 \x01(\x08\"\x90\x01\n\nOriginLine\x12\x0f\n\x07\x41\x64\x64ress\x18\x01 \x01(\t\x12\x10\n\x08HttpPort\x18\x02 \x01(\t\x12\x11\n\tHttpsPort\x18\x03 \x01(\t\x12\x14\n\x0cInstanceType\x18\x04 \x01(\t\x12\x12\n\nOriginHost\x18\x05 \x01(\t\x12\x12\n\nOriginType\x18\x06 \x01(\t\x12\x0e\n\x06Weight\x18\x07 \x01(\t\"O\n\x0cOriginAction\x12?\n\x0bOriginLines\x18\x01 \x03(\x0b\x32*.Volcengine.Vod.Models.Business.OriginLine\"S\n\rCdnOriginRule\x12\x42\n\x0cOriginAction\x18\x01 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.OriginAction\"w\n\x19VodResponseHeaderInstance\x12\x0e\n\x06\x41\x63tion\x18\x01 \x01(\t\x12\x0b\n\x03Key\x18\x02 \x01(\t\x12\x11\n\tValueType\x18\x03 \x01(\t\x12\x1b\n\x13\x41\x63\x63\x65ssOriginControl\x18\x04 \x01(\x08\x12\r\n\x05Value\x18\x05 \x01(\t\"u\n\x17VodResponseHeaderAction\x12Z\n\x17ResponseHeaderInstances\x18\x01 \x03(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodResponseHeaderInstance\"n\n\x15VodResponseHeaderRule\x12U\n\x14ResponseHeaderAction\x18\x01 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodResponseHeaderAction\"i\n\x18VodResponseHeaderControl\x12M\n\x0eResponseHeader\x18\x01 \x03(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodResponseHeaderRule\"E\n\x15VodTosAuthInformation\x12\x13\n\x0b\x41\x63\x63\x65ssKeyId\x18\x01 \x01(\t\x12\x17\n\x0f\x41\x63\x63\x65ssKeySecret\x18\x02 \x01(\t\"\x8b\x01\n\x14VodPrivateBucketAuth\x12\x0e\n\x06Switch\x18\x01 \x01(\x08\x12\x10\n\x08\x41uthType\x18\x02 \x01(\t\x12Q\n\x12TosAuthInformation\x18\x03 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodTosAuthInformation\"\xde\x02\n\x11VodOriginalConfig\x12\x0f\n\x07Origins\x18\x01 \x01(\t\x12\x12\n\nOriginType\x18\x02 \x01(\t\x12\x63\n\x18SourceStationAddressType\x18\x03 \x01(\x0e\x32\x41.Volcengine.Vod.Models.Business.VodDomainSourceStationAddressType\x12\x0c\n\x04Host\x18\x04 \x01(\t\x12\x1b\n\x13PrivateBucketAccess\x18\x05 \x01(\x08\x12O\n\x11PrivateBucketAuth\x18\x06 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodPrivateBucketAuth\x12\x0e\n\x06Region\x18\x07 \x01(\t\x12\x10\n\x08HttpPort\x18\x08 \x01(\t\x12\x11\n\tHttpsPort\x18\t \x01(\t\x12\x0e\n\x06Weight\x18\n \x01(\t\"~\n\x12VodOriginalControl\x12\x42\n\x07Origins\x18\x01 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodOriginalConfig\x12\x0c\n\x04Host\x18\x02 \x01(\t\x12\x16\n\x0eOriginProtocol\x18\x03 \x01(\t\"\xce\n\n\x0fVodDomainConfig\x12W\n\x15ResponseHeaderControl\x18\x01 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.VodResponseHeaderControl\x12K\n\x0fOriginalControl\x18\x02 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodOriginalControl\x12?\n\x05\x43\x61\x63he\x18\x03 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.CacheControlRule\x12>\n\x08\x43\x61\x63heKey\x18\x04 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.CacheKeyRule\x12\x45\n\x0b\x43ompression\x18\x05 \x01(\x0b\x32+.Volcengine.Vod.Models.Business.CompressionH\x00\x88\x01\x01\x12S\n\x12\x44ownloadSpeedLimit\x18\x06 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.DownloadSpeedLimitH\x01\x88\x01\x01\x12\x39\n\x05HTTPS\x18\x07 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.HTTPSH\x02\x88\x01\x01\x12S\n\x12HttpForcedRedirect\x18\x08 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.HttpForcedRedirectH\x03\x88\x01\x01\x12:\n\x04IPv6\x18\t \x01(\x0b\x32\'.Volcengine.Vod.Models.Business.CdnIPv6H\x04\x88\x01\x01\x12\x1b\n\x0e\x46ollowRedirect\x18\n \x01(\x08H\x05\x88\x01\x01\x12\x18\n\x0bOriginRange\x18\x0b \x01(\x08H\x06\x88\x01\x01\x12G\n\x0cIpAccessRule\x18\x0c \x01(\x0b\x32,.Volcengine.Vod.Models.Business.IpAccessRuleH\x07\x88\x01\x01\x12Q\n\x11RefererAccessRule\x18\r \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.RefererAccessRuleH\x08\x88\x01\x01\x12H\n\rRequestHeader\x18\x0e \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.RequestHeaderRule\x12N\n\x0cUaAccessRule\x18\x0f \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.UserAgentAccessRuleH\t\x88\x01\x01\x12N\n\x14OriginRewriteControl\x18\x12 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodOriginRewrite\x12\x43\n\tOriginArg\x18\x13 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodOriginArgRuleB\x0e\n\x0c_CompressionB\x15\n\x13_DownloadSpeedLimitB\x08\n\x06_HTTPSB\x15\n\x13_HttpForcedRedirectB\x07\n\x05_IPv6B\x11\n\x0f_FollowRedirectB\x0e\n\x0c_OriginRangeB\x0f\n\r_IpAccessRuleB\x14\n\x12_RefererAccessRuleB\x0f\n\r_UaAccessRule\"|\n\x0c\x43\x64nCondition\x12\x44\n\rConditionRule\x18\x01 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.ConditionRule\x12\x17\n\nConnective\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_Connective\"\x8d\x01\n\rConditionRule\x12\x13\n\x06Object\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08Operator\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04Type\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x12\n\x05Value\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_ObjectB\x0b\n\t_OperatorB\x07\n\x05_TypeB\x08\n\x06_Value\"\xbd\x01\n\x10\x43\x61\x63heControlRule\x12\x45\n\x0b\x43\x61\x63heAction\x18\x01 \x01(\x0b\x32+.Volcengine.Vod.Models.Business.CacheActionH\x00\x88\x01\x01\x12\x44\n\tCondition\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x01\x88\x01\x01\x42\x0e\n\x0c_CacheActionB\x0c\n\n_Condition\"\x9d\x01\n\x0b\x43\x61\x63heAction\x12\x13\n\x06\x41\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rDefaultPolicy\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nIgnoreCase\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12\x10\n\x03Ttl\x18\x04 \x01(\x03H\x03\x88\x01\x01\x42\t\n\x07_ActionB\x10\n\x0e_DefaultPolicyB\r\n\x0b_IgnoreCaseB\x06\n\x04_Ttl\"\xc2\x01\n\x0c\x43\x61\x63heKeyRule\x12K\n\x0e\x43\x61\x63heKeyAction\x18\x01 \x01(\x0b\x32..Volcengine.Vod.Models.Business.CacheKeyActionH\x00\x88\x01\x01\x12\x44\n\tCondition\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x01\x88\x01\x01\x42\x11\n\x0f_CacheKeyActionB\x0c\n\n_Condition\"_\n\x0e\x43\x61\x63heKeyAction\x12M\n\x12\x43\x61\x63heKeyComponents\x18\x01 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.CacheKeyComponent\"\xa1\x01\n\x11\x43\x61\x63heKeyComponent\x12\x13\n\x06\x41\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x17\n\nIgnoreCase\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x13\n\x06Object\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tSubobject\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_ActionB\r\n\x0b_IgnoreCaseB\t\n\x07_ObjectB\x0c\n\n_Subobject\"\xf4\x01\n\x11\x43ompressionAction\x12\x1e\n\x11\x43ompressionFormat\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x43ompressionTarget\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x17\n\x0f\x43ompressionType\x18\x03 \x03(\t\x12\x1a\n\rMaxFileSizeKB\x18\x04 \x01(\x03H\x02\x88\x01\x01\x12\x1a\n\rMinFileSizeKB\x18\x05 \x01(\x03H\x03\x88\x01\x01\x42\x14\n\x12_CompressionFormatB\x14\n\x12_CompressionTargetB\x10\n\x0e_MaxFileSizeKBB\x10\n\x0e_MinFileSizeKB\"\xce\x01\n\x0f\x43ompressionRule\x12Q\n\x11\x43ompressionAction\x18\x01 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.CompressionActionH\x00\x88\x01\x01\x12\x44\n\tCondition\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x01\x88\x01\x01\x42\x14\n\x12_CompressionActionB\x0c\n\n_Condition\"x\n\x0b\x43ompression\x12I\n\x10\x43ompressionRules\x18\x01 \x03(\x0b\x32/.Volcengine.Vod.Models.Business.CompressionRule\x12\x13\n\x06Switch\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_Switch\"z\n\x0eSpeedLimitTime\x12\x16\n\tBeginTime\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x44\x61yWeek\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x07\x45ndTime\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x0c\n\n_BeginTimeB\n\n\x08_DayWeekB\n\n\x08_EndTime\"\xe4\x01\n\x18\x44ownloadSpeedLimitAction\x12\x1b\n\x0eSpeedLimitRate\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12 \n\x13SpeedLimitRateAfter\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12K\n\x0eSpeedLimitTime\x18\x03 \x01(\x0b\x32..Volcengine.Vod.Models.Business.SpeedLimitTimeH\x02\x88\x01\x01\x42\x11\n\x0f_SpeedLimitRateB\x16\n\x14_SpeedLimitRateAfterB\x11\n\x0f_SpeedLimitTime\"\xea\x01\n\x16\x44ownloadSpeedLimitRule\x12\x44\n\tCondition\x18\x01 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x00\x88\x01\x01\x12_\n\x18\x44ownloadSpeedLimitAction\x18\x02 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.DownloadSpeedLimitActionH\x01\x88\x01\x01\x42\x0c\n\n_ConditionB\x1b\n\x19_DownloadSpeedLimitAction\"\x8d\x01\n\x12\x44ownloadSpeedLimit\x12W\n\x17\x44ownloadSpeedLimitRules\x18\x01 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.DownloadSpeedLimitRule\x12\x13\n\x06Switch\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_Switch\"t\n\x0e\x46orcedRedirect\x12!\n\x14\x45nableForcedRedirect\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nStatusCode\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x17\n\x15_EnableForcedRedirectB\r\n\x0b_StatusCode\"\x87\x02\n\x05HTTPS\x12\x13\n\x06Switch\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12?\n\x08\x43\x65rtInfo\x18\x02 \x01(\x0b\x32(.Volcengine.Vod.Models.Business.CertInfoH\x01\x88\x01\x01\x12K\n\x0e\x46orcedRedirect\x18\x03 \x01(\x0b\x32..Volcengine.Vod.Models.Business.ForcedRedirectH\x02\x88\x01\x01\x12\x12\n\x05HTTP2\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\x12\n\nTlsVersion\x18\x05 \x03(\tB\t\n\x07_SwitchB\x0b\n\t_CertInfoB\x11\n\x0f_ForcedRedirectB\x08\n\x06_HTTP2\"*\n\x08\x43\x65rtInfo\x12\x13\n\x06\x43\x65rtId\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_CertId\"x\n\x12HttpForcedRedirect\x12!\n\x14\x45nableForcedRedirect\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nStatusCode\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x17\n\x15_EnableForcedRedirectB\r\n\x0b_StatusCode\")\n\x07\x43\x64nIPv6\x12\x13\n\x06Switch\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_Switch\"\xd6\x01\n\x11RequestHeaderRule\x12\x44\n\tCondition\x18\x01 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x00\x88\x01\x01\x12U\n\x13RequestHeaderAction\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.RequestHeaderActionH\x01\x88\x01\x01\x42\x0c\n\n_ConditionB\x16\n\x14_RequestHeaderAction\"l\n\x13RequestHeaderAction\x12U\n\x16RequestHeaderInstances\x18\x01 \x03(\x0b\x32\x35.Volcengine.Vod.Models.Business.RequestHeaderInstance\"\x95\x01\n\x15RequestHeaderInstance\x12\x13\n\x06\x41\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03Key\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05Value\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tValueType\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_ActionB\x06\n\x04_KeyB\x08\n\x06_ValueB\x0c\n\n_ValueType\"^\n\x0cIpAccessRule\x12\n\n\x02Ip\x18\x01 \x03(\t\x12\x15\n\x08RuleType\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06Switch\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_RuleTypeB\t\n\x07_Switch\"<\n\x12\x43ommonGlobalConfig\x12\x17\n\nConfigName\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_ConfigName\",\n\nMultiRange\x12\x13\n\x06Switch\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_Switch\"\xbc\x01\n\x13UserAgentAccessRule\x12\x17\n\nAllowEmpty\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x17\n\nIgnoreCase\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08RuleType\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06Switch\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\x11\n\tUserAgent\x18\x05 \x03(\tB\r\n\x0b_AllowEmptyB\r\n\x0b_IgnoreCaseB\x0b\n\t_RuleTypeB\t\n\x07_Switch\"\xeb\x01\n\x11RefererAccessRule\x12\x17\n\nAllowEmpty\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x10\n\x08Referers\x18\x02 \x03(\t\x12G\n\x0cReferersType\x18\x03 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.ReferersTypeH\x01\x88\x01\x01\x12\x15\n\x08RuleType\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06Switch\x18\x06 \x01(\x08H\x03\x88\x01\x01\x42\r\n\x0b_AllowEmptyB\x0f\n\r_ReferersTypeB\x0b\n\t_RuleTypeB\t\n\x07_Switch\"g\n\x0cReferersType\x12H\n\nCommonType\x18\x01 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.CommonReferTypeH\x00\x88\x01\x01\x42\r\n\x0b_CommonType\"w\n\x0f\x43ommonReferType\x12\x17\n\nIgnoreCase\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0cIgnoreScheme\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x10\n\x08Referers\x18\x03 \x03(\tB\r\n\x0b_IgnoreCaseB\x0f\n\r_IgnoreScheme\"q\n\x12VodDomainBasicInfo\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\r\n\x05\x43name\x18\x02 \x01(\t\x12\x14\n\x0c\x43onfigStatus\x18\x03 \x01(\t\x12\x12\n\nCreateTime\x18\x04 \x01(\t\x12\x12\n\nLockStatus\x18\x05 \x01(\t\"\xb7\x01\n\x1dVodDescribeDomainConfigResult\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x42\n\x06\x44omain\x18\x02 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodDomainBasicInfo\x12?\n\x06\x43onfig\x18\x03 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.VodDomainConfig\"\xa1\x01\n\x17VodPCDNDomainConfigInfo\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12T\n\x10PCDNInstanceInfo\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodPCDNDomainInstanceInfos\x12\r\n\x05Total\x18\x03 \x01(\x03\x12\x0e\n\x06Offset\x18\x04 \x01(\x03\"`\n\x1aVodPCDNDomainInstanceInfos\x12\x42\n\x07\x44omains\x18\x01 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodPCDNDomainInfo\"[\n\x11VodPCDNDomainInfo\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\x12\x12\n\nCreateTime\x18\x03 \x01(\t\x12\x12\n\nUpdateTime\x18\x04 \x01(\t\"H\n\x1aVodVerifyDomainOwnerResult\x12\x14\n\x0cVerifyResult\x18\x01 \x01(\x08\x12\x14\n\x0c\x45rrorMessage\x18\x02 \x01(\t\"O\n\x16VodDomainDNSVerifyInfo\x12\x0c\n\x04Host\x18\x01 \x01(\t\x12\x12\n\nRecordType\x18\x02 \x01(\t\x12\x13\n\x0bRecordValue\x18\x03 \x01(\t\"c\n\x17VodDomainFileVerifyInfo\x12\x15\n\rVerifyDomains\x18\x01 \x03(\t\x12\x16\n\x0eVerifyFileName\x18\x02 \x01(\t\x12\x19\n\x11VerifyFileContent\x18\x03 \x01(\t\"\xda\x01\n$VodDescribeDomainVerifyContentResult\x12\x12\n\nNeedVerify\x18\x01 \x01(\x08\x12M\n\rDNSVerifyInfo\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodDomainDNSVerifyInfo\x12O\n\x0e\x46ileVerifyInfo\x18\x03 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodDomainFileVerifyInfo\">\n\x1aVodDescribeCdnEdgeIpResult\x12\x0f\n\x07\x43\x64nIpv4\x18\x01 \x03(\t\x12\x0f\n\x07\x43\x64nIpv6\x18\x02 \x03(\t\"\x95\x01\n VodDescribeCdnRegionAndIspResult\x12\x36\n\x04Isps\x18\x01 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.NamePair\x12\x39\n\x07Regions\x18\x02 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.NamePair\"&\n\x08NamePair\x12\x0c\n\x04\x43ode\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\"U\n\x16VodOriginRewriteAction\x12\x12\n\nSourcePath\x18\x01 \x01(\t\x12\x12\n\nTargetPath\x18\x02 \x01(\t\x12\x13\n\x0bRewriteType\x18\x03 \x01(\t\"k\n\x14VodOriginRewriteRule\x12S\n\x13OriginRewriteAction\x18\x01 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodOriginRewriteAction\"s\n\x10VodOriginRewrite\x12O\n\x11OriginRewriteRule\x18\x01 \x03(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodOriginRewriteRule\x12\x0e\n\x06Switch\x18\x02 \x01(\x08\"\xcc\x01\n\x10VodOriginArgRule\x12P\n\x0fOriginArgAction\x18\x01 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodOriginArgActionH\x00\x88\x01\x01\x12\x44\n\tCondition\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.CdnConditionH\x01\x88\x01\x01\x42\x12\n\x10_OriginArgActionB\x0c\n\n_Condition\"i\n\x12VodOriginArgAction\x12S\n\x13OriginArgComponents\x18\x01 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodOriginArgComponents\"~\n\x16VodOriginArgComponents\x12\x13\n\x06\x41\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06Object\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x16\n\tSubobject\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\t\n\x07_ActionB\t\n\x07_ObjectB\x0c\n\n_Subobject*\x92\x01\n\x1aVodDomainSourceStationType\x12\'\n#UndefinedVodDomainSourceStationType\x10\x00\x12!\n\x1dVodVodDomainSourceStationType\x10\x01\x12(\n$ThirdPartyVodDomainSourceStationType\x10\x02*\xd3\x01\n!VodDomainSourceStationAddressType\x12.\n*UndefinedVodDomainSourceStationAddressType\x10\x00\x12+\n\'DomainVodDomainSourceStationAddressType\x10\x01\x12\'\n#IPVodDomainSourceStationAddressType\x10\x02\x12(\n$TOSVodDomainSourceStationAddressType\x10\x03\x42\xca\x01\n)com.volcengine.service.vod.model.businessB\x06VodCdnP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODDOMAINSOURCESTATIONTYPE = DESCRIPTOR.enum_types_by_name['VodDomainSourceStationType'] VodDomainSourceStationType = enum_type_wrapper.EnumTypeWrapper(_VODDOMAINSOURCESTATIONTYPE) _VODDOMAINSOURCESTATIONADDRESSTYPE = DESCRIPTOR.enum_types_by_name['VodDomainSourceStationAddressType'] VodDomainSourceStationAddressType = enum_type_wrapper.EnumTypeWrapper(_VODDOMAINSOURCESTATIONADDRESSTYPE) UndefinedVodDomainSourceStationType = 0 VodVodDomainSourceStationType = 1 ThirdPartyVodDomainSourceStationType = 2 UndefinedVodDomainSourceStationAddressType = 0 DomainVodDomainSourceStationAddressType = 1 IPVodDomainSourceStationAddressType = 2 TOSVodDomainSourceStationAddressType = 3 _VODDOMAINCONFIGINFO = DESCRIPTOR.message_types_by_name['VodDomainConfigInfo'] _VODDOMAININSTANCEINFOS = DESCRIPTOR.message_types_by_name['VodDomainInstanceInfos'] _VODDOMAININSTANCEINFO = DESCRIPTOR.message_types_by_name['VodDomainInstanceInfo'] _VODDOMAINOINFO = DESCRIPTOR.message_types_by_name['VodDomainoInfo'] _VODDOMAINCERTIFICATEINFO = DESCRIPTOR.message_types_by_name['VodDomainCertificateInfo'] _VODCREATECDNTASKRESULT = DESCRIPTOR.message_types_by_name['VodCreateCdnTaskResult'] _VODCONTENTINFO = DESCRIPTOR.message_types_by_name['VodContentInfo'] _VODCDNTASKRESULT = DESCRIPTOR.message_types_by_name['VodCdnTaskResult'] _VODCDNACCESSLOGELEMENT = DESCRIPTOR.message_types_by_name['VodCdnAccessLogElement'] _VODCDNACCESSLOGINFO = DESCRIPTOR.message_types_by_name['VodCdnAccessLogInfo'] _VODLISTCDNACCESSLOGRESULT = DESCRIPTOR.message_types_by_name['VodListCdnAccessLogResult'] _VODCDNTOPACCESSURLELEMENT = DESCRIPTOR.message_types_by_name['VodCdnTopAccessUrlElement'] _VODLISTCDNTOPACCESSURLRESULT = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessUrlResult'] _VODCDNTOPACCESSELEMENT = DESCRIPTOR.message_types_by_name['VodCdnTopAccessElement'] _VODLISTCDNTOPACCESSRESULT = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessResult'] _VODBANDWIDTHDATA = DESCRIPTOR.message_types_by_name['VodBandwidthData'] _VODDESCRIBEVODDOMAINBANDWIDTHDATARESULT = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainBandwidthDataResult'] _VODCDNSTATISTICSDATA = DESCRIPTOR.message_types_by_name['VodCdnStatisticsData'] _VODCDNSTATISTICSCOMMONRESULT = DESCRIPTOR.message_types_by_name['VodCdnStatisticsCommonResult'] _VODCDNIPINFO = DESCRIPTOR.message_types_by_name['VodCdnIpInfo'] _VODDESCRIBEIPINFORESULT = DESCRIPTOR.message_types_by_name['VodDescribeIpInfoResult'] _VODTRAFFICDATA = DESCRIPTOR.message_types_by_name['VodTrafficData'] _VODDESCRIBEVODDOMAINTRAFFICDATARESULT = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainTrafficDataResult'] _VODDOMAINSOURCEINFO = DESCRIPTOR.message_types_by_name['VodDomainSourceInfo'] _VODDOMAINORIGINBUCKETINFO = DESCRIPTOR.message_types_by_name['VodDomainOriginBucketInfo'] _VODSUBMITBLOCKTASKSRESULT = DESCRIPTOR.message_types_by_name['VodSubmitBlockTasksResult'] _VODGETCONTENTBLOCKTASKSRESULT = DESCRIPTOR.message_types_by_name['VodGetContentBlockTasksResult'] _CONTENTTASK = DESCRIPTOR.message_types_by_name['ContentTask'] _IPV6 = DESCRIPTOR.message_types_by_name['IPv6'] _ORIGINLINE = DESCRIPTOR.message_types_by_name['OriginLine'] _ORIGINACTION = DESCRIPTOR.message_types_by_name['OriginAction'] _CDNORIGINRULE = DESCRIPTOR.message_types_by_name['CdnOriginRule'] _VODRESPONSEHEADERINSTANCE = DESCRIPTOR.message_types_by_name['VodResponseHeaderInstance'] _VODRESPONSEHEADERACTION = DESCRIPTOR.message_types_by_name['VodResponseHeaderAction'] _VODRESPONSEHEADERRULE = DESCRIPTOR.message_types_by_name['VodResponseHeaderRule'] _VODRESPONSEHEADERCONTROL = DESCRIPTOR.message_types_by_name['VodResponseHeaderControl'] _VODTOSAUTHINFORMATION = DESCRIPTOR.message_types_by_name['VodTosAuthInformation'] _VODPRIVATEBUCKETAUTH = DESCRIPTOR.message_types_by_name['VodPrivateBucketAuth'] _VODORIGINALCONFIG = DESCRIPTOR.message_types_by_name['VodOriginalConfig'] _VODORIGINALCONTROL = DESCRIPTOR.message_types_by_name['VodOriginalControl'] _VODDOMAINCONFIG = DESCRIPTOR.message_types_by_name['VodDomainConfig'] _CDNCONDITION = DESCRIPTOR.message_types_by_name['CdnCondition'] _CONDITIONRULE = DESCRIPTOR.message_types_by_name['ConditionRule'] _CACHECONTROLRULE = DESCRIPTOR.message_types_by_name['CacheControlRule'] _CACHEACTION = DESCRIPTOR.message_types_by_name['CacheAction'] _CACHEKEYRULE = DESCRIPTOR.message_types_by_name['CacheKeyRule'] _CACHEKEYACTION = DESCRIPTOR.message_types_by_name['CacheKeyAction'] _CACHEKEYCOMPONENT = DESCRIPTOR.message_types_by_name['CacheKeyComponent'] _COMPRESSIONACTION = DESCRIPTOR.message_types_by_name['CompressionAction'] _COMPRESSIONRULE = DESCRIPTOR.message_types_by_name['CompressionRule'] _COMPRESSION = DESCRIPTOR.message_types_by_name['Compression'] _SPEEDLIMITTIME = DESCRIPTOR.message_types_by_name['SpeedLimitTime'] _DOWNLOADSPEEDLIMITACTION = DESCRIPTOR.message_types_by_name['DownloadSpeedLimitAction'] _DOWNLOADSPEEDLIMITRULE = DESCRIPTOR.message_types_by_name['DownloadSpeedLimitRule'] _DOWNLOADSPEEDLIMIT = DESCRIPTOR.message_types_by_name['DownloadSpeedLimit'] _FORCEDREDIRECT = DESCRIPTOR.message_types_by_name['ForcedRedirect'] _HTTPS = DESCRIPTOR.message_types_by_name['HTTPS'] _CERTINFO = DESCRIPTOR.message_types_by_name['CertInfo'] _HTTPFORCEDREDIRECT = DESCRIPTOR.message_types_by_name['HttpForcedRedirect'] _CDNIPV6 = DESCRIPTOR.message_types_by_name['CdnIPv6'] _REQUESTHEADERRULE = DESCRIPTOR.message_types_by_name['RequestHeaderRule'] _REQUESTHEADERACTION = DESCRIPTOR.message_types_by_name['RequestHeaderAction'] _REQUESTHEADERINSTANCE = DESCRIPTOR.message_types_by_name['RequestHeaderInstance'] _IPACCESSRULE = DESCRIPTOR.message_types_by_name['IpAccessRule'] _COMMONGLOBALCONFIG = DESCRIPTOR.message_types_by_name['CommonGlobalConfig'] _MULTIRANGE = DESCRIPTOR.message_types_by_name['MultiRange'] _USERAGENTACCESSRULE = DESCRIPTOR.message_types_by_name['UserAgentAccessRule'] _REFERERACCESSRULE = DESCRIPTOR.message_types_by_name['RefererAccessRule'] _REFERERSTYPE = DESCRIPTOR.message_types_by_name['ReferersType'] _COMMONREFERTYPE = DESCRIPTOR.message_types_by_name['CommonReferType'] _VODDOMAINBASICINFO = DESCRIPTOR.message_types_by_name['VodDomainBasicInfo'] _VODDESCRIBEDOMAINCONFIGRESULT = DESCRIPTOR.message_types_by_name['VodDescribeDomainConfigResult'] _VODPCDNDOMAINCONFIGINFO = DESCRIPTOR.message_types_by_name['VodPCDNDomainConfigInfo'] _VODPCDNDOMAININSTANCEINFOS = DESCRIPTOR.message_types_by_name['VodPCDNDomainInstanceInfos'] _VODPCDNDOMAININFO = DESCRIPTOR.message_types_by_name['VodPCDNDomainInfo'] _VODVERIFYDOMAINOWNERRESULT = DESCRIPTOR.message_types_by_name['VodVerifyDomainOwnerResult'] _VODDOMAINDNSVERIFYINFO = DESCRIPTOR.message_types_by_name['VodDomainDNSVerifyInfo'] _VODDOMAINFILEVERIFYINFO = DESCRIPTOR.message_types_by_name['VodDomainFileVerifyInfo'] _VODDESCRIBEDOMAINVERIFYCONTENTRESULT = DESCRIPTOR.message_types_by_name['VodDescribeDomainVerifyContentResult'] _VODDESCRIBECDNEDGEIPRESULT = DESCRIPTOR.message_types_by_name['VodDescribeCdnEdgeIpResult'] _VODDESCRIBECDNREGIONANDISPRESULT = DESCRIPTOR.message_types_by_name['VodDescribeCdnRegionAndIspResult'] _NAMEPAIR = DESCRIPTOR.message_types_by_name['NamePair'] _VODORIGINREWRITEACTION = DESCRIPTOR.message_types_by_name['VodOriginRewriteAction'] _VODORIGINREWRITERULE = DESCRIPTOR.message_types_by_name['VodOriginRewriteRule'] _VODORIGINREWRITE = DESCRIPTOR.message_types_by_name['VodOriginRewrite'] _VODORIGINARGRULE = DESCRIPTOR.message_types_by_name['VodOriginArgRule'] _VODORIGINARGACTION = DESCRIPTOR.message_types_by_name['VodOriginArgAction'] _VODORIGINARGCOMPONENTS = DESCRIPTOR.message_types_by_name['VodOriginArgComponents'] VodDomainConfigInfo = _reflection.GeneratedProtocolMessageType('VodDomainConfigInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINCONFIGINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainConfigInfo) }) _sym_db.RegisterMessage(VodDomainConfigInfo) VodDomainInstanceInfos = _reflection.GeneratedProtocolMessageType('VodDomainInstanceInfos', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAININSTANCEINFOS, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainInstanceInfos) }) _sym_db.RegisterMessage(VodDomainInstanceInfos) VodDomainInstanceInfo = _reflection.GeneratedProtocolMessageType('VodDomainInstanceInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAININSTANCEINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainInstanceInfo) }) _sym_db.RegisterMessage(VodDomainInstanceInfo) VodDomainoInfo = _reflection.GeneratedProtocolMessageType('VodDomainoInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINOINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainoInfo) }) _sym_db.RegisterMessage(VodDomainoInfo) VodDomainCertificateInfo = _reflection.GeneratedProtocolMessageType('VodDomainCertificateInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINCERTIFICATEINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainCertificateInfo) }) _sym_db.RegisterMessage(VodDomainCertificateInfo) VodCreateCdnTaskResult = _reflection.GeneratedProtocolMessageType('VodCreateCdnTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODCREATECDNTASKRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateCdnTaskResult) }) _sym_db.RegisterMessage(VodCreateCdnTaskResult) VodContentInfo = _reflection.GeneratedProtocolMessageType('VodContentInfo', (_message.Message,), { 'DESCRIPTOR' : _VODCONTENTINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodContentInfo) }) _sym_db.RegisterMessage(VodContentInfo) VodCdnTaskResult = _reflection.GeneratedProtocolMessageType('VodCdnTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODCDNTASKRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnTaskResult) }) _sym_db.RegisterMessage(VodCdnTaskResult) VodCdnAccessLogElement = _reflection.GeneratedProtocolMessageType('VodCdnAccessLogElement', (_message.Message,), { 'DESCRIPTOR' : _VODCDNACCESSLOGELEMENT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnAccessLogElement) }) _sym_db.RegisterMessage(VodCdnAccessLogElement) VodCdnAccessLogInfo = _reflection.GeneratedProtocolMessageType('VodCdnAccessLogInfo', (_message.Message,), { 'DESCRIPTOR' : _VODCDNACCESSLOGINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnAccessLogInfo) }) _sym_db.RegisterMessage(VodCdnAccessLogInfo) VodListCdnAccessLogResult = _reflection.GeneratedProtocolMessageType('VodListCdnAccessLogResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNACCESSLOGRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListCdnAccessLogResult) }) _sym_db.RegisterMessage(VodListCdnAccessLogResult) VodCdnTopAccessUrlElement = _reflection.GeneratedProtocolMessageType('VodCdnTopAccessUrlElement', (_message.Message,), { 'DESCRIPTOR' : _VODCDNTOPACCESSURLELEMENT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnTopAccessUrlElement) }) _sym_db.RegisterMessage(VodCdnTopAccessUrlElement) VodListCdnTopAccessUrlResult = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessUrlResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSURLRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListCdnTopAccessUrlResult) }) _sym_db.RegisterMessage(VodListCdnTopAccessUrlResult) VodCdnTopAccessElement = _reflection.GeneratedProtocolMessageType('VodCdnTopAccessElement', (_message.Message,), { 'DESCRIPTOR' : _VODCDNTOPACCESSELEMENT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnTopAccessElement) }) _sym_db.RegisterMessage(VodCdnTopAccessElement) VodListCdnTopAccessResult = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListCdnTopAccessResult) }) _sym_db.RegisterMessage(VodListCdnTopAccessResult) VodBandwidthData = _reflection.GeneratedProtocolMessageType('VodBandwidthData', (_message.Message,), { 'DESCRIPTOR' : _VODBANDWIDTHDATA, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodBandwidthData) }) _sym_db.RegisterMessage(VodBandwidthData) VodDescribeVodDomainBandwidthDataResult = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainBandwidthDataResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINBANDWIDTHDATARESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeVodDomainBandwidthDataResult) }) _sym_db.RegisterMessage(VodDescribeVodDomainBandwidthDataResult) VodCdnStatisticsData = _reflection.GeneratedProtocolMessageType('VodCdnStatisticsData', (_message.Message,), { 'DESCRIPTOR' : _VODCDNSTATISTICSDATA, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnStatisticsData) }) _sym_db.RegisterMessage(VodCdnStatisticsData) VodCdnStatisticsCommonResult = _reflection.GeneratedProtocolMessageType('VodCdnStatisticsCommonResult', (_message.Message,), { 'DESCRIPTOR' : _VODCDNSTATISTICSCOMMONRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnStatisticsCommonResult) }) _sym_db.RegisterMessage(VodCdnStatisticsCommonResult) VodCdnIpInfo = _reflection.GeneratedProtocolMessageType('VodCdnIpInfo', (_message.Message,), { 'DESCRIPTOR' : _VODCDNIPINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCdnIpInfo) }) _sym_db.RegisterMessage(VodCdnIpInfo) VodDescribeIpInfoResult = _reflection.GeneratedProtocolMessageType('VodDescribeIpInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEIPINFORESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeIpInfoResult) }) _sym_db.RegisterMessage(VodDescribeIpInfoResult) VodTrafficData = _reflection.GeneratedProtocolMessageType('VodTrafficData', (_message.Message,), { 'DESCRIPTOR' : _VODTRAFFICDATA, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodTrafficData) }) _sym_db.RegisterMessage(VodTrafficData) VodDescribeVodDomainTrafficDataResult = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainTrafficDataResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINTRAFFICDATARESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeVodDomainTrafficDataResult) }) _sym_db.RegisterMessage(VodDescribeVodDomainTrafficDataResult) VodDomainSourceInfo = _reflection.GeneratedProtocolMessageType('VodDomainSourceInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINSOURCEINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainSourceInfo) }) _sym_db.RegisterMessage(VodDomainSourceInfo) VodDomainOriginBucketInfo = _reflection.GeneratedProtocolMessageType('VodDomainOriginBucketInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINORIGINBUCKETINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainOriginBucketInfo) }) _sym_db.RegisterMessage(VodDomainOriginBucketInfo) VodSubmitBlockTasksResult = _reflection.GeneratedProtocolMessageType('VodSubmitBlockTasksResult', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKTASKSRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubmitBlockTasksResult) }) _sym_db.RegisterMessage(VodSubmitBlockTasksResult) VodGetContentBlockTasksResult = _reflection.GeneratedProtocolMessageType('VodGetContentBlockTasksResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETCONTENTBLOCKTASKSRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetContentBlockTasksResult) }) _sym_db.RegisterMessage(VodGetContentBlockTasksResult) ContentTask = _reflection.GeneratedProtocolMessageType('ContentTask', (_message.Message,), { 'DESCRIPTOR' : _CONTENTTASK, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ContentTask) }) _sym_db.RegisterMessage(ContentTask) IPv6 = _reflection.GeneratedProtocolMessageType('IPv6', (_message.Message,), { 'DESCRIPTOR' : _IPV6, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.IPv6) }) _sym_db.RegisterMessage(IPv6) OriginLine = _reflection.GeneratedProtocolMessageType('OriginLine', (_message.Message,), { 'DESCRIPTOR' : _ORIGINLINE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.OriginLine) }) _sym_db.RegisterMessage(OriginLine) OriginAction = _reflection.GeneratedProtocolMessageType('OriginAction', (_message.Message,), { 'DESCRIPTOR' : _ORIGINACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.OriginAction) }) _sym_db.RegisterMessage(OriginAction) CdnOriginRule = _reflection.GeneratedProtocolMessageType('CdnOriginRule', (_message.Message,), { 'DESCRIPTOR' : _CDNORIGINRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CdnOriginRule) }) _sym_db.RegisterMessage(CdnOriginRule) VodResponseHeaderInstance = _reflection.GeneratedProtocolMessageType('VodResponseHeaderInstance', (_message.Message,), { 'DESCRIPTOR' : _VODRESPONSEHEADERINSTANCE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodResponseHeaderInstance) }) _sym_db.RegisterMessage(VodResponseHeaderInstance) VodResponseHeaderAction = _reflection.GeneratedProtocolMessageType('VodResponseHeaderAction', (_message.Message,), { 'DESCRIPTOR' : _VODRESPONSEHEADERACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodResponseHeaderAction) }) _sym_db.RegisterMessage(VodResponseHeaderAction) VodResponseHeaderRule = _reflection.GeneratedProtocolMessageType('VodResponseHeaderRule', (_message.Message,), { 'DESCRIPTOR' : _VODRESPONSEHEADERRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodResponseHeaderRule) }) _sym_db.RegisterMessage(VodResponseHeaderRule) VodResponseHeaderControl = _reflection.GeneratedProtocolMessageType('VodResponseHeaderControl', (_message.Message,), { 'DESCRIPTOR' : _VODRESPONSEHEADERCONTROL, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodResponseHeaderControl) }) _sym_db.RegisterMessage(VodResponseHeaderControl) VodTosAuthInformation = _reflection.GeneratedProtocolMessageType('VodTosAuthInformation', (_message.Message,), { 'DESCRIPTOR' : _VODTOSAUTHINFORMATION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodTosAuthInformation) }) _sym_db.RegisterMessage(VodTosAuthInformation) VodPrivateBucketAuth = _reflection.GeneratedProtocolMessageType('VodPrivateBucketAuth', (_message.Message,), { 'DESCRIPTOR' : _VODPRIVATEBUCKETAUTH, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPrivateBucketAuth) }) _sym_db.RegisterMessage(VodPrivateBucketAuth) VodOriginalConfig = _reflection.GeneratedProtocolMessageType('VodOriginalConfig', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINALCONFIG, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginalConfig) }) _sym_db.RegisterMessage(VodOriginalConfig) VodOriginalControl = _reflection.GeneratedProtocolMessageType('VodOriginalControl', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINALCONTROL, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginalControl) }) _sym_db.RegisterMessage(VodOriginalControl) VodDomainConfig = _reflection.GeneratedProtocolMessageType('VodDomainConfig', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINCONFIG, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainConfig) }) _sym_db.RegisterMessage(VodDomainConfig) CdnCondition = _reflection.GeneratedProtocolMessageType('CdnCondition', (_message.Message,), { 'DESCRIPTOR' : _CDNCONDITION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CdnCondition) }) _sym_db.RegisterMessage(CdnCondition) ConditionRule = _reflection.GeneratedProtocolMessageType('ConditionRule', (_message.Message,), { 'DESCRIPTOR' : _CONDITIONRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ConditionRule) }) _sym_db.RegisterMessage(ConditionRule) CacheControlRule = _reflection.GeneratedProtocolMessageType('CacheControlRule', (_message.Message,), { 'DESCRIPTOR' : _CACHECONTROLRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CacheControlRule) }) _sym_db.RegisterMessage(CacheControlRule) CacheAction = _reflection.GeneratedProtocolMessageType('CacheAction', (_message.Message,), { 'DESCRIPTOR' : _CACHEACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CacheAction) }) _sym_db.RegisterMessage(CacheAction) CacheKeyRule = _reflection.GeneratedProtocolMessageType('CacheKeyRule', (_message.Message,), { 'DESCRIPTOR' : _CACHEKEYRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CacheKeyRule) }) _sym_db.RegisterMessage(CacheKeyRule) CacheKeyAction = _reflection.GeneratedProtocolMessageType('CacheKeyAction', (_message.Message,), { 'DESCRIPTOR' : _CACHEKEYACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CacheKeyAction) }) _sym_db.RegisterMessage(CacheKeyAction) CacheKeyComponent = _reflection.GeneratedProtocolMessageType('CacheKeyComponent', (_message.Message,), { 'DESCRIPTOR' : _CACHEKEYCOMPONENT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CacheKeyComponent) }) _sym_db.RegisterMessage(CacheKeyComponent) CompressionAction = _reflection.GeneratedProtocolMessageType('CompressionAction', (_message.Message,), { 'DESCRIPTOR' : _COMPRESSIONACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CompressionAction) }) _sym_db.RegisterMessage(CompressionAction) CompressionRule = _reflection.GeneratedProtocolMessageType('CompressionRule', (_message.Message,), { 'DESCRIPTOR' : _COMPRESSIONRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CompressionRule) }) _sym_db.RegisterMessage(CompressionRule) Compression = _reflection.GeneratedProtocolMessageType('Compression', (_message.Message,), { 'DESCRIPTOR' : _COMPRESSION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Compression) }) _sym_db.RegisterMessage(Compression) SpeedLimitTime = _reflection.GeneratedProtocolMessageType('SpeedLimitTime', (_message.Message,), { 'DESCRIPTOR' : _SPEEDLIMITTIME, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SpeedLimitTime) }) _sym_db.RegisterMessage(SpeedLimitTime) DownloadSpeedLimitAction = _reflection.GeneratedProtocolMessageType('DownloadSpeedLimitAction', (_message.Message,), { 'DESCRIPTOR' : _DOWNLOADSPEEDLIMITACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DownloadSpeedLimitAction) }) _sym_db.RegisterMessage(DownloadSpeedLimitAction) DownloadSpeedLimitRule = _reflection.GeneratedProtocolMessageType('DownloadSpeedLimitRule', (_message.Message,), { 'DESCRIPTOR' : _DOWNLOADSPEEDLIMITRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DownloadSpeedLimitRule) }) _sym_db.RegisterMessage(DownloadSpeedLimitRule) DownloadSpeedLimit = _reflection.GeneratedProtocolMessageType('DownloadSpeedLimit', (_message.Message,), { 'DESCRIPTOR' : _DOWNLOADSPEEDLIMIT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DownloadSpeedLimit) }) _sym_db.RegisterMessage(DownloadSpeedLimit) ForcedRedirect = _reflection.GeneratedProtocolMessageType('ForcedRedirect', (_message.Message,), { 'DESCRIPTOR' : _FORCEDREDIRECT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ForcedRedirect) }) _sym_db.RegisterMessage(ForcedRedirect) HTTPS = _reflection.GeneratedProtocolMessageType('HTTPS', (_message.Message,), { 'DESCRIPTOR' : _HTTPS, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.HTTPS) }) _sym_db.RegisterMessage(HTTPS) CertInfo = _reflection.GeneratedProtocolMessageType('CertInfo', (_message.Message,), { 'DESCRIPTOR' : _CERTINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CertInfo) }) _sym_db.RegisterMessage(CertInfo) HttpForcedRedirect = _reflection.GeneratedProtocolMessageType('HttpForcedRedirect', (_message.Message,), { 'DESCRIPTOR' : _HTTPFORCEDREDIRECT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.HttpForcedRedirect) }) _sym_db.RegisterMessage(HttpForcedRedirect) CdnIPv6 = _reflection.GeneratedProtocolMessageType('CdnIPv6', (_message.Message,), { 'DESCRIPTOR' : _CDNIPV6, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CdnIPv6) }) _sym_db.RegisterMessage(CdnIPv6) RequestHeaderRule = _reflection.GeneratedProtocolMessageType('RequestHeaderRule', (_message.Message,), { 'DESCRIPTOR' : _REQUESTHEADERRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.RequestHeaderRule) }) _sym_db.RegisterMessage(RequestHeaderRule) RequestHeaderAction = _reflection.GeneratedProtocolMessageType('RequestHeaderAction', (_message.Message,), { 'DESCRIPTOR' : _REQUESTHEADERACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.RequestHeaderAction) }) _sym_db.RegisterMessage(RequestHeaderAction) RequestHeaderInstance = _reflection.GeneratedProtocolMessageType('RequestHeaderInstance', (_message.Message,), { 'DESCRIPTOR' : _REQUESTHEADERINSTANCE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.RequestHeaderInstance) }) _sym_db.RegisterMessage(RequestHeaderInstance) IpAccessRule = _reflection.GeneratedProtocolMessageType('IpAccessRule', (_message.Message,), { 'DESCRIPTOR' : _IPACCESSRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.IpAccessRule) }) _sym_db.RegisterMessage(IpAccessRule) CommonGlobalConfig = _reflection.GeneratedProtocolMessageType('CommonGlobalConfig', (_message.Message,), { 'DESCRIPTOR' : _COMMONGLOBALCONFIG, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CommonGlobalConfig) }) _sym_db.RegisterMessage(CommonGlobalConfig) MultiRange = _reflection.GeneratedProtocolMessageType('MultiRange', (_message.Message,), { 'DESCRIPTOR' : _MULTIRANGE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.MultiRange) }) _sym_db.RegisterMessage(MultiRange) UserAgentAccessRule = _reflection.GeneratedProtocolMessageType('UserAgentAccessRule', (_message.Message,), { 'DESCRIPTOR' : _USERAGENTACCESSRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.UserAgentAccessRule) }) _sym_db.RegisterMessage(UserAgentAccessRule) RefererAccessRule = _reflection.GeneratedProtocolMessageType('RefererAccessRule', (_message.Message,), { 'DESCRIPTOR' : _REFERERACCESSRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.RefererAccessRule) }) _sym_db.RegisterMessage(RefererAccessRule) ReferersType = _reflection.GeneratedProtocolMessageType('ReferersType', (_message.Message,), { 'DESCRIPTOR' : _REFERERSTYPE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ReferersType) }) _sym_db.RegisterMessage(ReferersType) CommonReferType = _reflection.GeneratedProtocolMessageType('CommonReferType', (_message.Message,), { 'DESCRIPTOR' : _COMMONREFERTYPE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CommonReferType) }) _sym_db.RegisterMessage(CommonReferType) VodDomainBasicInfo = _reflection.GeneratedProtocolMessageType('VodDomainBasicInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINBASICINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainBasicInfo) }) _sym_db.RegisterMessage(VodDomainBasicInfo) VodDescribeDomainConfigResult = _reflection.GeneratedProtocolMessageType('VodDescribeDomainConfigResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINCONFIGRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeDomainConfigResult) }) _sym_db.RegisterMessage(VodDescribeDomainConfigResult) VodPCDNDomainConfigInfo = _reflection.GeneratedProtocolMessageType('VodPCDNDomainConfigInfo', (_message.Message,), { 'DESCRIPTOR' : _VODPCDNDOMAINCONFIGINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPCDNDomainConfigInfo) }) _sym_db.RegisterMessage(VodPCDNDomainConfigInfo) VodPCDNDomainInstanceInfos = _reflection.GeneratedProtocolMessageType('VodPCDNDomainInstanceInfos', (_message.Message,), { 'DESCRIPTOR' : _VODPCDNDOMAININSTANCEINFOS, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPCDNDomainInstanceInfos) }) _sym_db.RegisterMessage(VodPCDNDomainInstanceInfos) VodPCDNDomainInfo = _reflection.GeneratedProtocolMessageType('VodPCDNDomainInfo', (_message.Message,), { 'DESCRIPTOR' : _VODPCDNDOMAININFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPCDNDomainInfo) }) _sym_db.RegisterMessage(VodPCDNDomainInfo) VodVerifyDomainOwnerResult = _reflection.GeneratedProtocolMessageType('VodVerifyDomainOwnerResult', (_message.Message,), { 'DESCRIPTOR' : _VODVERIFYDOMAINOWNERRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodVerifyDomainOwnerResult) }) _sym_db.RegisterMessage(VodVerifyDomainOwnerResult) VodDomainDNSVerifyInfo = _reflection.GeneratedProtocolMessageType('VodDomainDNSVerifyInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINDNSVERIFYINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainDNSVerifyInfo) }) _sym_db.RegisterMessage(VodDomainDNSVerifyInfo) VodDomainFileVerifyInfo = _reflection.GeneratedProtocolMessageType('VodDomainFileVerifyInfo', (_message.Message,), { 'DESCRIPTOR' : _VODDOMAINFILEVERIFYINFO, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDomainFileVerifyInfo) }) _sym_db.RegisterMessage(VodDomainFileVerifyInfo) VodDescribeDomainVerifyContentResult = _reflection.GeneratedProtocolMessageType('VodDescribeDomainVerifyContentResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINVERIFYCONTENTRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeDomainVerifyContentResult) }) _sym_db.RegisterMessage(VodDescribeDomainVerifyContentResult) VodDescribeCdnEdgeIpResult = _reflection.GeneratedProtocolMessageType('VodDescribeCdnEdgeIpResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNEDGEIPRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeCdnEdgeIpResult) }) _sym_db.RegisterMessage(VodDescribeCdnEdgeIpResult) VodDescribeCdnRegionAndIspResult = _reflection.GeneratedProtocolMessageType('VodDescribeCdnRegionAndIspResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNREGIONANDISPRESULT, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeCdnRegionAndIspResult) }) _sym_db.RegisterMessage(VodDescribeCdnRegionAndIspResult) NamePair = _reflection.GeneratedProtocolMessageType('NamePair', (_message.Message,), { 'DESCRIPTOR' : _NAMEPAIR, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.NamePair) }) _sym_db.RegisterMessage(NamePair) VodOriginRewriteAction = _reflection.GeneratedProtocolMessageType('VodOriginRewriteAction', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINREWRITEACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginRewriteAction) }) _sym_db.RegisterMessage(VodOriginRewriteAction) VodOriginRewriteRule = _reflection.GeneratedProtocolMessageType('VodOriginRewriteRule', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINREWRITERULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginRewriteRule) }) _sym_db.RegisterMessage(VodOriginRewriteRule) VodOriginRewrite = _reflection.GeneratedProtocolMessageType('VodOriginRewrite', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINREWRITE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginRewrite) }) _sym_db.RegisterMessage(VodOriginRewrite) VodOriginArgRule = _reflection.GeneratedProtocolMessageType('VodOriginArgRule', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINARGRULE, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginArgRule) }) _sym_db.RegisterMessage(VodOriginArgRule) VodOriginArgAction = _reflection.GeneratedProtocolMessageType('VodOriginArgAction', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINARGACTION, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginArgAction) }) _sym_db.RegisterMessage(VodOriginArgAction) VodOriginArgComponents = _reflection.GeneratedProtocolMessageType('VodOriginArgComponents', (_message.Message,), { 'DESCRIPTOR' : _VODORIGINARGCOMPONENTS, '__module__' : 'volcengine.vod.business.vod_cdn_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodOriginArgComponents) }) _sym_db.RegisterMessage(VodOriginArgComponents) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\006VodCdnP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODDOMAINSOURCESTATIONTYPE._serialized_start=13540 _VODDOMAINSOURCESTATIONTYPE._serialized_end=13686 _VODDOMAINSOURCESTATIONADDRESSTYPE._serialized_start=13689 _VODDOMAINSOURCESTATIONADDRESSTYPE._serialized_end=13900 _VODDOMAINCONFIGINFO._serialized_start=116 _VODDOMAINCONFIGINFO._serialized_end=379 _VODDOMAININSTANCEINFOS._serialized_start=382 _VODDOMAININSTANCEINFOS._serialized_end=563 _VODDOMAININSTANCEINFO._serialized_start=565 _VODDOMAININSTANCEINFO._serialized_end=653 _VODDOMAINOINFO._serialized_start=656 _VODDOMAINOINFO._serialized_end=1006 _VODDOMAINCERTIFICATEINFO._serialized_start=1009 _VODDOMAINCERTIFICATEINFO._serialized_end=1211 _VODCREATECDNTASKRESULT._serialized_start=1213 _VODCREATECDNTASKRESULT._serialized_end=1253 _VODCONTENTINFO._serialized_start=1256 _VODCONTENTINFO._serialized_end=1393 _VODCDNTASKRESULT._serialized_start=1396 _VODCDNTASKRESULT._serialized_end=1539 _VODCDNACCESSLOGELEMENT._serialized_start=1541 _VODCDNACCESSLOGELEMENT._serialized_end=1668 _VODCDNACCESSLOGINFO._serialized_start=1671 _VODCDNACCESSLOGINFO._serialized_end=1836 _VODLISTCDNACCESSLOGRESULT._serialized_start=1838 _VODLISTCDNACCESSLOGRESULT._serialized_end=1932 _VODCDNTOPACCESSURLELEMENT._serialized_start=1934 _VODCDNTOPACCESSURLELEMENT._serialized_end=2000 _VODLISTCDNTOPACCESSURLRESULT._serialized_start=2002 _VODLISTCDNTOPACCESSURLRESULT._serialized_end=2109 _VODCDNTOPACCESSELEMENT._serialized_start=2111 _VODCDNTOPACCESSELEMENT._serialized_end=2167 _VODLISTCDNTOPACCESSRESULT._serialized_start=2169 _VODLISTCDNTOPACCESSRESULT._serialized_end=2271 _VODBANDWIDTHDATA._serialized_start=2273 _VODBANDWIDTHDATA._serialized_end=2324 _VODDESCRIBEVODDOMAINBANDWIDTHDATARESULT._serialized_start=2327 _VODDESCRIBEVODDOMAINBANDWIDTHDATARESULT._serialized_end=2710 _VODCDNSTATISTICSDATA._serialized_start=2713 _VODCDNSTATISTICSDATA._serialized_end=2893 _VODCDNSTATISTICSCOMMONRESULT._serialized_start=2896 _VODCDNSTATISTICSCOMMONRESULT._serialized_end=3024 _VODCDNIPINFO._serialized_start=3026 _VODCDNIPINFO._serialized_end=3098 _VODDESCRIBEIPINFORESULT._serialized_start=3100 _VODDESCRIBEIPINFORESULT._serialized_end=3186 _VODTRAFFICDATA._serialized_start=3188 _VODTRAFFICDATA._serialized_end=3235 _VODDESCRIBEVODDOMAINTRAFFICDATARESULT._serialized_start=3238 _VODDESCRIBEVODDOMAINTRAFFICDATARESULT._serialized_end=3531 _VODDOMAINSOURCEINFO._serialized_start=3534 _VODDOMAINSOURCEINFO._serialized_end=3834 _VODDOMAINORIGINBUCKETINFO._serialized_start=3836 _VODDOMAINORIGINBUCKETINFO._serialized_end=3931 _VODSUBMITBLOCKTASKSRESULT._serialized_start=3933 _VODSUBMITBLOCKTASKSRESULT._serialized_end=3976 _VODGETCONTENTBLOCKTASKSRESULT._serialized_start=3979 _VODGETCONTENTBLOCKTASKSRESULT._serialized_end=4119 _CONTENTTASK._serialized_start=4121 _CONTENTTASK._serialized_end=4217 _IPV6._serialized_start=4219 _IPV6._serialized_end=4241 _ORIGINLINE._serialized_start=4244 _ORIGINLINE._serialized_end=4388 _ORIGINACTION._serialized_start=4390 _ORIGINACTION._serialized_end=4469 _CDNORIGINRULE._serialized_start=4471 _CDNORIGINRULE._serialized_end=4554 _VODRESPONSEHEADERINSTANCE._serialized_start=4556 _VODRESPONSEHEADERINSTANCE._serialized_end=4675 _VODRESPONSEHEADERACTION._serialized_start=4677 _VODRESPONSEHEADERACTION._serialized_end=4794 _VODRESPONSEHEADERRULE._serialized_start=4796 _VODRESPONSEHEADERRULE._serialized_end=4906 _VODRESPONSEHEADERCONTROL._serialized_start=4908 _VODRESPONSEHEADERCONTROL._serialized_end=5013 _VODTOSAUTHINFORMATION._serialized_start=5015 _VODTOSAUTHINFORMATION._serialized_end=5084 _VODPRIVATEBUCKETAUTH._serialized_start=5087 _VODPRIVATEBUCKETAUTH._serialized_end=5226 _VODORIGINALCONFIG._serialized_start=5229 _VODORIGINALCONFIG._serialized_end=5579 _VODORIGINALCONTROL._serialized_start=5581 _VODORIGINALCONTROL._serialized_end=5707 _VODDOMAINCONFIG._serialized_start=5710 _VODDOMAINCONFIG._serialized_end=7068 _CDNCONDITION._serialized_start=7070 _CDNCONDITION._serialized_end=7194 _CONDITIONRULE._serialized_start=7197 _CONDITIONRULE._serialized_end=7338 _CACHECONTROLRULE._serialized_start=7341 _CACHECONTROLRULE._serialized_end=7530 _CACHEACTION._serialized_start=7533 _CACHEACTION._serialized_end=7690 _CACHEKEYRULE._serialized_start=7693 _CACHEKEYRULE._serialized_end=7887 _CACHEKEYACTION._serialized_start=7889 _CACHEKEYACTION._serialized_end=7984 _CACHEKEYCOMPONENT._serialized_start=7987 _CACHEKEYCOMPONENT._serialized_end=8148 _COMPRESSIONACTION._serialized_start=8151 _COMPRESSIONACTION._serialized_end=8395 _COMPRESSIONRULE._serialized_start=8398 _COMPRESSIONRULE._serialized_end=8604 _COMPRESSION._serialized_start=8606 _COMPRESSION._serialized_end=8726 _SPEEDLIMITTIME._serialized_start=8728 _SPEEDLIMITTIME._serialized_end=8850 _DOWNLOADSPEEDLIMITACTION._serialized_start=8853 _DOWNLOADSPEEDLIMITACTION._serialized_end=9081 _DOWNLOADSPEEDLIMITRULE._serialized_start=9084 _DOWNLOADSPEEDLIMITRULE._serialized_end=9318 _DOWNLOADSPEEDLIMIT._serialized_start=9321 _DOWNLOADSPEEDLIMIT._serialized_end=9462 _FORCEDREDIRECT._serialized_start=9464 _FORCEDREDIRECT._serialized_end=9580 _HTTPS._serialized_start=9583 _HTTPS._serialized_end=9846 _CERTINFO._serialized_start=9848 _CERTINFO._serialized_end=9890 _HTTPFORCEDREDIRECT._serialized_start=9892 _HTTPFORCEDREDIRECT._serialized_end=10012 _CDNIPV6._serialized_start=10014 _CDNIPV6._serialized_end=10055 _REQUESTHEADERRULE._serialized_start=10058 _REQUESTHEADERRULE._serialized_end=10272 _REQUESTHEADERACTION._serialized_start=10274 _REQUESTHEADERACTION._serialized_end=10382 _REQUESTHEADERINSTANCE._serialized_start=10385 _REQUESTHEADERINSTANCE._serialized_end=10534 _IPACCESSRULE._serialized_start=10536 _IPACCESSRULE._serialized_end=10630 _COMMONGLOBALCONFIG._serialized_start=10632 _COMMONGLOBALCONFIG._serialized_end=10692 _MULTIRANGE._serialized_start=10694 _MULTIRANGE._serialized_end=10738 _USERAGENTACCESSRULE._serialized_start=10741 _USERAGENTACCESSRULE._serialized_end=10929 _REFERERACCESSRULE._serialized_start=10932 _REFERERACCESSRULE._serialized_end=11167 _REFERERSTYPE._serialized_start=11169 _REFERERSTYPE._serialized_end=11272 _COMMONREFERTYPE._serialized_start=11274 _COMMONREFERTYPE._serialized_end=11393 _VODDOMAINBASICINFO._serialized_start=11395 _VODDOMAINBASICINFO._serialized_end=11508 _VODDESCRIBEDOMAINCONFIGRESULT._serialized_start=11511 _VODDESCRIBEDOMAINCONFIGRESULT._serialized_end=11694 _VODPCDNDOMAINCONFIGINFO._serialized_start=11697 _VODPCDNDOMAINCONFIGINFO._serialized_end=11858 _VODPCDNDOMAININSTANCEINFOS._serialized_start=11860 _VODPCDNDOMAININSTANCEINFOS._serialized_end=11956 _VODPCDNDOMAININFO._serialized_start=11958 _VODPCDNDOMAININFO._serialized_end=12049 _VODVERIFYDOMAINOWNERRESULT._serialized_start=12051 _VODVERIFYDOMAINOWNERRESULT._serialized_end=12123 _VODDOMAINDNSVERIFYINFO._serialized_start=12125 _VODDOMAINDNSVERIFYINFO._serialized_end=12204 _VODDOMAINFILEVERIFYINFO._serialized_start=12206 _VODDOMAINFILEVERIFYINFO._serialized_end=12305 _VODDESCRIBEDOMAINVERIFYCONTENTRESULT._serialized_start=12308 _VODDESCRIBEDOMAINVERIFYCONTENTRESULT._serialized_end=12526 _VODDESCRIBECDNEDGEIPRESULT._serialized_start=12528 _VODDESCRIBECDNEDGEIPRESULT._serialized_end=12590 _VODDESCRIBECDNREGIONANDISPRESULT._serialized_start=12593 _VODDESCRIBECDNREGIONANDISPRESULT._serialized_end=12742 _NAMEPAIR._serialized_start=12744 _NAMEPAIR._serialized_end=12782 _VODORIGINREWRITEACTION._serialized_start=12784 _VODORIGINREWRITEACTION._serialized_end=12869 _VODORIGINREWRITERULE._serialized_start=12871 _VODORIGINREWRITERULE._serialized_end=12978 _VODORIGINREWRITE._serialized_start=12980 _VODORIGINREWRITE._serialized_end=13095 _VODORIGINARGRULE._serialized_start=13098 _VODORIGINARGRULE._serialized_end=13302 _VODORIGINARGACTION._serialized_start=13304 _VODORIGINARGACTION._serialized_end=13409 _VODORIGINARGCOMPONENTS._serialized_start=13411 _VODORIGINARGCOMPONENTS._serialized_end=13537 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_common_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_common.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(volcengine/vod/business/vod_common.proto\x12\x1eVolcengine.Vod.Models.Business\"\xe3\x04\n\rVodSourceInfo\x12\x0e\n\x06\x46ileId\x18\x01 \x01(\t\x12\x0b\n\x03Md5\x18\x02 \x01(\t\x12\x10\n\x08\x46ileType\x18\x03 \x01(\t\x12\r\n\x05\x43odec\x18\x04 \x01(\t\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\r\n\x05Width\x18\x06 \x01(\x05\x12\x0e\n\x06\x46ormat\x18\x07 \x01(\t\x12\x10\n\x08\x44uration\x18\x08 \x01(\x02\x12\x0c\n\x04Size\x18\t \x01(\x01\x12\x10\n\x08StoreUri\x18\n \x01(\t\x12\x12\n\nDefinition\x18\x0b \x01(\t\x12\x0f\n\x07\x42itrate\x18\x0c \x01(\x05\x12\x0b\n\x03\x46ps\x18\r \x01(\x02\x12\x12\n\nCreateTime\x18\x0e \x01(\t\x12\x0f\n\x07Quality\x18\x0f \x01(\t\x12\x14\n\x0c\x44ynamicRange\x18\x10 \x01(\t\x12K\n\x0fVideoStreamMeta\x18\x11 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodVideoStreamMeta\x12K\n\x0f\x41udioStreamMeta\x18\x12 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodAudioStreamMeta\x12\x17\n\x0fTosStorageClass\x18\x13 \x01(\t\x12\x10\n\x08\x46ileName\x18\x14 \x01(\t\x12O\n\tFileExtra\x18\x15 \x03(\x0b\x32<.Volcengine.Vod.Models.Business.VodSourceInfo.FileExtraEntry\x1a\x30\n\x0e\x46ileExtraEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"}\n\x12VodAudioStreamMeta\x12\r\n\x05\x43odec\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x02\x12\x12\n\nSampleRate\x18\x03 \x01(\x05\x12\x0f\n\x07\x42itrate\x18\x04 \x01(\x05\x12\x0f\n\x07Quality\x18\x05 \x01(\t\x12\x10\n\x08\x43hannels\x18\x06 \x01(\x05\"\x86\x01\n\x12VodVideoStreamMeta\x12\r\n\x05\x43odec\x18\x01 \x01(\t\x12\x0e\n\x06Height\x18\x02 \x01(\x05\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x10\n\x08\x44uration\x18\x04 \x01(\x02\x12\x12\n\nDefinition\x18\x05 \x01(\t\x12\x0f\n\x07\x42itrate\x18\x06 \x01(\x05\x12\x0b\n\x03\x46ps\x18\x07 \x01(\x02\"\x89\x04\n\x10VodTranscodeInfo\x12\x0e\n\x06\x46ileId\x18\x01 \x01(\t\x12\x0b\n\x03Md5\x18\x02 \x01(\t\x12\x10\n\x08\x46ileType\x18\x03 \x01(\t\x12\x10\n\x08LogoType\x18\x04 \x01(\t\x12\x0f\n\x07\x45ncrypt\x18\x05 \x01(\x08\x12\x0e\n\x06\x46ormat\x18\x06 \x01(\t\x12\x10\n\x08\x44uration\x18\x07 \x01(\x02\x12\x0c\n\x04Size\x18\x08 \x01(\x01\x12\x10\n\x08StoreUri\x18\t \x01(\t\x12K\n\x0fVideoStreamMeta\x18\n \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodVideoStreamMeta\x12K\n\x0f\x41udioStreamMeta\x18\x0b \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodAudioStreamMeta\x12\x12\n\nCreateTime\x18\x0c \x01(\t\x12\x14\n\x0c\x44ynamicRange\x18\r \x01(\t\x12\x17\n\x0fTosStorageClass\x18\x0e \x01(\t\x12R\n\tFileExtra\x18\x0f \x03(\x0b\x32?.Volcengine.Vod.Models.Business.VodTranscodeInfo.FileExtraEntry\x1a\x30\n\x0e\x46ileExtraEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"S\n\x0fVodAdaptiveInfo\x12\x13\n\x0bMainPlayUrl\x18\x01 \x01(\t\x12\x15\n\rBackupPlayUrl\x18\x02 \x01(\t\x12\x14\n\x0c\x41\x64\x61ptiveType\x18\x03 \x01(\t\"\xb7\x04\n\x0bVodPlayInfo\x12\x0e\n\x06\x46ileId\x18\x01 \x01(\t\x12\x0b\n\x03Md5\x18\x02 \x01(\t\x12\x10\n\x08\x46ileType\x18\x03 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x04 \x01(\t\x12\r\n\x05\x43odec\x18\x05 \x01(\t\x12\x12\n\nDefinition\x18\x06 \x01(\t\x12\x13\n\x0bMainPlayUrl\x18\x07 \x01(\t\x12\x15\n\rBackupPlayUrl\x18\x08 \x01(\t\x12\x0f\n\x07\x42itrate\x18\t \x01(\x05\x12\r\n\x05Width\x18\n \x01(\x05\x12\x0e\n\x06Height\x18\x0b \x01(\x05\x12\x0c\n\x04Size\x18\x0c \x01(\x01\x12\x11\n\tCheckInfo\x18\r \x01(\t\x12\x12\n\nIndexRange\x18\x0e \x01(\t\x12\x11\n\tInitRange\x18\x0f \x01(\t\x12\x10\n\x08PlayAuth\x18\x10 \x01(\t\x12\x12\n\nPlayAuthId\x18\x11 \x01(\t\x12\x10\n\x08LogoType\x18\x12 \x01(\t\x12\x0f\n\x07Quality\x18\x13 \x01(\t\x12\x19\n\x11\x42\x61rrageMaskOffset\x18\x14 \x01(\t\x12\x10\n\x08\x44uration\x18\x15 \x01(\x02\x12\x19\n\x11KeyFrameAlignment\x18\x16 \x01(\t\x12=\n\x06Volume\x18\x17 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodVolumeInfo\x12\x15\n\rMainUrlExpire\x18\x18 \x01(\t\x12\x17\n\x0f\x42\x61\x63kupUrlExpire\x18\x19 \x01(\t\x12\x0f\n\x07\x44rmType\x18\x1a \x01(\t\x12\x11\n\tPlayScene\x18\x1b \x01(\t\"/\n\rVodVolumeInfo\x12\x10\n\x08Loudness\x18\x01 \x01(\x01\x12\x0c\n\x04Peak\x18\x02 \x01(\x01\"\xa3\x01\n\x0f\x42\x61rrageMaskInfo\x12\x0f\n\x07Version\x18\x01 \x01(\t\x12\x16\n\x0e\x42\x61rrageMaskUrl\x18\x02 \x01(\t\x12\x0e\n\x06\x46ileId\x18\x03 \x01(\t\x12\x10\n\x08\x46ileSize\x18\x04 \x01(\x01\x12\x10\n\x08\x46ileHash\x18\x05 \x01(\t\x12\x11\n\tUpdatedAt\x18\x06 \x01(\t\x12\x0f\n\x07\x42itrate\x18\x07 \x01(\x05\x12\x0f\n\x07HeadLen\x18\x08 \x01(\x01\"\xa0\x01\n\x0cVodThumbInfo\x12\x12\n\nCaptureNum\x18\x01 \x01(\x05\x12\x11\n\tStoreUrls\x18\x02 \x03(\t\x12\x11\n\tCellWidth\x18\x03 \x01(\x05\x12\x12\n\nCellHeight\x18\x04 \x01(\x05\x12\x0f\n\x07ImgXLen\x18\x05 \x01(\x05\x12\x0f\n\x07ImgYLen\x18\x06 \x01(\x05\x12\x10\n\x08Interval\x18\x07 \x01(\x01\x12\x0e\n\x06\x46ormat\x18\x08 \x01(\t\"\x80\x02\n\x0fVodSubtitleInfo\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06\x46ileId\x18\x02 \x01(\t\x12\x10\n\x08Language\x18\x03 \x01(\t\x12\x12\n\nLanguageId\x18\x04 \x01(\x05\x12\x0e\n\x06\x46ormat\x18\x05 \x01(\t\x12\x12\n\nSubtitleId\x18\x06 \x01(\t\x12\r\n\x05Title\x18\x07 \x01(\t\x12\x0b\n\x03Tag\x18\x08 \x01(\t\x12\x0e\n\x06Status\x18\t \x01(\t\x12\x0e\n\x06Source\x18\n \x01(\t\x12\x10\n\x08StoreUri\x18\x0b \x01(\t\x12\x13\n\x0bSubtitleUrl\x18\x0c \x01(\t\x12\x12\n\nCreateTime\x18\r \x01(\t\x12\x0f\n\x07Version\x18\x0e \x01(\t\"A\n\x13VodCommonConfigInfo\x12\x0e\n\x06Module\x18\x01 \x01(\t\x12\x0b\n\x03Key\x18\x02 \x01(\t\x12\r\n\x05Value\x18\x03 \x01(\t\"\xbc\x05\n\x10VodPlayInfoModel\x12H\n\x07Version\x18\n \x01(\x0e\x32\x37.Volcengine.Vod.Models.Business.VodPlayInfoModelVersion\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\x05\x12\x11\n\tPosterUrl\x18\x03 \x01(\t\x12\x10\n\x08\x44uration\x18\x04 \x01(\x02\x12\x10\n\x08\x46ileType\x18\x05 \x01(\t\x12\x16\n\x0e\x45nableAdaptive\x18\x06 \x01(\x08\x12\x12\n\nTotalCount\x18\x07 \x01(\x05\x12\x45\n\x0c\x41\x64\x61ptiveInfo\x18\x08 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.VodAdaptiveInfo\x12\x41\n\x0cPlayInfoList\x18\t \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodPlayInfo\x12\x43\n\rThumbInfoList\x18\x0b \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodThumbInfo\x12\x16\n\x0e\x42\x61rrageMaskUrl\x18\x0c \x01(\t\x12I\n\x10SubtitleInfoList\x18\r \x03(\x0b\x32/.Volcengine.Vod.Models.Business.VodSubtitleInfo\x12H\n\x0f\x42\x61rrageMaskInfo\x18\x0e \x01(\x0b\x32/.Volcengine.Vod.Models.Business.BarrageMaskInfo\x12\x62\n\x1c\x41\x64\x61ptiveBitrateStreamingInfo\x18\x0f \x01(\x0b\x32<.Volcengine.Vod.Models.Business.AdaptiveBitrateStreamingInfo\"]\n\x1c\x41\x64\x61ptiveBitrateStreamingInfo\x12\x13\n\x0bMainPlayUrl\x18\x01 \x01(\t\x12\x15\n\rBackupPlayUrl\x18\x02 \x01(\t\x12\x11\n\tAbrFormat\x18\x03 \x01(\t\",\n\x08VodPoint\x12\x11\n\tTimestamp\x18\x01 \x01(\x01\x12\r\n\x05Value\x18\x02 \x01(\x01\"\x96\x01\n\x14VodAllPlayInfoResult\x12T\n\x17VodAllPlayInfoModelList\x18\x01 \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodAllPlayInfoModel\x12\x12\n\nTotalCount\x18\x02 \x01(\x05\x12\x14\n\x0cNotFoundVids\x18\x03 \x03(\t\"\xc0\x04\n\x13VodAllPlayInfoModel\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\x05\x12\x11\n\tPosterUrl\x18\x03 \x01(\t\x12\x12\n\nTotalCount\x18\x04 \x01(\x05\x12\x16\n\x0e\x45nableAdaptive\x18\x05 \x01(\x08\x12I\n\x14VodTranscodePlayInfo\x18\x06 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodPlayInfo\x12\x46\n\x11VodSourcePlayInfo\x18\x07 \x01(\x0b\x32+.Volcengine.Vod.Models.Business.VodPlayInfo\x12H\n\x07Version\x18\x08 \x01(\x0e\x32\x37.Volcengine.Vod.Models.Business.VodPlayInfoModelVersion\x12\x43\n\rThumbInfoList\x18\t \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodThumbInfo\x12\x16\n\x0e\x42\x61rrageMaskUrl\x18\n \x01(\t\x12I\n\x10SubtitleInfoList\x18\x0b \x03(\x0b\x32/.Volcengine.Vod.Models.Business.VodSubtitleInfo\x12H\n\x0f\x42\x61rrageMaskInfo\x18\x0c \x01(\x0b\x32/.Volcengine.Vod.Models.Business.BarrageMaskInfo*\xd6\x01\n\x17VodPlayInfoModelVersion\x12$\n UndefinedVodPlayInfoModelVersion\x10\x00\x12%\n!InternalV1VodPlayInfoModelVersion\x10\x01\x12%\n!InternalV2VodPlayInfoModelVersion\x10\x02\x12%\n!InternalV3VodPlayInfoModelVersion\x10\x03\x12 \n\x1cToBV1VodPlayInfoModelVersion\x10\x04\x42\xcd\x01\n)com.volcengine.service.vod.model.businessB\tVodCommonP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODPLAYINFOMODELVERSION = DESCRIPTOR.enum_types_by_name['VodPlayInfoModelVersion'] VodPlayInfoModelVersion = enum_type_wrapper.EnumTypeWrapper(_VODPLAYINFOMODELVERSION) UndefinedVodPlayInfoModelVersion = 0 InternalV1VodPlayInfoModelVersion = 1 InternalV2VodPlayInfoModelVersion = 2 InternalV3VodPlayInfoModelVersion = 3 ToBV1VodPlayInfoModelVersion = 4 _VODSOURCEINFO = DESCRIPTOR.message_types_by_name['VodSourceInfo'] _VODSOURCEINFO_FILEEXTRAENTRY = _VODSOURCEINFO.nested_types_by_name['FileExtraEntry'] _VODAUDIOSTREAMMETA = DESCRIPTOR.message_types_by_name['VodAudioStreamMeta'] _VODVIDEOSTREAMMETA = DESCRIPTOR.message_types_by_name['VodVideoStreamMeta'] _VODTRANSCODEINFO = DESCRIPTOR.message_types_by_name['VodTranscodeInfo'] _VODTRANSCODEINFO_FILEEXTRAENTRY = _VODTRANSCODEINFO.nested_types_by_name['FileExtraEntry'] _VODADAPTIVEINFO = DESCRIPTOR.message_types_by_name['VodAdaptiveInfo'] _VODPLAYINFO = DESCRIPTOR.message_types_by_name['VodPlayInfo'] _VODVOLUMEINFO = DESCRIPTOR.message_types_by_name['VodVolumeInfo'] _BARRAGEMASKINFO = DESCRIPTOR.message_types_by_name['BarrageMaskInfo'] _VODTHUMBINFO = DESCRIPTOR.message_types_by_name['VodThumbInfo'] _VODSUBTITLEINFO = DESCRIPTOR.message_types_by_name['VodSubtitleInfo'] _VODCOMMONCONFIGINFO = DESCRIPTOR.message_types_by_name['VodCommonConfigInfo'] _VODPLAYINFOMODEL = DESCRIPTOR.message_types_by_name['VodPlayInfoModel'] _ADAPTIVEBITRATESTREAMINGINFO = DESCRIPTOR.message_types_by_name['AdaptiveBitrateStreamingInfo'] _VODPOINT = DESCRIPTOR.message_types_by_name['VodPoint'] _VODALLPLAYINFORESULT = DESCRIPTOR.message_types_by_name['VodAllPlayInfoResult'] _VODALLPLAYINFOMODEL = DESCRIPTOR.message_types_by_name['VodAllPlayInfoModel'] VodSourceInfo = _reflection.GeneratedProtocolMessageType('VodSourceInfo', (_message.Message,), { 'FileExtraEntry' : _reflection.GeneratedProtocolMessageType('FileExtraEntry', (_message.Message,), { 'DESCRIPTOR' : _VODSOURCEINFO_FILEEXTRAENTRY, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSourceInfo.FileExtraEntry) }) , 'DESCRIPTOR' : _VODSOURCEINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSourceInfo) }) _sym_db.RegisterMessage(VodSourceInfo) _sym_db.RegisterMessage(VodSourceInfo.FileExtraEntry) VodAudioStreamMeta = _reflection.GeneratedProtocolMessageType('VodAudioStreamMeta', (_message.Message,), { 'DESCRIPTOR' : _VODAUDIOSTREAMMETA, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAudioStreamMeta) }) _sym_db.RegisterMessage(VodAudioStreamMeta) VodVideoStreamMeta = _reflection.GeneratedProtocolMessageType('VodVideoStreamMeta', (_message.Message,), { 'DESCRIPTOR' : _VODVIDEOSTREAMMETA, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodVideoStreamMeta) }) _sym_db.RegisterMessage(VodVideoStreamMeta) VodTranscodeInfo = _reflection.GeneratedProtocolMessageType('VodTranscodeInfo', (_message.Message,), { 'FileExtraEntry' : _reflection.GeneratedProtocolMessageType('FileExtraEntry', (_message.Message,), { 'DESCRIPTOR' : _VODTRANSCODEINFO_FILEEXTRAENTRY, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodTranscodeInfo.FileExtraEntry) }) , 'DESCRIPTOR' : _VODTRANSCODEINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodTranscodeInfo) }) _sym_db.RegisterMessage(VodTranscodeInfo) _sym_db.RegisterMessage(VodTranscodeInfo.FileExtraEntry) VodAdaptiveInfo = _reflection.GeneratedProtocolMessageType('VodAdaptiveInfo', (_message.Message,), { 'DESCRIPTOR' : _VODADAPTIVEINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAdaptiveInfo) }) _sym_db.RegisterMessage(VodAdaptiveInfo) VodPlayInfo = _reflection.GeneratedProtocolMessageType('VodPlayInfo', (_message.Message,), { 'DESCRIPTOR' : _VODPLAYINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPlayInfo) }) _sym_db.RegisterMessage(VodPlayInfo) VodVolumeInfo = _reflection.GeneratedProtocolMessageType('VodVolumeInfo', (_message.Message,), { 'DESCRIPTOR' : _VODVOLUMEINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodVolumeInfo) }) _sym_db.RegisterMessage(VodVolumeInfo) BarrageMaskInfo = _reflection.GeneratedProtocolMessageType('BarrageMaskInfo', (_message.Message,), { 'DESCRIPTOR' : _BARRAGEMASKINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.BarrageMaskInfo) }) _sym_db.RegisterMessage(BarrageMaskInfo) VodThumbInfo = _reflection.GeneratedProtocolMessageType('VodThumbInfo', (_message.Message,), { 'DESCRIPTOR' : _VODTHUMBINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodThumbInfo) }) _sym_db.RegisterMessage(VodThumbInfo) VodSubtitleInfo = _reflection.GeneratedProtocolMessageType('VodSubtitleInfo', (_message.Message,), { 'DESCRIPTOR' : _VODSUBTITLEINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubtitleInfo) }) _sym_db.RegisterMessage(VodSubtitleInfo) VodCommonConfigInfo = _reflection.GeneratedProtocolMessageType('VodCommonConfigInfo', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMONCONFIGINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCommonConfigInfo) }) _sym_db.RegisterMessage(VodCommonConfigInfo) VodPlayInfoModel = _reflection.GeneratedProtocolMessageType('VodPlayInfoModel', (_message.Message,), { 'DESCRIPTOR' : _VODPLAYINFOMODEL, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPlayInfoModel) }) _sym_db.RegisterMessage(VodPlayInfoModel) AdaptiveBitrateStreamingInfo = _reflection.GeneratedProtocolMessageType('AdaptiveBitrateStreamingInfo', (_message.Message,), { 'DESCRIPTOR' : _ADAPTIVEBITRATESTREAMINGINFO, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AdaptiveBitrateStreamingInfo) }) _sym_db.RegisterMessage(AdaptiveBitrateStreamingInfo) VodPoint = _reflection.GeneratedProtocolMessageType('VodPoint', (_message.Message,), { 'DESCRIPTOR' : _VODPOINT, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPoint) }) _sym_db.RegisterMessage(VodPoint) VodAllPlayInfoResult = _reflection.GeneratedProtocolMessageType('VodAllPlayInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODALLPLAYINFORESULT, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAllPlayInfoResult) }) _sym_db.RegisterMessage(VodAllPlayInfoResult) VodAllPlayInfoModel = _reflection.GeneratedProtocolMessageType('VodAllPlayInfoModel', (_message.Message,), { 'DESCRIPTOR' : _VODALLPLAYINFOMODEL, '__module__' : 'volcengine.vod.business.vod_common_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAllPlayInfoModel) }) _sym_db.RegisterMessage(VodAllPlayInfoModel) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\tVodCommonP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODSOURCEINFO_FILEEXTRAENTRY._options = None _VODSOURCEINFO_FILEEXTRAENTRY._serialized_options = b'8\001' _VODTRANSCODEINFO_FILEEXTRAENTRY._options = None _VODTRANSCODEINFO_FILEEXTRAENTRY._serialized_options = b'8\001' _VODPLAYINFOMODELVERSION._serialized_start=4414 _VODPLAYINFOMODELVERSION._serialized_end=4628 _VODSOURCEINFO._serialized_start=77 _VODSOURCEINFO._serialized_end=688 _VODSOURCEINFO_FILEEXTRAENTRY._serialized_start=640 _VODSOURCEINFO_FILEEXTRAENTRY._serialized_end=688 _VODAUDIOSTREAMMETA._serialized_start=690 _VODAUDIOSTREAMMETA._serialized_end=815 _VODVIDEOSTREAMMETA._serialized_start=818 _VODVIDEOSTREAMMETA._serialized_end=952 _VODTRANSCODEINFO._serialized_start=955 _VODTRANSCODEINFO._serialized_end=1476 _VODTRANSCODEINFO_FILEEXTRAENTRY._serialized_start=640 _VODTRANSCODEINFO_FILEEXTRAENTRY._serialized_end=688 _VODADAPTIVEINFO._serialized_start=1478 _VODADAPTIVEINFO._serialized_end=1561 _VODPLAYINFO._serialized_start=1564 _VODPLAYINFO._serialized_end=2131 _VODVOLUMEINFO._serialized_start=2133 _VODVOLUMEINFO._serialized_end=2180 _BARRAGEMASKINFO._serialized_start=2183 _BARRAGEMASKINFO._serialized_end=2346 _VODTHUMBINFO._serialized_start=2349 _VODTHUMBINFO._serialized_end=2509 _VODSUBTITLEINFO._serialized_start=2512 _VODSUBTITLEINFO._serialized_end=2768 _VODCOMMONCONFIGINFO._serialized_start=2770 _VODCOMMONCONFIGINFO._serialized_end=2835 _VODPLAYINFOMODEL._serialized_start=2838 _VODPLAYINFOMODEL._serialized_end=3538 _ADAPTIVEBITRATESTREAMINGINFO._serialized_start=3540 _ADAPTIVEBITRATESTREAMINGINFO._serialized_end=3633 _VODPOINT._serialized_start=3635 _VODPOINT._serialized_end=3679 _VODALLPLAYINFORESULT._serialized_start=3682 _VODALLPLAYINFORESULT._serialized_end=3832 _VODALLPLAYINFOMODEL._serialized_start=3835 _VODALLPLAYINFOMODEL._serialized_end=4411 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_drama_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_drama.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'volcengine/vod/business/vod_drama.proto\x12\x1eVolcengine.Vod.Models.Business\"J\n\x1dVodCreateDramaRecapTaskResult\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\x12\x19\n\x11\x44ramaScriptTaskId\x18\x02 \x01(\t\"0\n\x1eVodCreateDramaScriptTaskResult\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\";\n\x1cVodQueryDramaRecapTaskResult\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\"B\n\x1dVodQueryDramaScriptTaskResult\x12\x11\n\tResultUrl\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\"j\n$VodCreateDramaRecapTaskSpeakerConfig\x12\x11\n\tVoiceType\x18\x01 \x01(\t\x12\r\n\x05\x41ppId\x18\x02 \x01(\t\x12\x14\n\x07\x43luster\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_Cluster\"\x99\x05\n!VodCreateDramaRecapTaskFontconfig\x12\x12\n\nNoSubtitle\x18\x01 \x01(\x08\x12\x15\n\x08\x46ontType\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08\x46ontSize\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\x05Width\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x13\n\x06Height\x18\x05 \x01(\x05H\x03\x88\x01\x01\x12\x12\n\x05\x41lpha\x18\x06 \x01(\x01H\x04\x88\x01\x01\x12\x14\n\x07TextRes\x18\x07 \x01(\tH\x05\x88\x01\x01\x12\x16\n\tFontColor\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x0f\x42\x61\x63kgroundColor\x18\t \x01(\tH\x07\x88\x01\x01\x12!\n\x14\x42\x61\x63kgroundBorderSize\x18\n \x01(\x01H\x08\x88\x01\x01\x12\x18\n\x0b\x42orderColor\x18\x0b \x01(\tH\t\x88\x01\x01\x12\x18\n\x0b\x42orderWidth\x18\x0c \x01(\x05H\n\x88\x01\x01\x12\x18\n\x0bTypesetting\x18\r \x01(\x05H\x0b\x88\x01\x01\x12\x16\n\tAlignType\x18\x0e \x01(\x05H\x0c\x88\x01\x01\x12\x11\n\x04PosX\x18\x0f \x01(\x05H\r\x88\x01\x01\x12\x11\n\x04PosY\x18\x10 \x01(\x05H\x0e\x88\x01\x01\x12\x19\n\x0cLineMaxWidth\x18\x11 \x01(\x01H\x0f\x88\x01\x01\x42\x0b\n\t_FontTypeB\x0b\n\t_FontSizeB\x08\n\x06_WidthB\t\n\x07_HeightB\x08\n\x06_AlphaB\n\n\x08_TextResB\x0c\n\n_FontColorB\x12\n\x10_BackgroundColorB\x17\n\x15_BackgroundBorderSizeB\x0e\n\x0c_BorderColorB\x0e\n\x0c_BorderWidthB\x0e\n\x0c_TypesettingB\x0c\n\n_AlignTypeB\x07\n\x05_PosXB\x07\n\x05_PosYB\x0f\n\r_LineMaxWidth\"\xe6\x02\n\x10\x44ramaRecapConfig\x12\"\n\x15\x41utoGenerateRecapText\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x0fHasHardSubtitle\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1c\n\x0fRecapTextLength\x18\x03 \x01(\x05H\x02\x88\x01\x01\x12\x17\n\nRecapStyle\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0eRecapTextSpeed\x18\x05 \x01(\x01H\x04\x88\x01\x01\x12\x1d\n\x10\x41llowRepeatMatch\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12\x16\n\tPauseTime\x18\x07 \x01(\x05H\x06\x88\x01\x01\x42\x18\n\x16_AutoGenerateRecapTextB\x12\n\x10_HasHardSubtitleB\x12\n\x10_RecapTextLengthB\r\n\x0b_RecapStyleB\x11\n\x0f_RecapTextSpeedB\x13\n\x11_AllowRepeatMatchB\x0c\n\n_PauseTimeB\xcc\x01\n)com.volcengine.service.vod.model.businessB\x08VodDramaP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODCREATEDRAMARECAPTASKRESULT = DESCRIPTOR.message_types_by_name['VodCreateDramaRecapTaskResult'] _VODCREATEDRAMASCRIPTTASKRESULT = DESCRIPTOR.message_types_by_name['VodCreateDramaScriptTaskResult'] _VODQUERYDRAMARECAPTASKRESULT = DESCRIPTOR.message_types_by_name['VodQueryDramaRecapTaskResult'] _VODQUERYDRAMASCRIPTTASKRESULT = DESCRIPTOR.message_types_by_name['VodQueryDramaScriptTaskResult'] _VODCREATEDRAMARECAPTASKSPEAKERCONFIG = DESCRIPTOR.message_types_by_name['VodCreateDramaRecapTaskSpeakerConfig'] _VODCREATEDRAMARECAPTASKFONTCONFIG = DESCRIPTOR.message_types_by_name['VodCreateDramaRecapTaskFontconfig'] _DRAMARECAPCONFIG = DESCRIPTOR.message_types_by_name['DramaRecapConfig'] VodCreateDramaRecapTaskResult = _reflection.GeneratedProtocolMessageType('VodCreateDramaRecapTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMARECAPTASKRESULT, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskResult) }) _sym_db.RegisterMessage(VodCreateDramaRecapTaskResult) VodCreateDramaScriptTaskResult = _reflection.GeneratedProtocolMessageType('VodCreateDramaScriptTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMASCRIPTTASKRESULT, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateDramaScriptTaskResult) }) _sym_db.RegisterMessage(VodCreateDramaScriptTaskResult) VodQueryDramaRecapTaskResult = _reflection.GeneratedProtocolMessageType('VodQueryDramaRecapTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMARECAPTASKRESULT, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryDramaRecapTaskResult) }) _sym_db.RegisterMessage(VodQueryDramaRecapTaskResult) VodQueryDramaScriptTaskResult = _reflection.GeneratedProtocolMessageType('VodQueryDramaScriptTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMASCRIPTTASKRESULT, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryDramaScriptTaskResult) }) _sym_db.RegisterMessage(VodQueryDramaScriptTaskResult) VodCreateDramaRecapTaskSpeakerConfig = _reflection.GeneratedProtocolMessageType('VodCreateDramaRecapTaskSpeakerConfig', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMARECAPTASKSPEAKERCONFIG, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskSpeakerConfig) }) _sym_db.RegisterMessage(VodCreateDramaRecapTaskSpeakerConfig) VodCreateDramaRecapTaskFontconfig = _reflection.GeneratedProtocolMessageType('VodCreateDramaRecapTaskFontconfig', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMARECAPTASKFONTCONFIG, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskFontconfig) }) _sym_db.RegisterMessage(VodCreateDramaRecapTaskFontconfig) DramaRecapConfig = _reflection.GeneratedProtocolMessageType('DramaRecapConfig', (_message.Message,), { 'DESCRIPTOR' : _DRAMARECAPCONFIG, '__module__' : 'volcengine.vod.business.vod_drama_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DramaRecapConfig) }) _sym_db.RegisterMessage(DramaRecapConfig) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\010VodDramaP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODCREATEDRAMARECAPTASKRESULT._serialized_start=75 _VODCREATEDRAMARECAPTASKRESULT._serialized_end=149 _VODCREATEDRAMASCRIPTTASKRESULT._serialized_start=151 _VODCREATEDRAMASCRIPTTASKRESULT._serialized_end=199 _VODQUERYDRAMARECAPTASKRESULT._serialized_start=201 _VODQUERYDRAMARECAPTASKRESULT._serialized_end=260 _VODQUERYDRAMASCRIPTTASKRESULT._serialized_start=262 _VODQUERYDRAMASCRIPTTASKRESULT._serialized_end=328 _VODCREATEDRAMARECAPTASKSPEAKERCONFIG._serialized_start=330 _VODCREATEDRAMARECAPTASKSPEAKERCONFIG._serialized_end=436 _VODCREATEDRAMARECAPTASKFONTCONFIG._serialized_start=439 _VODCREATEDRAMARECAPTASKFONTCONFIG._serialized_end=1104 _DRAMARECAPCONFIG._serialized_start=1107 _DRAMARECAPCONFIG._serialized_end=1465 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_edit_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_edit.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&volcengine/vod/business/vod_edit.proto\x12\x1eVolcengine.Vod.Models.Business\"0\n\x1fSubmitDirectEditTaskAsyncResult\x12\r\n\x05ReqId\x18\x01 \x01(\t\"M\n\x1eSubmitDirectEditTaskSyncResult\x12\x0c\n\x04\x43ode\x18\x01 \x01(\x05\x12\r\n\x05ReqId\x18\x02 \x01(\t\x12\x0e\n\x06Output\x18\x03 \x01(\t\"\'\n\x15GetDirectEditProgress\x12\x0e\n\x06Result\x18\x01 \x01(\x05\"\xa8\x01\n\x13GetDirectEditResult\x12\r\n\x05ReqId\x18\x01 \x01(\t\x12\x11\n\tEditParam\x18\x02 \x01(\x0c\x12\x10\n\x08Priority\x18\x03 \x01(\x05\x12\x13\n\x0b\x43\x61llbackUri\x18\x04 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x05 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\x12\x11\n\tOutputVid\x18\x07 \x01(\t\x12\x0f\n\x07Message\x18\x08 \x01(\t\"\'\n\x14\x43\x61ncelDirectEditTask\x12\x0f\n\x07Message\x18\x01 \x01(\t\"/\n\x18\x41syncVCreativeTaskResult\x12\x13\n\x0bVCreativeId\x18\x01 \x01(\t\"a\n\x16GetVCreativeTaskResult\x12\x10\n\x08Uploader\x18\x01 \x01(\t\x12\x11\n\tParamJson\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\t\x12\x12\n\nOutputJson\x18\x04 \x01(\tB\xc8\x01\n)com.volcengine.service.vod.model.businessB\x07VodEditP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _SUBMITDIRECTEDITTASKASYNCRESULT = DESCRIPTOR.message_types_by_name['SubmitDirectEditTaskAsyncResult'] _SUBMITDIRECTEDITTASKSYNCRESULT = DESCRIPTOR.message_types_by_name['SubmitDirectEditTaskSyncResult'] _GETDIRECTEDITPROGRESS = DESCRIPTOR.message_types_by_name['GetDirectEditProgress'] _GETDIRECTEDITRESULT = DESCRIPTOR.message_types_by_name['GetDirectEditResult'] _CANCELDIRECTEDITTASK = DESCRIPTOR.message_types_by_name['CancelDirectEditTask'] _ASYNCVCREATIVETASKRESULT = DESCRIPTOR.message_types_by_name['AsyncVCreativeTaskResult'] _GETVCREATIVETASKRESULT = DESCRIPTOR.message_types_by_name['GetVCreativeTaskResult'] SubmitDirectEditTaskAsyncResult = _reflection.GeneratedProtocolMessageType('SubmitDirectEditTaskAsyncResult', (_message.Message,), { 'DESCRIPTOR' : _SUBMITDIRECTEDITTASKASYNCRESULT, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SubmitDirectEditTaskAsyncResult) }) _sym_db.RegisterMessage(SubmitDirectEditTaskAsyncResult) SubmitDirectEditTaskSyncResult = _reflection.GeneratedProtocolMessageType('SubmitDirectEditTaskSyncResult', (_message.Message,), { 'DESCRIPTOR' : _SUBMITDIRECTEDITTASKSYNCRESULT, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SubmitDirectEditTaskSyncResult) }) _sym_db.RegisterMessage(SubmitDirectEditTaskSyncResult) GetDirectEditProgress = _reflection.GeneratedProtocolMessageType('GetDirectEditProgress', (_message.Message,), { 'DESCRIPTOR' : _GETDIRECTEDITPROGRESS, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.GetDirectEditProgress) }) _sym_db.RegisterMessage(GetDirectEditProgress) GetDirectEditResult = _reflection.GeneratedProtocolMessageType('GetDirectEditResult', (_message.Message,), { 'DESCRIPTOR' : _GETDIRECTEDITRESULT, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.GetDirectEditResult) }) _sym_db.RegisterMessage(GetDirectEditResult) CancelDirectEditTask = _reflection.GeneratedProtocolMessageType('CancelDirectEditTask', (_message.Message,), { 'DESCRIPTOR' : _CANCELDIRECTEDITTASK, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CancelDirectEditTask) }) _sym_db.RegisterMessage(CancelDirectEditTask) AsyncVCreativeTaskResult = _reflection.GeneratedProtocolMessageType('AsyncVCreativeTaskResult', (_message.Message,), { 'DESCRIPTOR' : _ASYNCVCREATIVETASKRESULT, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AsyncVCreativeTaskResult) }) _sym_db.RegisterMessage(AsyncVCreativeTaskResult) GetVCreativeTaskResult = _reflection.GeneratedProtocolMessageType('GetVCreativeTaskResult', (_message.Message,), { 'DESCRIPTOR' : _GETVCREATIVETASKRESULT, '__module__' : 'volcengine.vod.business.vod_edit_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.GetVCreativeTaskResult) }) _sym_db.RegisterMessage(GetVCreativeTaskResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\007VodEditP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _SUBMITDIRECTEDITTASKASYNCRESULT._serialized_start=74 _SUBMITDIRECTEDITTASKASYNCRESULT._serialized_end=122 _SUBMITDIRECTEDITTASKSYNCRESULT._serialized_start=124 _SUBMITDIRECTEDITTASKSYNCRESULT._serialized_end=201 _GETDIRECTEDITPROGRESS._serialized_start=203 _GETDIRECTEDITPROGRESS._serialized_end=242 _GETDIRECTEDITRESULT._serialized_start=245 _GETDIRECTEDITRESULT._serialized_end=413 _CANCELDIRECTEDITTASK._serialized_start=415 _CANCELDIRECTEDITTASK._serialized_end=454 _ASYNCVCREATIVETASKRESULT._serialized_start=456 _ASYNCVCREATIVETASKRESULT._serialized_end=503 _GETVCREATIVETASKRESULT._serialized_start=505 _GETVCREATIVETASKRESULT._serialized_end=602 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_measure_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_measure.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)volcengine/vod/business/vod_measure.proto\x12\x1eVolcengine.Vod.Models.Business\"<\n\x1d\x44\x65scribeVodSpaceTranscodeItem\x12\x0c\n\x04Name\x18\x01 \x01(\t\x12\r\n\x05Value\x18\x02 \x01(\x03\"\x8f\x01\n%DescribeVodSpaceTranscodeDetailTVUnit\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12X\n\x11TranscodeItemList\x18\x02 \x03(\x0b\x32=.Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeItem\"\xb5\x01\n\x1f\x44\x65scribeVodSpaceTranscodeDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tTaskStage\x18\x02 \x01(\t\x12\r\n\x05Total\x18\x03 \x01(\x03\x12\x61\n\x12TranscodeUsageList\x18\x04 \x03(\x0b\x32\x45.Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDetailTVUnit\"\xc0\x03\n#DescribeVodSpaceTranscodeDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x15\n\rTranscodeType\x18\x04 \x01(\t\x12\x15\n\rSpecification\x18\x05 \x01(\t\x12\x15\n\rTaskStageList\x18\x06 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x07 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x08 \x03(\t\x12\x12\n\nRegionList\x18\t \x03(\t\x12\x1a\n\x12TotalTranscodeData\x18\n \x01(\x03\x12]\n\x16TotalTranscodeDataList\x18\x0b \x03(\x0b\x32=.Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeItem\x12`\n\x17TranscodeDataDetailList\x18\x0c \x03(\x0b\x32?.Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDetail\"B\n DescribeVodSpaceAIStatisDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\"\xa1\x01\n\"DescribeVodSpaceAIStatisDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tTaskStage\x18\x02 \x01(\t\x12Y\n\x0f\x41iUsageDataList\x18\x03 \x03(\x0b\x32@.Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataItem\"\xa1\x03\n\"DescribeVodSpaceAIStatisDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0bMediaAiType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x03(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x18\n\x10TotalAiUsageData\x18\t \x01(\x03\x12Y\n\x0f\x41iUsageDataList\x18\n \x03(\x0b\x32@.Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataItem\x12\x61\n\x15\x41iUsageDataDetailList\x18\x0b \x03(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataDetail\"E\n&DescribeVodSpaceSubtitleStatisDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\r\n\x05Usage\x18\x02 \x01(\x03\"\xb3\x01\n(DescribeVodSpaceSubtitleStatisDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tTaskStage\x18\x02 \x01(\t\x12\x65\n\x15SubtitleUsageDataList\x18\x03 \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataItem\"\xc6\x03\n(DescribeVodSpaceSubtitleStatisDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cSubtitleType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x03(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x1e\n\x16TotalSubtitleUsageData\x18\t \x01(\x03\x12\x65\n\x15SubtitleUsageDataList\x18\n \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataItem\x12m\n\x1bSubtitleUsageDataDetailList\x18\x0b \x03(\x0b\x32H.Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataDetail\"C\n$DescribeVodSpaceDetectStatisDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\r\n\x05Usage\x18\x02 \x01(\x03\"\xad\x01\n&DescribeVodSpaceDetectStatisDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tTaskStage\x18\x02 \x01(\t\x12\x61\n\x13\x44\x65tectUsageDataList\x18\x03 \x03(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataItem\"\xb8\x03\n&DescribeVodSpaceDetectStatisDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x12\n\nDetectType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x03(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x1c\n\x14TotalDetectUsageData\x18\t \x01(\x03\x12\x61\n\x13\x44\x65tectUsageDataList\x18\n \x03(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataItem\x12i\n\x19\x44\x65tectUsageDataDetailList\x18\x0b \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataDetail\":\n\x1b\x44\x65scribeVodSnapshotDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\r\n\x05\x43ount\x18\x02 \x01(\x03\"\xa7\x01\n\x1d\x44\x65scribeVodSnapshotDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tTaskStage\x18\x02 \x01(\t\x12\r\n\x05Total\x18\x03 \x01(\t\x12U\n\x10SnapshotDataList\x18\x04 \x03(\x0b\x32;.Volcengine.Vod.Models.Business.DescribeVodSnapshotDataItem\"\x96\x03\n\x1d\x44\x65scribeVodSnapshotDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cSnapshotType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x03(\t\x12\x12\n\nRegionList\x18\x08 \x03(\t\x12\x19\n\x11TotalSnapshotData\x18\t \x01(\x03\x12U\n\x10SnapshotDataList\x18\n \x03(\x0b\x32;.Volcengine.Vod.Models.Business.DescribeVodSnapshotDataItem\x12]\n\x16SnapshotDetailDataList\x18\x0b \x03(\x0b\x32=.Volcengine.Vod.Models.Business.DescribeVodSnapshotDataDetail\"\xd8\x01\n%DescribeVodSpaceWorkflowTranscodeInfo\x12\x14\n\x0cTemplateType\x18\x01 \x01(\t\x12\x10\n\x08\x46ileType\x18\x02 \x01(\t\x12\x10\n\x08\x44uration\x18\x03 \x01(\x03\x12\r\n\x05\x43odec\x18\x04 \x01(\t\x12\r\n\x05Remux\x18\x05 \x01(\x08\x12\x12\n\nDefinition\x18\x06 \x01(\t\x12\r\n\x05Width\x18\x07 \x01(\x03\x12\x0e\n\x06Height\x18\x08 \x01(\x03\x12\r\n\x05Slice\x18\t \x01(\x08\x12\x15\n\rIsLowPriority\x18\n \x01(\x08\"c\n$DescribeVodSpaceWorkflowSnapshotInfo\x12\x14\n\x0cTemplateType\x18\x01 \x01(\t\x12\x0e\n\x06Number\x18\x02 \x01(\x03\x12\x15\n\rIsLowPriority\x18\x03 \x01(\x08\"h\n\'DescribeVodSpaceWorkflowEnhanceExecInfo\x12\x14\n\x0cTemplateType\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\x12\x15\n\rIsLowPriority\x18\x03 \x01(\x08\"t\n#DescribeVodSpaceWorkflowVideoAIInfo\x12\x14\n\x0cTemplateType\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\x12\x0e\n\x06Number\x18\x03 \x01(\x03\x12\x15\n\rIsLowPriority\x18\x04 \x01(\x08\"\x8d\x04\n\x1e\x44\x65scribeVodSpaceWorkflowDetail\x12\r\n\x05RunId\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x12\n\nTemplateId\x18\x03 \x01(\t\x12\x11\n\tSpaceName\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x05 \x01(\t\x12\x11\n\tStartTime\x18\x06 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x07 \x01(\t\x12\\\n\rTranscodeInfo\x18\x08 \x01(\x0b\x32\x45.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowTranscodeInfo\x12Z\n\x0cSnapshotInfo\x18\t \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowSnapshotInfo\x12`\n\x0f\x45nhanceExecInfo\x18\n \x01(\x0b\x32G.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowEnhanceExecInfo\x12X\n\x0bVideoAIInfo\x18\x0b \x01(\x0b\x32\x43.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowVideoAIInfo\"\xfb\x01\n(DescribeVodSpaceWorkflowDetailDataResult\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\x12\r\n\x05Total\x18\x07 \x01(\x03\x12Z\n\x12WorkflowDetailData\x18\x08 \x03(\x0b\x32>.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowDetail\"\x81\x01\n\x1a\x44\x65scribeVodSpaceEditDetail\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\x11\n\tOutputVid\x18\x02 \x01(\t\x12\r\n\x05Space\x18\x03 \x01(\t\x12\r\n\x05\x43odec\x18\x04 \x01(\t\x12\x12\n\nDefinition\x18\x05 \x01(\t\x12\x10\n\x08\x44uration\x18\x06 \x01(\x03\"\xef\x01\n$DescribeVodSpaceEditDetailDataResult\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\x12\r\n\x05Total\x18\x07 \x01(\x03\x12R\n\x0e\x45\x64itDetailData\x18\x08 \x03(\x0b\x32:.Volcengine.Vod.Models.Business.DescribeVodSpaceEditDetail\"W\n\"DescribeVodPlayFileLogByDomainItem\x12\x0c\n\x04\x44\x61te\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x13\n\x0b\x44ownloadUrl\x18\x03 \x01(\t\"\xb4\x01\n$DescribeVodPlayFileLogByDomainResult\x12\x11\n\tStartTime\x18\x01 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\t\x12\x12\n\nDomainList\x18\x03 \x03(\t\x12T\n\x08\x46ileList\x18\x04 \x03(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodPlayFileLogByDomainItem\"\x82\x01\n\x1f\x44\x65scribeVodEnhanceImageDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\n\n\x02SR\x18\x02 \x01(\x03\x12\x0b\n\x03VFI\x18\x03 \x01(\x03\x12\x12\n\nSDREnhance\x18\x04 \x01(\x03\x12\x0f\n\x07SDR2HDR\x18\x05 \x01(\x03\x12\x13\n\x0b\x41udioDenose\x18\x06 \x01(\x03\"\xa9\x02\n!DescribeVodEnhanceImageDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cTaskTypeList\x18\x04 \x03(\t\x12\x15\n\rTaskStageList\x18\x05 \x03(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x12\n\nRegionList\x18\x07 \x03(\t\x12\x1c\n\x14TotalEnhanceImagData\x18\x08 \x01(\x03\x12Y\n\x10\x45nhanceImageList\x18\t \x03(\x0b\x32?.Volcengine.Vod.Models.Business.DescribeVodEnhanceImageDataItem\"D\n\"DescribeVodSpaceEditStatisDataItem\x12\x0c\n\x04Name\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x03\"\x95\x01\n&DescribeVodSpaceEditStatisDetailTVUnit\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12]\n\x11\x45\x64itUsageItemList\x18\x02 \x03(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataItem\"\x98\x01\n$DescribeVodSpaceEditStatisDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x61\n\x11\x45\x64itUsageDataList\x18\x03 \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDetailTVUnit\"\x9d\x03\n$DescribeVodSpaceEditStatisDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x15\n\rSpecification\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x06 \x03(\t\x12\x12\n\nRegionList\x18\x07 \x03(\t\x12\x1a\n\x12TotalEditUsageData\x18\x08 \x01(\x03\x12\x62\n\x16TotalEditUsageDataList\x18\t \x03(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataItem\x12\x65\n\x17\x45\x64itUsageDataDetailList\x18\n \x03(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataDetail\"\x94\x01\n\x1f\x44\x65scribeVodPlayedStatisDataItem\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x0c\n\x04Size\x18\x03 \x01(\x03\x12\x10\n\x08\x44uration\x18\x04 \x01(\x01\x12\x12\n\nCreateTime\x18\x05 \x01(\t\x12\x11\n\tPlayCount\x18\x06 \x01(\x03\x12\x0f\n\x07Traffic\x18\x07 \x01(\x03\"\xd2\x01\n!DescribeVodPlayedStatisDataResult\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x0f\n\x07VidList\x18\x04 \x03(\t\x12\x11\n\tOrderType\x18\x05 \x01(\t\x12V\n\rPlayStatInfos\x18\x06 \x03(\x0b\x32?.Volcengine.Vod.Models.Business.DescribeVodPlayedStatisDataItem\"\x98\x01\n#DescribeVodMostPlayedStatisDataItem\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x0c\n\x04Size\x18\x03 \x01(\x03\x12\x10\n\x08\x44uration\x18\x04 \x01(\x01\x12\x12\n\nCreateTime\x18\x05 \x01(\t\x12\x11\n\tPlayCount\x18\x06 \x01(\x03\x12\x0f\n\x07Traffic\x18\x07 \x01(\x03\"\xd7\x01\n%DescribeVodMostPlayedStatisDataResult\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x11\n\tOrderType\x18\x04 \x01(\t\x12\x0c\n\x04TopN\x18\x05 \x01(\x03\x12Z\n\rPlayStatInfos\x18\x06 \x03(\x0b\x32\x43.Volcengine.Vod.Models.Business.DescribeVodMostPlayedStatisDataItem\"?\n DescribeVodRealtimeMediaDataItem\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\r\n\x05\x43ount\x18\x02 \x01(\x03\"\xa3\x01\n\"DescribeVodRealtimeMediaDataDetail\x12\r\n\x05Space\x18\x01 \x01(\t\x12\r\n\x05Total\x18\x02 \x01(\x03\x12_\n\x15RealtimeMediaDataList\x18\x03 \x03(\x0b\x32@.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataItem\"\x88\x03\n\"DescribeVodRealtimeMediaDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0bProcessType\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x06 \x03(\t\x12\x1e\n\x16TotalRealtimeMediaData\x18\x07 \x01(\x03\x12_\n\x15RealtimeMediaDataList\x18\x08 \x03(\x0b\x32@.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataItem\x12g\n\x1bRealtimeMediaDetailDataList\x18\t \x03(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataDetail\"\x96\x01\n&DescribeVodRealtimeMediaDetailDataItem\x12\x0f\n\x07TraceId\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x10\n\x08\x46ileName\x18\x04 \x01(\t\x12\x0f\n\x07\x43ommand\x18\x05 \x01(\t\x12\x14\n\x0cResponseCode\x18\x06 \x01(\t\"\x88\x02\n(DescribeVodRealtimeMediaDetailDataResult\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\x12\r\n\x05Total\x18\x07 \x01(\x03\x12g\n\x17RealtimeMediaDetailData\x18\x08 \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDetailDataItem\"T\n DescribeVodVidTrafficFileLogItem\x12\x0c\n\x04\x44\x61te\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x13\n\x0b\x44ownloadUrl\x18\x03 \x01(\t\"\xaf\x01\n\"DescribeVodVidTrafficFileLogResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12R\n\x08\x46ileList\x18\x04 \x03(\x0b\x32@.Volcengine.Vod.Models.Business.DescribeVodVidTrafficFileLogItemB\xcb\x01\n)com.volcengine.service.vod.model.businessB\nVodMeasureP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _DESCRIBEVODSPACETRANSCODEITEM = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeItem'] _DESCRIBEVODSPACETRANSCODEDETAILTVUNIT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeDetailTVUnit'] _DESCRIBEVODSPACETRANSCODEDETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeDetail'] _DESCRIBEVODSPACETRANSCODEDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeDataResult'] _DESCRIBEVODSPACEAISTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodSpaceAIStatisDataItem'] _DESCRIBEVODSPACEAISTATISDATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceAIStatisDataDetail'] _DESCRIBEVODSPACEAISTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceAIStatisDataResult'] _DESCRIBEVODSPACESUBTITLESTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodSpaceSubtitleStatisDataItem'] _DESCRIBEVODSPACESUBTITLESTATISDATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceSubtitleStatisDataDetail'] _DESCRIBEVODSPACESUBTITLESTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceSubtitleStatisDataResult'] _DESCRIBEVODSPACEDETECTSTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodSpaceDetectStatisDataItem'] _DESCRIBEVODSPACEDETECTSTATISDATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceDetectStatisDataDetail'] _DESCRIBEVODSPACEDETECTSTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceDetectStatisDataResult'] _DESCRIBEVODSNAPSHOTDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodSnapshotDataItem'] _DESCRIBEVODSNAPSHOTDATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSnapshotDataDetail'] _DESCRIBEVODSNAPSHOTDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSnapshotDataResult'] _DESCRIBEVODSPACEWORKFLOWTRANSCODEINFO = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowTranscodeInfo'] _DESCRIBEVODSPACEWORKFLOWSNAPSHOTINFO = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowSnapshotInfo'] _DESCRIBEVODSPACEWORKFLOWENHANCEEXECINFO = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowEnhanceExecInfo'] _DESCRIBEVODSPACEWORKFLOWVIDEOAIINFO = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowVideoAIInfo'] _DESCRIBEVODSPACEWORKFLOWDETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowDetail'] _DESCRIBEVODSPACEWORKFLOWDETAILDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowDetailDataResult'] _DESCRIBEVODSPACEEDITDETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditDetail'] _DESCRIBEVODSPACEEDITDETAILDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditDetailDataResult'] _DESCRIBEVODPLAYFILELOGBYDOMAINITEM = DESCRIPTOR.message_types_by_name['DescribeVodPlayFileLogByDomainItem'] _DESCRIBEVODPLAYFILELOGBYDOMAINRESULT = DESCRIPTOR.message_types_by_name['DescribeVodPlayFileLogByDomainResult'] _DESCRIBEVODENHANCEIMAGEDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodEnhanceImageDataItem'] _DESCRIBEVODENHANCEIMAGEDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodEnhanceImageDataResult'] _DESCRIBEVODSPACEEDITSTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDataItem'] _DESCRIBEVODSPACEEDITSTATISDETAILTVUNIT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDetailTVUnit'] _DESCRIBEVODSPACEEDITSTATISDATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDataDetail'] _DESCRIBEVODSPACEEDITSTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDataResult'] _DESCRIBEVODPLAYEDSTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodPlayedStatisDataItem'] _DESCRIBEVODPLAYEDSTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodPlayedStatisDataResult'] _DESCRIBEVODMOSTPLAYEDSTATISDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodMostPlayedStatisDataItem'] _DESCRIBEVODMOSTPLAYEDSTATISDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodMostPlayedStatisDataResult'] _DESCRIBEVODREALTIMEMEDIADATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDataItem'] _DESCRIBEVODREALTIMEMEDIADATADETAIL = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDataDetail'] _DESCRIBEVODREALTIMEMEDIADATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDataResult'] _DESCRIBEVODREALTIMEMEDIADETAILDATAITEM = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDetailDataItem'] _DESCRIBEVODREALTIMEMEDIADETAILDATARESULT = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDetailDataResult'] _DESCRIBEVODVIDTRAFFICFILELOGITEM = DESCRIPTOR.message_types_by_name['DescribeVodVidTrafficFileLogItem'] _DESCRIBEVODVIDTRAFFICFILELOGRESULT = DESCRIPTOR.message_types_by_name['DescribeVodVidTrafficFileLogResult'] DescribeVodSpaceTranscodeItem = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeItem) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeItem) DescribeVodSpaceTranscodeDetailTVUnit = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeDetailTVUnit', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEDETAILTVUNIT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDetailTVUnit) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeDetailTVUnit) DescribeVodSpaceTranscodeDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEDETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeDetail) DescribeVodSpaceTranscodeDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeDataResult) DescribeVodSpaceAIStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceAIStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEAISTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodSpaceAIStatisDataItem) DescribeVodSpaceAIStatisDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceAIStatisDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEAISTATISDATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceAIStatisDataDetail) DescribeVodSpaceAIStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceAIStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEAISTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceAIStatisDataResult) DescribeVodSpaceSubtitleStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceSubtitleStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACESUBTITLESTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodSpaceSubtitleStatisDataItem) DescribeVodSpaceSubtitleStatisDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceSubtitleStatisDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACESUBTITLESTATISDATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceSubtitleStatisDataDetail) DescribeVodSpaceSubtitleStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceSubtitleStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACESUBTITLESTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceSubtitleStatisDataResult) DescribeVodSpaceDetectStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceDetectStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEDETECTSTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodSpaceDetectStatisDataItem) DescribeVodSpaceDetectStatisDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceDetectStatisDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEDETECTSTATISDATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceDetectStatisDataDetail) DescribeVodSpaceDetectStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceDetectStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEDETECTSTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceDetectStatisDataResult) DescribeVodSnapshotDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodSnapshotDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSNAPSHOTDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSnapshotDataItem) }) _sym_db.RegisterMessage(DescribeVodSnapshotDataItem) DescribeVodSnapshotDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSnapshotDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSNAPSHOTDATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSnapshotDataDetail) }) _sym_db.RegisterMessage(DescribeVodSnapshotDataDetail) DescribeVodSnapshotDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSnapshotDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSNAPSHOTDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSnapshotDataResult) }) _sym_db.RegisterMessage(DescribeVodSnapshotDataResult) DescribeVodSpaceWorkflowTranscodeInfo = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowTranscodeInfo', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWTRANSCODEINFO, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowTranscodeInfo) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowTranscodeInfo) DescribeVodSpaceWorkflowSnapshotInfo = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowSnapshotInfo', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWSNAPSHOTINFO, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowSnapshotInfo) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowSnapshotInfo) DescribeVodSpaceWorkflowEnhanceExecInfo = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowEnhanceExecInfo', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWENHANCEEXECINFO, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowEnhanceExecInfo) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowEnhanceExecInfo) DescribeVodSpaceWorkflowVideoAIInfo = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowVideoAIInfo', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWVIDEOAIINFO, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowVideoAIInfo) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowVideoAIInfo) DescribeVodSpaceWorkflowDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWDETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowDetail) DescribeVodSpaceWorkflowDetailDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowDetailDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWDETAILDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowDetailDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowDetailDataResult) DescribeVodSpaceEditDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITDETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceEditDetail) DescribeVodSpaceEditDetailDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditDetailDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITDETAILDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditDetailDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceEditDetailDataResult) DescribeVodPlayFileLogByDomainItem = _reflection.GeneratedProtocolMessageType('DescribeVodPlayFileLogByDomainItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYFILELOGBYDOMAINITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodPlayFileLogByDomainItem) }) _sym_db.RegisterMessage(DescribeVodPlayFileLogByDomainItem) DescribeVodPlayFileLogByDomainResult = _reflection.GeneratedProtocolMessageType('DescribeVodPlayFileLogByDomainResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYFILELOGBYDOMAINRESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodPlayFileLogByDomainResult) }) _sym_db.RegisterMessage(DescribeVodPlayFileLogByDomainResult) DescribeVodEnhanceImageDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodEnhanceImageDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODENHANCEIMAGEDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodEnhanceImageDataItem) }) _sym_db.RegisterMessage(DescribeVodEnhanceImageDataItem) DescribeVodEnhanceImageDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodEnhanceImageDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODENHANCEIMAGEDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodEnhanceImageDataResult) }) _sym_db.RegisterMessage(DescribeVodEnhanceImageDataResult) DescribeVodSpaceEditStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDataItem) DescribeVodSpaceEditStatisDetailTVUnit = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDetailTVUnit', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDETAILTVUNIT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDetailTVUnit) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDetailTVUnit) DescribeVodSpaceEditStatisDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataDetail) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDataDetail) DescribeVodSpaceEditStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDataResult) DescribeVodPlayedStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodPlayedStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYEDSTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodPlayedStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodPlayedStatisDataItem) DescribeVodPlayedStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodPlayedStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYEDSTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodPlayedStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodPlayedStatisDataResult) DescribeVodMostPlayedStatisDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodMostPlayedStatisDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODMOSTPLAYEDSTATISDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodMostPlayedStatisDataItem) }) _sym_db.RegisterMessage(DescribeVodMostPlayedStatisDataItem) DescribeVodMostPlayedStatisDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodMostPlayedStatisDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODMOSTPLAYEDSTATISDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodMostPlayedStatisDataResult) }) _sym_db.RegisterMessage(DescribeVodMostPlayedStatisDataResult) DescribeVodRealtimeMediaDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataItem) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDataItem) DescribeVodRealtimeMediaDataDetail = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDataDetail', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADATADETAIL, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataDetail) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDataDetail) DescribeVodRealtimeMediaDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataResult) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDataResult) DescribeVodRealtimeMediaDetailDataItem = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDetailDataItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADETAILDATAITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDetailDataItem) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDetailDataItem) DescribeVodRealtimeMediaDetailDataResult = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDetailDataResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADETAILDATARESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDetailDataResult) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDetailDataResult) DescribeVodVidTrafficFileLogItem = _reflection.GeneratedProtocolMessageType('DescribeVodVidTrafficFileLogItem', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODVIDTRAFFICFILELOGITEM, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodVidTrafficFileLogItem) }) _sym_db.RegisterMessage(DescribeVodVidTrafficFileLogItem) DescribeVodVidTrafficFileLogResult = _reflection.GeneratedProtocolMessageType('DescribeVodVidTrafficFileLogResult', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODVIDTRAFFICFILELOGRESULT, '__module__' : 'volcengine.vod.business.vod_measure_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DescribeVodVidTrafficFileLogResult) }) _sym_db.RegisterMessage(DescribeVodVidTrafficFileLogResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\nVodMeasureP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _DESCRIBEVODSPACETRANSCODEITEM._serialized_start=77 _DESCRIBEVODSPACETRANSCODEITEM._serialized_end=137 _DESCRIBEVODSPACETRANSCODEDETAILTVUNIT._serialized_start=140 _DESCRIBEVODSPACETRANSCODEDETAILTVUNIT._serialized_end=283 _DESCRIBEVODSPACETRANSCODEDETAIL._serialized_start=286 _DESCRIBEVODSPACETRANSCODEDETAIL._serialized_end=467 _DESCRIBEVODSPACETRANSCODEDATARESULT._serialized_start=470 _DESCRIBEVODSPACETRANSCODEDATARESULT._serialized_end=918 _DESCRIBEVODSPACEAISTATISDATAITEM._serialized_start=920 _DESCRIBEVODSPACEAISTATISDATAITEM._serialized_end=986 _DESCRIBEVODSPACEAISTATISDATADETAIL._serialized_start=989 _DESCRIBEVODSPACEAISTATISDATADETAIL._serialized_end=1150 _DESCRIBEVODSPACEAISTATISDATARESULT._serialized_start=1153 _DESCRIBEVODSPACEAISTATISDATARESULT._serialized_end=1570 _DESCRIBEVODSPACESUBTITLESTATISDATAITEM._serialized_start=1572 _DESCRIBEVODSPACESUBTITLESTATISDATAITEM._serialized_end=1641 _DESCRIBEVODSPACESUBTITLESTATISDATADETAIL._serialized_start=1644 _DESCRIBEVODSPACESUBTITLESTATISDATADETAIL._serialized_end=1823 _DESCRIBEVODSPACESUBTITLESTATISDATARESULT._serialized_start=1826 _DESCRIBEVODSPACESUBTITLESTATISDATARESULT._serialized_end=2280 _DESCRIBEVODSPACEDETECTSTATISDATAITEM._serialized_start=2282 _DESCRIBEVODSPACEDETECTSTATISDATAITEM._serialized_end=2349 _DESCRIBEVODSPACEDETECTSTATISDATADETAIL._serialized_start=2352 _DESCRIBEVODSPACEDETECTSTATISDATADETAIL._serialized_end=2525 _DESCRIBEVODSPACEDETECTSTATISDATARESULT._serialized_start=2528 _DESCRIBEVODSPACEDETECTSTATISDATARESULT._serialized_end=2968 _DESCRIBEVODSNAPSHOTDATAITEM._serialized_start=2970 _DESCRIBEVODSNAPSHOTDATAITEM._serialized_end=3028 _DESCRIBEVODSNAPSHOTDATADETAIL._serialized_start=3031 _DESCRIBEVODSNAPSHOTDATADETAIL._serialized_end=3198 _DESCRIBEVODSNAPSHOTDATARESULT._serialized_start=3201 _DESCRIBEVODSNAPSHOTDATARESULT._serialized_end=3607 _DESCRIBEVODSPACEWORKFLOWTRANSCODEINFO._serialized_start=3610 _DESCRIBEVODSPACEWORKFLOWTRANSCODEINFO._serialized_end=3826 _DESCRIBEVODSPACEWORKFLOWSNAPSHOTINFO._serialized_start=3828 _DESCRIBEVODSPACEWORKFLOWSNAPSHOTINFO._serialized_end=3927 _DESCRIBEVODSPACEWORKFLOWENHANCEEXECINFO._serialized_start=3929 _DESCRIBEVODSPACEWORKFLOWENHANCEEXECINFO._serialized_end=4033 _DESCRIBEVODSPACEWORKFLOWVIDEOAIINFO._serialized_start=4035 _DESCRIBEVODSPACEWORKFLOWVIDEOAIINFO._serialized_end=4151 _DESCRIBEVODSPACEWORKFLOWDETAIL._serialized_start=4154 _DESCRIBEVODSPACEWORKFLOWDETAIL._serialized_end=4679 _DESCRIBEVODSPACEWORKFLOWDETAILDATARESULT._serialized_start=4682 _DESCRIBEVODSPACEWORKFLOWDETAILDATARESULT._serialized_end=4933 _DESCRIBEVODSPACEEDITDETAIL._serialized_start=4936 _DESCRIBEVODSPACEEDITDETAIL._serialized_end=5065 _DESCRIBEVODSPACEEDITDETAILDATARESULT._serialized_start=5068 _DESCRIBEVODSPACEEDITDETAILDATARESULT._serialized_end=5307 _DESCRIBEVODPLAYFILELOGBYDOMAINITEM._serialized_start=5309 _DESCRIBEVODPLAYFILELOGBYDOMAINITEM._serialized_end=5396 _DESCRIBEVODPLAYFILELOGBYDOMAINRESULT._serialized_start=5399 _DESCRIBEVODPLAYFILELOGBYDOMAINRESULT._serialized_end=5579 _DESCRIBEVODENHANCEIMAGEDATAITEM._serialized_start=5582 _DESCRIBEVODENHANCEIMAGEDATAITEM._serialized_end=5712 _DESCRIBEVODENHANCEIMAGEDATARESULT._serialized_start=5715 _DESCRIBEVODENHANCEIMAGEDATARESULT._serialized_end=6012 _DESCRIBEVODSPACEEDITSTATISDATAITEM._serialized_start=6014 _DESCRIBEVODSPACEEDITSTATISDATAITEM._serialized_end=6082 _DESCRIBEVODSPACEEDITSTATISDETAILTVUNIT._serialized_start=6085 _DESCRIBEVODSPACEEDITSTATISDETAILTVUNIT._serialized_end=6234 _DESCRIBEVODSPACEEDITSTATISDATADETAIL._serialized_start=6237 _DESCRIBEVODSPACEEDITSTATISDATADETAIL._serialized_end=6389 _DESCRIBEVODSPACEEDITSTATISDATARESULT._serialized_start=6392 _DESCRIBEVODSPACEEDITSTATISDATARESULT._serialized_end=6805 _DESCRIBEVODPLAYEDSTATISDATAITEM._serialized_start=6808 _DESCRIBEVODPLAYEDSTATISDATAITEM._serialized_end=6956 _DESCRIBEVODPLAYEDSTATISDATARESULT._serialized_start=6959 _DESCRIBEVODPLAYEDSTATISDATARESULT._serialized_end=7169 _DESCRIBEVODMOSTPLAYEDSTATISDATAITEM._serialized_start=7172 _DESCRIBEVODMOSTPLAYEDSTATISDATAITEM._serialized_end=7324 _DESCRIBEVODMOSTPLAYEDSTATISDATARESULT._serialized_start=7327 _DESCRIBEVODMOSTPLAYEDSTATISDATARESULT._serialized_end=7542 _DESCRIBEVODREALTIMEMEDIADATAITEM._serialized_start=7544 _DESCRIBEVODREALTIMEMEDIADATAITEM._serialized_end=7607 _DESCRIBEVODREALTIMEMEDIADATADETAIL._serialized_start=7610 _DESCRIBEVODREALTIMEMEDIADATADETAIL._serialized_end=7773 _DESCRIBEVODREALTIMEMEDIADATARESULT._serialized_start=7776 _DESCRIBEVODREALTIMEMEDIADATARESULT._serialized_end=8168 _DESCRIBEVODREALTIMEMEDIADETAILDATAITEM._serialized_start=8171 _DESCRIBEVODREALTIMEMEDIADETAILDATAITEM._serialized_end=8321 _DESCRIBEVODREALTIMEMEDIADETAILDATARESULT._serialized_start=8324 _DESCRIBEVODREALTIMEMEDIADETAILDATARESULT._serialized_end=8588 _DESCRIBEVODVIDTRAFFICFILELOGITEM._serialized_start=8590 _DESCRIBEVODVIDTRAFFICFILELOGITEM._serialized_end=8674 _DESCRIBEVODVIDTRAFFICFILELOGRESULT._serialized_start=8677 _DESCRIBEVODVIDTRAFFICFILELOGRESULT._serialized_end=8852 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_media_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_media.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'volcengine/vod/business/vod_media.proto\x12\x1eVolcengine.Vod.Models.Business\x1a(volcengine/vod/business/vod_common.proto\"r\n%VodListFileMetaInfosByFileNamesResult\x12I\n\x10VodFileMetaInfos\x18\x01 \x03(\x0b\x32/.Volcengine.Vod.Models.Business.VodFileMetaInfo\"\x7f\n\x0fVodFileMetaInfo\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06\x46ileId\x18\x02 \x01(\t\x12\x12\n\nMaterialId\x18\x03 \x01(\t\x12\x10\n\x08\x46ileType\x18\x05 \x01(\t\x12\x10\n\x08\x46ileName\x18\x06 \x01(\t\x12\x17\n\x0f\x46ileNameEncoded\x18\x07 \x01(\t\"\xca\x02\n\x11VodMediaBasicInfo\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\r\n\x05Title\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\x12\x11\n\tPosterUri\x18\x05 \x01(\t\x12\x15\n\rPublishStatus\x18\x06 \x01(\t\x12\x0c\n\x04Tags\x18\x07 \x03(\t\x12\x12\n\nCreateTime\x18\x08 \x01(\t\x12I\n\x0e\x43lassification\x18\t \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodClassification\x12\x17\n\x0fTosStorageClass\x18\n \x01(\t\x12\x17\n\x0fVodUploadSource\x18\x0b \x01(\t\x12\x14\n\x0cHlsMediaSize\x18\x0c \x01(\x01\x12\x12\n\nExpireTime\x18\r \x01(\t\"\xe1\x01\n\x0cVodMediaInfo\x12\x44\n\tBasicInfo\x18\x01 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodMediaBasicInfo\x12\x41\n\nSourceInfo\x18\x02 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12H\n\x0eTranscodeInfos\x18\x03 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodTranscodeInfo\"q\n\x14VodGetMediaInfosData\x12\x43\n\rMediaInfoList\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodMediaInfo\x12\x14\n\x0cNotExistVids\x18\x02 \x03(\t\"2\n\x10VodStoreUriGroup\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x11\n\tStoreUris\x18\x02 \x03(\t\"u\n\x13VodGetRecPosterData\x12H\n\x0eStoreUriGroups\x18\x01 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodStoreUriGroup\x12\x14\n\x0cNotExistVids\x18\x02 \x03(\t\"*\n\x12VodDeleteMediaData\x12\x14\n\x0cNotExistVids\x18\x01 \x03(\t\"2\n\x17VodDeleteTranscodesData\x12\x17\n\x0fNotExistFileIds\x18\x01 \x03(\t\"4\n\x19VodDeleteMediaTosFileData\x12\x17\n\x0f\x46\x61iledFileNames\x18\x01 \x03(\t\"\xa3\x01\n\x13VodGetMediaListData\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x43\n\rMediaInfoList\x18\x02 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodMediaInfo\x12\x12\n\nTotalCount\x18\x03 \x01(\x05\x12\x0e\n\x06Offset\x18\x04 \x01(\x05\x12\x10\n\x08PageSize\x18\x05 \x01(\x05\"6\n\x1bVodUpdateSubtitleStatusData\x12\x17\n\x0fNotExistFileIds\x18\x01 \x03(\t\"p\n\x13VodFileSubtitleInfo\x12\x0e\n\x06\x46ileId\x18\x01 \x01(\t\x12I\n\x10SubtitleInfoList\x18\x02 \x03(\x0b\x32/.Volcengine.Vod.Models.Business.VodSubtitleInfo\"\xcb\x01\n\x1aVodGetSubtitleInfoListData\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12Q\n\x14\x46ileSubtitleInfoList\x18\x02 \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodFileSubtitleInfo\x12\x17\n\x0fNotExistFileIds\x18\x03 \x03(\t\x12\x12\n\nTotalCount\x18\x04 \x01(\x05\x12\x0e\n\x06Offset\x18\x05 \x01(\x05\x12\x10\n\x08PageSize\x18\x06 \x01(\x05\"q\n\x14VodFrameDataForAudit\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x13\n\x0b\x46rameNumber\x18\x02 \x01(\x05\x12\x13\n\x0b\x43utTimeMill\x18\x03 \x01(\x01\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\"b\n\x1aVodGetFramesForAuditResult\x12\x44\n\x06\x46rames\x18\x01 \x03(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodFrameDataForAudit\"\x9f\x01\n\x1aVodBetterFrameDataForAudit\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x13\n\x0b\x46rameNumber\x18\x02 \x01(\x05\x12\x13\n\x0b\x43utTimeMill\x18\x03 \x01(\x01\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\x11\n\tCoverRate\x18\x06 \x01(\x01\x12\x13\n\x0bLBPHashCode\x18\x07 \x03(\x01\"n\n VodGetBetterFramesForAuditResult\x12J\n\x06\x46rames\x18\x01 \x03(\x0b\x32:.Volcengine.Vod.Models.Business.VodBetterFrameDataForAudit\"J\n\x14VodAudioInfoForAudit\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x01\x12\x0e\n\x06\x46ormat\x18\x03 \x01(\t\"h\n\x1dVodGetAudioInfoForAuditResult\x12G\n\tAudioInfo\x18\x01 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodAudioInfoForAudit\"n\n\x1bVodASRUtteranceWordForAudit\x12\x0c\n\x04Text\x18\x01 \x01(\t\x12\x15\n\rStartTimeMill\x18\x02 \x01(\x01\x12\x13\n\x0b\x45ndTimeMill\x18\x03 \x01(\x01\x12\x15\n\rBlankDuration\x18\x04 \x01(\x01\"\xc5\x01\n\x17VodASRUtteranceForAudit\x12\x0c\n\x04Text\x18\x01 \x01(\t\x12\x15\n\rStartTimeMill\x18\x02 \x01(\x01\x12\x13\n\x0b\x45ndTimeMill\x18\x03 \x01(\x01\x12J\n\x05Words\x18\x04 \x03(\x0b\x32;.Volcengine.Vod.Models.Business.VodASRUtteranceWordForAudit\x12\x10\n\x08Language\x18\x05 \x01(\t\x12\x12\n\nSpeechRate\x18\x06 \x01(\x01\">\n\x1cVodASRLanguageDetailForAudit\x12\x0c\n\x04Prob\x18\x01 \x01(\x01\x12\x10\n\x08Language\x18\x02 \x01(\t\"\xfc\x01\n\x12VodASRInfoForAudit\x12\x0c\n\x04Text\x18\x01 \x01(\t\x12K\n\nUtterances\x18\x03 \x03(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodASRUtteranceForAudit\x12\x10\n\x08Language\x18\x04 \x01(\t\x12U\n\x0fLanguageDetails\x18\x05 \x03(\x0b\x32<.Volcengine.Vod.Models.Business.VodASRLanguageDetailForAudit\x12\x12\n\nSpeechRate\x18\x06 \x01(\x01\x12\x0e\n\x06Volume\x18\x07 \x01(\x01\"r\n.VodGetAutomaticSpeechRecognitionForAuditResult\x12@\n\x04Info\x18\x01 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodASRInfoForAudit\"S\n\x17VodAEDTimeRangeForAudit\x12\x15\n\rStartTimeMill\x18\x01 \x01(\x01\x12\x13\n\x0b\x45ndTimeMill\x18\x02 \x01(\x01\x12\x0c\n\x04Prob\x18\x03 \x01(\x01\"\x86\x01\n\x17VodAEDEventItemForAudit\x12\r\n\x05\x45vent\x18\x01 \x01(\t\x12\x0f\n\x07UttProb\x18\x02 \x01(\x01\x12K\n\nTimeRanges\x18\x03 \x03(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodAEDTimeRangeForAudit\"a\n\x12VodAEDInfoForAudit\x12K\n\nEventItems\x18\x01 \x03(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodAEDEventItemForAudit\"k\n\'VodGetAudioEventDetectionForAuditResult\x12@\n\x04Info\x18\x01 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodAEDInfoForAudit\"<\n VodCreateVideoClassificationData\x12\x18\n\x10\x43lassificationId\x18\x01 \x01(\x03\"\xbb\x02\n\x11VodClassification\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x43lassificationId\x18\x02 \x01(\x03\x12\r\n\x05Level\x18\x03 \x01(\x05\x12\x16\n\x0e\x43lassification\x18\x04 \x01(\t\x12\x1e\n\x16ParentClassificationId\x18\x05 \x01(\x03\x12L\n\x11SubClassification\x18\x06 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodClassification\x12Q\n\x16SubClassificationTrees\x18\x07 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodClassification\x12\x11\n\tCreatedAt\x18\x08 \x01(\t\"m\n\x1bVodVideoClassificationsData\x12N\n\x13\x43lassificationTrees\x18\x01 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodClassification\"[\n\x0bVodSnapshot\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x0e\n\x06Height\x18\x02 \x01(\x05\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x10\n\x08StoreUri\x18\x04 \x01(\t\x12\x0b\n\x03Url\x18\x05 \x01(\t\"\xb3\x01\n\x11VodSpriteSnapshot\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x0f\n\x07ImgXLen\x18\x02 \x01(\x05\x12\x0f\n\x07ImgYLen\x18\x03 \x01(\x05\x12\x11\n\tCellWidth\x18\x04 \x01(\x05\x12\x12\n\nCellHeight\x18\x05 \x01(\x05\x12\x10\n\x08Interval\x18\x06 \x01(\x02\x12\x12\n\nCaptureNum\x18\x07 \x01(\x05\x12\x11\n\tStoreUris\x18\x08 \x03(\t\x12\x0c\n\x04Urls\x18\t \x03(\t\"\x91\x02\n\x17VodSamplePosterSnapshot\x12\x11\n\tStoreUris\x18\x01 \x03(\t\x12\x0e\n\x06ImgNum\x18\x02 \x01(\x05\x12\x11\n\tCellWidth\x18\x03 \x01(\x05\x12\x12\n\nCellHeight\x18\x04 \x01(\x05\x12\x10\n\x08Interval\x18\x05 \x01(\x02\x12\x0e\n\x06\x46ormat\x18\x06 \x01(\t\x12\x10\n\x08\x44uration\x18\x07 \x01(\x02\x12\x0c\n\x04Urls\x18\x08 \x03(\t\x12\x18\n\x10LargeSnapshotUri\x18\t \x01(\t\x12 \n\x18LargeSnapshotDownloadUrl\x18\n \x01(\t\x12\x1d\n\x15LargeSnapshotFillType\x18\x0b \x01(\t\x12\x0f\n\x07Offsets\x18\x0c \x03(\x02\"\xfa\x03\n\x0fVodSnapshotData\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x44\n\x0fPosterSnapshots\x18\x03 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodSnapshot\x12\x45\n\x10\x44ynpostSnapshots\x18\x04 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodSnapshot\x12L\n\x17\x41nimatedPosterSnapshots\x18\x05 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodSnapshot\x12G\n\x12\x41iDynpostSnapshots\x18\x06 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodSnapshot\x12J\n\x0fSpriteSnapshots\x18\x07 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodSpriteSnapshot\x12W\n\x16VSamplePosterSnapshots\x18\x08 \x03(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodSamplePosterSnapshot\"\xae\x01\n\x12VodGetFileListData\x12\x13\n\x0bIsTruncated\x18\x01 \x01(\x08\x12\x16\n\x0e\x43ommonPrefixes\x18\x02 \x03(\t\x12\x0f\n\x07\x46ileSum\x18\x03 \x01(\x03\x12\x13\n\x0bNextStarter\x18\x04 \x01(\t\x12\x45\n\x0e\x46ileBasicInfos\x18\x05 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.FileBasicInfo\"Z\n\rFileBasicInfo\x12\x10\n\x08\x46ileName\x18\x01 \x01(\t\x12\x0c\n\x04Size\x18\x02 \x01(\x03\x12\x14\n\x0cStorageClass\x18\x03 \x01(\t\x12\x13\n\x0bUpdatedTime\x18\x04 \x01(\t\"\x92\x01\n\x13VodGetFileInfosData\x12>\n\tFileInfos\x18\x01 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.VodFileInfo\x12\x19\n\x11NotExistFileNames\x18\x02 \x03(\t\x12 \n\x18NotExistEncodedFileNames\x18\x03 \x03(\t\"\x9e\x01\n\x0bVodFileInfo\x12\x10\n\x08\x46ileName\x18\x01 \x01(\t\x12\x18\n\x10LastModifiedTime\x18\x02 \x01(\t\x12\x0c\n\x04Size\x18\x03 \x01(\x03\x12\x14\n\x0cStorageClass\x18\x04 \x01(\t\x12\x11\n\tHashCrc64\x18\x05 \x01(\t\x12\x17\n\x0f\x45ncodedFileName\x18\x06 \x01(\t\x12\x13\n\x0b\x44ownloadUrl\x18\x07 \x01(\t\";\n\x11VodFileUpdateInfo\x12\x10\n\x08\x46ileName\x18\x01 \x01(\t\x12\x14\n\x0cStorageClass\x18\x02 \x01(\t\":\n\x1dVodUpdateFileStorageClassData\x12\x19\n\x11NotExistFileNames\x18\x01 \x03(\t\"(\n\x18VodGetInnerAuditURLsData\x12\x0c\n\x04Urls\x18\x01 \x03(\t\"c\n\x1cVodGetAdAuditResultByVidData\x12\x43\n\rVodAuditInfos\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodAuditInfo\"\xa9\x02\n\x0cVodAuditInfo\x12\x0e\n\x06\x46ileId\x18\x01 \x01(\t\x12\x10\n\x08\x46ileName\x18\x02 \x01(\t\x12\x10\n\x08\x46ileType\x18\x03 \x01(\t\x12\x12\n\nDefinition\x18\x04 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x05 \x01(\t\x12\r\n\x05\x43odec\x18\x06 \x01(\t\x12\x0f\n\x07Quality\x18\x07 \x01(\t\x12\x0f\n\x07\x42itrate\x18\x08 \x01(\x03\x12\x10\n\x08\x43reateAt\x18\t \x01(\x03\x12\x10\n\x08UpdateAt\x18\n \x01(\x03\x12\x14\n\x0c\x41\x64vertiserId\x18\x0b \x01(\x03\x12\x14\n\x0c\x42usinessType\x18\x0c \x01(\t\x12@\n\x0b\x41uditResult\x18\r \x01(\x0b\x32+.Volcengine.Vod.Models.Business.AuditResult\"-\n\x0b\x41uditResult\x12\x0e\n\x06Status\x18\x01 \x01(\t\x12\x0e\n\x06Reason\x18\x02 \x01(\t\"6\n\x1eVodUpdateMediaStorageClassData\x12\x14\n\x0cNotExistVids\x18\x01 \x03(\t\"b\n\x1dVodSubmitBlockMediaTaskResult\x12\x14\n\x0cNotExistVids\x18\x01 \x03(\t\x12\x13\n\x0b\x42lockedVids\x18\x02 \x03(\t\x12\x16\n\x0eUnblockingVids\x18\x03 \x03(\t\"d\n\x1fVodSubmitUnblockMediaTaskResult\x12\x14\n\x0cNotExistVids\x18\x01 \x03(\t\x12\x15\n\rUnblockedVids\x18\x02 \x03(\t\x12\x14\n\x0c\x42lockingVids\x18\x03 \x03(\t\"\x84\x01\n\x1eVodQueryMediaBlockStatusResult\x12\x14\n\x0cNotExistVids\x18\x01 \x03(\t\x12L\n\x12MediaBlockStatuses\x18\x02 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.MediaBlockStatus\"/\n\x10MediaBlockStatus\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\"\xa4\x01\n\x1bVodGetMediaEntityListResult\x12\x12\n\nTotalCount\x18\x01 \x01(\x05\x12\x12\n\nPageNumber\x18\x02 \x01(\x05\x12\x10\n\x08PageSize\x18\x03 \x01(\x05\x12K\n\x0f\x42\x61seEntityInfos\x18\x04 \x03(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodBaseMediaEntity\"\xcf\x01\n\x17VodGetMediaEntityResult\x12J\n\x0e\x42\x61seEntityInfo\x18\x01 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodBaseMediaEntity\x12\x1a\n\x12\x45ntityExtraRawInfo\x18\x02 \x01(\t\x12L\n\rPublicUrlInfo\x18\x03 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodMediaPublicUrlInfo\":\n\x15VodMediaPublicUrlInfo\x12\x0e\n\x06\x43\x64nUrl\x18\x01 \x01(\t\x12\x11\n\tOriginUrl\x18\x02 \x01(\t\"\xe0\x01\n\x12VodBaseMediaEntity\x12\n\n\x02Id\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x12\n\nEntityType\x18\x03 \x01(\t\x12\x15\n\rEntityVersion\x18\x04 \x01(\t\x12\x11\n\tSpaceName\x18\x05 \x01(\t\x12\x10\n\x08StoreUri\x18\x06 \x01(\t\x12\x10\n\x08\x46ileName\x18\x07 \x01(\t\x12\x0e\n\x06Source\x18\x08 \x01(\t\x12\x11\n\tCreatedAt\x18\t \x01(\t\x12\x11\n\tUpdatedAt\x18\n \x01(\t\x12\x19\n\x11\x45ntityBaseRawInfo\x18\x0b \x01(\t\"\xb8\x01\n\x14VodMediaEntityConfig\x12\x16\n\x0e\x45ntityTypeName\x18\x01 \x01(\t\x12\x19\n\x11\x45ntityTypeDisplay\x18\x02 \x01(\t\x12\x12\n\nIsTextFile\x18\x03 \x01(\x08\x12Y\n\x14\x45ntityVersionConfigs\x18\x04 \x03(\x0b\x32;.Volcengine.Vod.Models.Business.VodMediaEntityVersionConfig\"V\n\x1bVodMediaEntityVersionConfig\x12\x19\n\x11\x45ntityVersionName\x18\x01 \x01(\t\x12\x1c\n\x14\x45ntityVersionDisplay\x18\x02 \x01(\t*\xd0\x02\n VodFrameExtractingOptionForAudit\x12-\n)UndefinedVodFrameExtractingOptionForAudit\x10\x00\x12\'\n#FpsVodFrameExtractingOptionForAudit\x10\x01\x12\x32\n.NumberOfFramesVodFrameExtractingOptionForAudit\x10\x02\x12,\n(CutTimesVodFrameExtractingOptionForAudit\x10\x03\x12:\n6FpsLimitNumberOfFramesVodFrameExtractingOptionForAudit\x10\x04\x12\x36\n2OnlyFirstLastFrameVodFrameExtractingOptionForAudit\x10\x05\x42\xcc\x01\n)com.volcengine.service.vod.model.businessB\x08VodMediaP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODFRAMEEXTRACTINGOPTIONFORAUDIT = DESCRIPTOR.enum_types_by_name['VodFrameExtractingOptionForAudit'] VodFrameExtractingOptionForAudit = enum_type_wrapper.EnumTypeWrapper(_VODFRAMEEXTRACTINGOPTIONFORAUDIT) UndefinedVodFrameExtractingOptionForAudit = 0 FpsVodFrameExtractingOptionForAudit = 1 NumberOfFramesVodFrameExtractingOptionForAudit = 2 CutTimesVodFrameExtractingOptionForAudit = 3 FpsLimitNumberOfFramesVodFrameExtractingOptionForAudit = 4 OnlyFirstLastFrameVodFrameExtractingOptionForAudit = 5 _VODLISTFILEMETAINFOSBYFILENAMESRESULT = DESCRIPTOR.message_types_by_name['VodListFileMetaInfosByFileNamesResult'] _VODFILEMETAINFO = DESCRIPTOR.message_types_by_name['VodFileMetaInfo'] _VODMEDIABASICINFO = DESCRIPTOR.message_types_by_name['VodMediaBasicInfo'] _VODMEDIAINFO = DESCRIPTOR.message_types_by_name['VodMediaInfo'] _VODGETMEDIAINFOSDATA = DESCRIPTOR.message_types_by_name['VodGetMediaInfosData'] _VODSTOREURIGROUP = DESCRIPTOR.message_types_by_name['VodStoreUriGroup'] _VODGETRECPOSTERDATA = DESCRIPTOR.message_types_by_name['VodGetRecPosterData'] _VODDELETEMEDIADATA = DESCRIPTOR.message_types_by_name['VodDeleteMediaData'] _VODDELETETRANSCODESDATA = DESCRIPTOR.message_types_by_name['VodDeleteTranscodesData'] _VODDELETEMEDIATOSFILEDATA = DESCRIPTOR.message_types_by_name['VodDeleteMediaTosFileData'] _VODGETMEDIALISTDATA = DESCRIPTOR.message_types_by_name['VodGetMediaListData'] _VODUPDATESUBTITLESTATUSDATA = DESCRIPTOR.message_types_by_name['VodUpdateSubtitleStatusData'] _VODFILESUBTITLEINFO = DESCRIPTOR.message_types_by_name['VodFileSubtitleInfo'] _VODGETSUBTITLEINFOLISTDATA = DESCRIPTOR.message_types_by_name['VodGetSubtitleInfoListData'] _VODFRAMEDATAFORAUDIT = DESCRIPTOR.message_types_by_name['VodFrameDataForAudit'] _VODGETFRAMESFORAUDITRESULT = DESCRIPTOR.message_types_by_name['VodGetFramesForAuditResult'] _VODBETTERFRAMEDATAFORAUDIT = DESCRIPTOR.message_types_by_name['VodBetterFrameDataForAudit'] _VODGETBETTERFRAMESFORAUDITRESULT = DESCRIPTOR.message_types_by_name['VodGetBetterFramesForAuditResult'] _VODAUDIOINFOFORAUDIT = DESCRIPTOR.message_types_by_name['VodAudioInfoForAudit'] _VODGETAUDIOINFOFORAUDITRESULT = DESCRIPTOR.message_types_by_name['VodGetAudioInfoForAuditResult'] _VODASRUTTERANCEWORDFORAUDIT = DESCRIPTOR.message_types_by_name['VodASRUtteranceWordForAudit'] _VODASRUTTERANCEFORAUDIT = DESCRIPTOR.message_types_by_name['VodASRUtteranceForAudit'] _VODASRLANGUAGEDETAILFORAUDIT = DESCRIPTOR.message_types_by_name['VodASRLanguageDetailForAudit'] _VODASRINFOFORAUDIT = DESCRIPTOR.message_types_by_name['VodASRInfoForAudit'] _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESULT = DESCRIPTOR.message_types_by_name['VodGetAutomaticSpeechRecognitionForAuditResult'] _VODAEDTIMERANGEFORAUDIT = DESCRIPTOR.message_types_by_name['VodAEDTimeRangeForAudit'] _VODAEDEVENTITEMFORAUDIT = DESCRIPTOR.message_types_by_name['VodAEDEventItemForAudit'] _VODAEDINFOFORAUDIT = DESCRIPTOR.message_types_by_name['VodAEDInfoForAudit'] _VODGETAUDIOEVENTDETECTIONFORAUDITRESULT = DESCRIPTOR.message_types_by_name['VodGetAudioEventDetectionForAuditResult'] _VODCREATEVIDEOCLASSIFICATIONDATA = DESCRIPTOR.message_types_by_name['VodCreateVideoClassificationData'] _VODCLASSIFICATION = DESCRIPTOR.message_types_by_name['VodClassification'] _VODVIDEOCLASSIFICATIONSDATA = DESCRIPTOR.message_types_by_name['VodVideoClassificationsData'] _VODSNAPSHOT = DESCRIPTOR.message_types_by_name['VodSnapshot'] _VODSPRITESNAPSHOT = DESCRIPTOR.message_types_by_name['VodSpriteSnapshot'] _VODSAMPLEPOSTERSNAPSHOT = DESCRIPTOR.message_types_by_name['VodSamplePosterSnapshot'] _VODSNAPSHOTDATA = DESCRIPTOR.message_types_by_name['VodSnapshotData'] _VODGETFILELISTDATA = DESCRIPTOR.message_types_by_name['VodGetFileListData'] _FILEBASICINFO = DESCRIPTOR.message_types_by_name['FileBasicInfo'] _VODGETFILEINFOSDATA = DESCRIPTOR.message_types_by_name['VodGetFileInfosData'] _VODFILEINFO = DESCRIPTOR.message_types_by_name['VodFileInfo'] _VODFILEUPDATEINFO = DESCRIPTOR.message_types_by_name['VodFileUpdateInfo'] _VODUPDATEFILESTORAGECLASSDATA = DESCRIPTOR.message_types_by_name['VodUpdateFileStorageClassData'] _VODGETINNERAUDITURLSDATA = DESCRIPTOR.message_types_by_name['VodGetInnerAuditURLsData'] _VODGETADAUDITRESULTBYVIDDATA = DESCRIPTOR.message_types_by_name['VodGetAdAuditResultByVidData'] _VODAUDITINFO = DESCRIPTOR.message_types_by_name['VodAuditInfo'] _AUDITRESULT = DESCRIPTOR.message_types_by_name['AuditResult'] _VODUPDATEMEDIASTORAGECLASSDATA = DESCRIPTOR.message_types_by_name['VodUpdateMediaStorageClassData'] _VODSUBMITBLOCKMEDIATASKRESULT = DESCRIPTOR.message_types_by_name['VodSubmitBlockMediaTaskResult'] _VODSUBMITUNBLOCKMEDIATASKRESULT = DESCRIPTOR.message_types_by_name['VodSubmitUnblockMediaTaskResult'] _VODQUERYMEDIABLOCKSTATUSRESULT = DESCRIPTOR.message_types_by_name['VodQueryMediaBlockStatusResult'] _MEDIABLOCKSTATUS = DESCRIPTOR.message_types_by_name['MediaBlockStatus'] _VODGETMEDIAENTITYLISTRESULT = DESCRIPTOR.message_types_by_name['VodGetMediaEntityListResult'] _VODGETMEDIAENTITYRESULT = DESCRIPTOR.message_types_by_name['VodGetMediaEntityResult'] _VODMEDIAPUBLICURLINFO = DESCRIPTOR.message_types_by_name['VodMediaPublicUrlInfo'] _VODBASEMEDIAENTITY = DESCRIPTOR.message_types_by_name['VodBaseMediaEntity'] _VODMEDIAENTITYCONFIG = DESCRIPTOR.message_types_by_name['VodMediaEntityConfig'] _VODMEDIAENTITYVERSIONCONFIG = DESCRIPTOR.message_types_by_name['VodMediaEntityVersionConfig'] VodListFileMetaInfosByFileNamesResult = _reflection.GeneratedProtocolMessageType('VodListFileMetaInfosByFileNamesResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTFILEMETAINFOSBYFILENAMESRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListFileMetaInfosByFileNamesResult) }) _sym_db.RegisterMessage(VodListFileMetaInfosByFileNamesResult) VodFileMetaInfo = _reflection.GeneratedProtocolMessageType('VodFileMetaInfo', (_message.Message,), { 'DESCRIPTOR' : _VODFILEMETAINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodFileMetaInfo) }) _sym_db.RegisterMessage(VodFileMetaInfo) VodMediaBasicInfo = _reflection.GeneratedProtocolMessageType('VodMediaBasicInfo', (_message.Message,), { 'DESCRIPTOR' : _VODMEDIABASICINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodMediaBasicInfo) }) _sym_db.RegisterMessage(VodMediaBasicInfo) VodMediaInfo = _reflection.GeneratedProtocolMessageType('VodMediaInfo', (_message.Message,), { 'DESCRIPTOR' : _VODMEDIAINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodMediaInfo) }) _sym_db.RegisterMessage(VodMediaInfo) VodGetMediaInfosData = _reflection.GeneratedProtocolMessageType('VodGetMediaInfosData', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAINFOSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetMediaInfosData) }) _sym_db.RegisterMessage(VodGetMediaInfosData) VodStoreUriGroup = _reflection.GeneratedProtocolMessageType('VodStoreUriGroup', (_message.Message,), { 'DESCRIPTOR' : _VODSTOREURIGROUP, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodStoreUriGroup) }) _sym_db.RegisterMessage(VodStoreUriGroup) VodGetRecPosterData = _reflection.GeneratedProtocolMessageType('VodGetRecPosterData', (_message.Message,), { 'DESCRIPTOR' : _VODGETRECPOSTERDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetRecPosterData) }) _sym_db.RegisterMessage(VodGetRecPosterData) VodDeleteMediaData = _reflection.GeneratedProtocolMessageType('VodDeleteMediaData', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIADATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDeleteMediaData) }) _sym_db.RegisterMessage(VodDeleteMediaData) VodDeleteTranscodesData = _reflection.GeneratedProtocolMessageType('VodDeleteTranscodesData', (_message.Message,), { 'DESCRIPTOR' : _VODDELETETRANSCODESDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDeleteTranscodesData) }) _sym_db.RegisterMessage(VodDeleteTranscodesData) VodDeleteMediaTosFileData = _reflection.GeneratedProtocolMessageType('VodDeleteMediaTosFileData', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIATOSFILEDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDeleteMediaTosFileData) }) _sym_db.RegisterMessage(VodDeleteMediaTosFileData) VodGetMediaListData = _reflection.GeneratedProtocolMessageType('VodGetMediaListData', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIALISTDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetMediaListData) }) _sym_db.RegisterMessage(VodGetMediaListData) VodUpdateSubtitleStatusData = _reflection.GeneratedProtocolMessageType('VodUpdateSubtitleStatusData', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESUBTITLESTATUSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUpdateSubtitleStatusData) }) _sym_db.RegisterMessage(VodUpdateSubtitleStatusData) VodFileSubtitleInfo = _reflection.GeneratedProtocolMessageType('VodFileSubtitleInfo', (_message.Message,), { 'DESCRIPTOR' : _VODFILESUBTITLEINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodFileSubtitleInfo) }) _sym_db.RegisterMessage(VodFileSubtitleInfo) VodGetSubtitleInfoListData = _reflection.GeneratedProtocolMessageType('VodGetSubtitleInfoListData', (_message.Message,), { 'DESCRIPTOR' : _VODGETSUBTITLEINFOLISTDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetSubtitleInfoListData) }) _sym_db.RegisterMessage(VodGetSubtitleInfoListData) VodFrameDataForAudit = _reflection.GeneratedProtocolMessageType('VodFrameDataForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODFRAMEDATAFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodFrameDataForAudit) }) _sym_db.RegisterMessage(VodFrameDataForAudit) VodGetFramesForAuditResult = _reflection.GeneratedProtocolMessageType('VodGetFramesForAuditResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETFRAMESFORAUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetFramesForAuditResult) }) _sym_db.RegisterMessage(VodGetFramesForAuditResult) VodBetterFrameDataForAudit = _reflection.GeneratedProtocolMessageType('VodBetterFrameDataForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODBETTERFRAMEDATAFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodBetterFrameDataForAudit) }) _sym_db.RegisterMessage(VodBetterFrameDataForAudit) VodGetBetterFramesForAuditResult = _reflection.GeneratedProtocolMessageType('VodGetBetterFramesForAuditResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETBETTERFRAMESFORAUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetBetterFramesForAuditResult) }) _sym_db.RegisterMessage(VodGetBetterFramesForAuditResult) VodAudioInfoForAudit = _reflection.GeneratedProtocolMessageType('VodAudioInfoForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODAUDIOINFOFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAudioInfoForAudit) }) _sym_db.RegisterMessage(VodAudioInfoForAudit) VodGetAudioInfoForAuditResult = _reflection.GeneratedProtocolMessageType('VodGetAudioInfoForAuditResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOINFOFORAUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetAudioInfoForAuditResult) }) _sym_db.RegisterMessage(VodGetAudioInfoForAuditResult) VodASRUtteranceWordForAudit = _reflection.GeneratedProtocolMessageType('VodASRUtteranceWordForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODASRUTTERANCEWORDFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodASRUtteranceWordForAudit) }) _sym_db.RegisterMessage(VodASRUtteranceWordForAudit) VodASRUtteranceForAudit = _reflection.GeneratedProtocolMessageType('VodASRUtteranceForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODASRUTTERANCEFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodASRUtteranceForAudit) }) _sym_db.RegisterMessage(VodASRUtteranceForAudit) VodASRLanguageDetailForAudit = _reflection.GeneratedProtocolMessageType('VodASRLanguageDetailForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODASRLANGUAGEDETAILFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodASRLanguageDetailForAudit) }) _sym_db.RegisterMessage(VodASRLanguageDetailForAudit) VodASRInfoForAudit = _reflection.GeneratedProtocolMessageType('VodASRInfoForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODASRINFOFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodASRInfoForAudit) }) _sym_db.RegisterMessage(VodASRInfoForAudit) VodGetAutomaticSpeechRecognitionForAuditResult = _reflection.GeneratedProtocolMessageType('VodGetAutomaticSpeechRecognitionForAuditResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetAutomaticSpeechRecognitionForAuditResult) }) _sym_db.RegisterMessage(VodGetAutomaticSpeechRecognitionForAuditResult) VodAEDTimeRangeForAudit = _reflection.GeneratedProtocolMessageType('VodAEDTimeRangeForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODAEDTIMERANGEFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAEDTimeRangeForAudit) }) _sym_db.RegisterMessage(VodAEDTimeRangeForAudit) VodAEDEventItemForAudit = _reflection.GeneratedProtocolMessageType('VodAEDEventItemForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODAEDEVENTITEMFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAEDEventItemForAudit) }) _sym_db.RegisterMessage(VodAEDEventItemForAudit) VodAEDInfoForAudit = _reflection.GeneratedProtocolMessageType('VodAEDInfoForAudit', (_message.Message,), { 'DESCRIPTOR' : _VODAEDINFOFORAUDIT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAEDInfoForAudit) }) _sym_db.RegisterMessage(VodAEDInfoForAudit) VodGetAudioEventDetectionForAuditResult = _reflection.GeneratedProtocolMessageType('VodGetAudioEventDetectionForAuditResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOEVENTDETECTIONFORAUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetAudioEventDetectionForAuditResult) }) _sym_db.RegisterMessage(VodGetAudioEventDetectionForAuditResult) VodCreateVideoClassificationData = _reflection.GeneratedProtocolMessageType('VodCreateVideoClassificationData', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEVIDEOCLASSIFICATIONDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateVideoClassificationData) }) _sym_db.RegisterMessage(VodCreateVideoClassificationData) VodClassification = _reflection.GeneratedProtocolMessageType('VodClassification', (_message.Message,), { 'DESCRIPTOR' : _VODCLASSIFICATION, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodClassification) }) _sym_db.RegisterMessage(VodClassification) VodVideoClassificationsData = _reflection.GeneratedProtocolMessageType('VodVideoClassificationsData', (_message.Message,), { 'DESCRIPTOR' : _VODVIDEOCLASSIFICATIONSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodVideoClassificationsData) }) _sym_db.RegisterMessage(VodVideoClassificationsData) VodSnapshot = _reflection.GeneratedProtocolMessageType('VodSnapshot', (_message.Message,), { 'DESCRIPTOR' : _VODSNAPSHOT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSnapshot) }) _sym_db.RegisterMessage(VodSnapshot) VodSpriteSnapshot = _reflection.GeneratedProtocolMessageType('VodSpriteSnapshot', (_message.Message,), { 'DESCRIPTOR' : _VODSPRITESNAPSHOT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSpriteSnapshot) }) _sym_db.RegisterMessage(VodSpriteSnapshot) VodSamplePosterSnapshot = _reflection.GeneratedProtocolMessageType('VodSamplePosterSnapshot', (_message.Message,), { 'DESCRIPTOR' : _VODSAMPLEPOSTERSNAPSHOT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSamplePosterSnapshot) }) _sym_db.RegisterMessage(VodSamplePosterSnapshot) VodSnapshotData = _reflection.GeneratedProtocolMessageType('VodSnapshotData', (_message.Message,), { 'DESCRIPTOR' : _VODSNAPSHOTDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSnapshotData) }) _sym_db.RegisterMessage(VodSnapshotData) VodGetFileListData = _reflection.GeneratedProtocolMessageType('VodGetFileListData', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILELISTDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetFileListData) }) _sym_db.RegisterMessage(VodGetFileListData) FileBasicInfo = _reflection.GeneratedProtocolMessageType('FileBasicInfo', (_message.Message,), { 'DESCRIPTOR' : _FILEBASICINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.FileBasicInfo) }) _sym_db.RegisterMessage(FileBasicInfo) VodGetFileInfosData = _reflection.GeneratedProtocolMessageType('VodGetFileInfosData', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILEINFOSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetFileInfosData) }) _sym_db.RegisterMessage(VodGetFileInfosData) VodFileInfo = _reflection.GeneratedProtocolMessageType('VodFileInfo', (_message.Message,), { 'DESCRIPTOR' : _VODFILEINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodFileInfo) }) _sym_db.RegisterMessage(VodFileInfo) VodFileUpdateInfo = _reflection.GeneratedProtocolMessageType('VodFileUpdateInfo', (_message.Message,), { 'DESCRIPTOR' : _VODFILEUPDATEINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodFileUpdateInfo) }) _sym_db.RegisterMessage(VodFileUpdateInfo) VodUpdateFileStorageClassData = _reflection.GeneratedProtocolMessageType('VodUpdateFileStorageClassData', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEFILESTORAGECLASSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUpdateFileStorageClassData) }) _sym_db.RegisterMessage(VodUpdateFileStorageClassData) VodGetInnerAuditURLsData = _reflection.GeneratedProtocolMessageType('VodGetInnerAuditURLsData', (_message.Message,), { 'DESCRIPTOR' : _VODGETINNERAUDITURLSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetInnerAuditURLsData) }) _sym_db.RegisterMessage(VodGetInnerAuditURLsData) VodGetAdAuditResultByVidData = _reflection.GeneratedProtocolMessageType('VodGetAdAuditResultByVidData', (_message.Message,), { 'DESCRIPTOR' : _VODGETADAUDITRESULTBYVIDDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetAdAuditResultByVidData) }) _sym_db.RegisterMessage(VodGetAdAuditResultByVidData) VodAuditInfo = _reflection.GeneratedProtocolMessageType('VodAuditInfo', (_message.Message,), { 'DESCRIPTOR' : _VODAUDITINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodAuditInfo) }) _sym_db.RegisterMessage(VodAuditInfo) AuditResult = _reflection.GeneratedProtocolMessageType('AuditResult', (_message.Message,), { 'DESCRIPTOR' : _AUDITRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AuditResult) }) _sym_db.RegisterMessage(AuditResult) VodUpdateMediaStorageClassData = _reflection.GeneratedProtocolMessageType('VodUpdateMediaStorageClassData', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIASTORAGECLASSDATA, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUpdateMediaStorageClassData) }) _sym_db.RegisterMessage(VodUpdateMediaStorageClassData) VodSubmitBlockMediaTaskResult = _reflection.GeneratedProtocolMessageType('VodSubmitBlockMediaTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKMEDIATASKRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubmitBlockMediaTaskResult) }) _sym_db.RegisterMessage(VodSubmitBlockMediaTaskResult) VodSubmitUnblockMediaTaskResult = _reflection.GeneratedProtocolMessageType('VodSubmitUnblockMediaTaskResult', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITUNBLOCKMEDIATASKRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubmitUnblockMediaTaskResult) }) _sym_db.RegisterMessage(VodSubmitUnblockMediaTaskResult) VodQueryMediaBlockStatusResult = _reflection.GeneratedProtocolMessageType('VodQueryMediaBlockStatusResult', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMEDIABLOCKSTATUSRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryMediaBlockStatusResult) }) _sym_db.RegisterMessage(VodQueryMediaBlockStatusResult) MediaBlockStatus = _reflection.GeneratedProtocolMessageType('MediaBlockStatus', (_message.Message,), { 'DESCRIPTOR' : _MEDIABLOCKSTATUS, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.MediaBlockStatus) }) _sym_db.RegisterMessage(MediaBlockStatus) VodGetMediaEntityListResult = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityListResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYLISTRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetMediaEntityListResult) }) _sym_db.RegisterMessage(VodGetMediaEntityListResult) VodGetMediaEntityResult = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYRESULT, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetMediaEntityResult) }) _sym_db.RegisterMessage(VodGetMediaEntityResult) VodMediaPublicUrlInfo = _reflection.GeneratedProtocolMessageType('VodMediaPublicUrlInfo', (_message.Message,), { 'DESCRIPTOR' : _VODMEDIAPUBLICURLINFO, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodMediaPublicUrlInfo) }) _sym_db.RegisterMessage(VodMediaPublicUrlInfo) VodBaseMediaEntity = _reflection.GeneratedProtocolMessageType('VodBaseMediaEntity', (_message.Message,), { 'DESCRIPTOR' : _VODBASEMEDIAENTITY, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodBaseMediaEntity) }) _sym_db.RegisterMessage(VodBaseMediaEntity) VodMediaEntityConfig = _reflection.GeneratedProtocolMessageType('VodMediaEntityConfig', (_message.Message,), { 'DESCRIPTOR' : _VODMEDIAENTITYCONFIG, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodMediaEntityConfig) }) _sym_db.RegisterMessage(VodMediaEntityConfig) VodMediaEntityVersionConfig = _reflection.GeneratedProtocolMessageType('VodMediaEntityVersionConfig', (_message.Message,), { 'DESCRIPTOR' : _VODMEDIAENTITYVERSIONCONFIG, '__module__' : 'volcengine.vod.business.vod_media_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodMediaEntityVersionConfig) }) _sym_db.RegisterMessage(VodMediaEntityVersionConfig) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\010VodMediaP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODFRAMEEXTRACTINGOPTIONFORAUDIT._serialized_start=7872 _VODFRAMEEXTRACTINGOPTIONFORAUDIT._serialized_end=8208 _VODLISTFILEMETAINFOSBYFILENAMESRESULT._serialized_start=117 _VODLISTFILEMETAINFOSBYFILENAMESRESULT._serialized_end=231 _VODFILEMETAINFO._serialized_start=233 _VODFILEMETAINFO._serialized_end=360 _VODMEDIABASICINFO._serialized_start=363 _VODMEDIABASICINFO._serialized_end=693 _VODMEDIAINFO._serialized_start=696 _VODMEDIAINFO._serialized_end=921 _VODGETMEDIAINFOSDATA._serialized_start=923 _VODGETMEDIAINFOSDATA._serialized_end=1036 _VODSTOREURIGROUP._serialized_start=1038 _VODSTOREURIGROUP._serialized_end=1088 _VODGETRECPOSTERDATA._serialized_start=1090 _VODGETRECPOSTERDATA._serialized_end=1207 _VODDELETEMEDIADATA._serialized_start=1209 _VODDELETEMEDIADATA._serialized_end=1251 _VODDELETETRANSCODESDATA._serialized_start=1253 _VODDELETETRANSCODESDATA._serialized_end=1303 _VODDELETEMEDIATOSFILEDATA._serialized_start=1305 _VODDELETEMEDIATOSFILEDATA._serialized_end=1357 _VODGETMEDIALISTDATA._serialized_start=1360 _VODGETMEDIALISTDATA._serialized_end=1523 _VODUPDATESUBTITLESTATUSDATA._serialized_start=1525 _VODUPDATESUBTITLESTATUSDATA._serialized_end=1579 _VODFILESUBTITLEINFO._serialized_start=1581 _VODFILESUBTITLEINFO._serialized_end=1693 _VODGETSUBTITLEINFOLISTDATA._serialized_start=1696 _VODGETSUBTITLEINFOLISTDATA._serialized_end=1899 _VODFRAMEDATAFORAUDIT._serialized_start=1901 _VODFRAMEDATAFORAUDIT._serialized_end=2014 _VODGETFRAMESFORAUDITRESULT._serialized_start=2016 _VODGETFRAMESFORAUDITRESULT._serialized_end=2114 _VODBETTERFRAMEDATAFORAUDIT._serialized_start=2117 _VODBETTERFRAMEDATAFORAUDIT._serialized_end=2276 _VODGETBETTERFRAMESFORAUDITRESULT._serialized_start=2278 _VODGETBETTERFRAMESFORAUDITRESULT._serialized_end=2388 _VODAUDIOINFOFORAUDIT._serialized_start=2390 _VODAUDIOINFOFORAUDIT._serialized_end=2464 _VODGETAUDIOINFOFORAUDITRESULT._serialized_start=2466 _VODGETAUDIOINFOFORAUDITRESULT._serialized_end=2570 _VODASRUTTERANCEWORDFORAUDIT._serialized_start=2572 _VODASRUTTERANCEWORDFORAUDIT._serialized_end=2682 _VODASRUTTERANCEFORAUDIT._serialized_start=2685 _VODASRUTTERANCEFORAUDIT._serialized_end=2882 _VODASRLANGUAGEDETAILFORAUDIT._serialized_start=2884 _VODASRLANGUAGEDETAILFORAUDIT._serialized_end=2946 _VODASRINFOFORAUDIT._serialized_start=2949 _VODASRINFOFORAUDIT._serialized_end=3201 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESULT._serialized_start=3203 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESULT._serialized_end=3317 _VODAEDTIMERANGEFORAUDIT._serialized_start=3319 _VODAEDTIMERANGEFORAUDIT._serialized_end=3402 _VODAEDEVENTITEMFORAUDIT._serialized_start=3405 _VODAEDEVENTITEMFORAUDIT._serialized_end=3539 _VODAEDINFOFORAUDIT._serialized_start=3541 _VODAEDINFOFORAUDIT._serialized_end=3638 _VODGETAUDIOEVENTDETECTIONFORAUDITRESULT._serialized_start=3640 _VODGETAUDIOEVENTDETECTIONFORAUDITRESULT._serialized_end=3747 _VODCREATEVIDEOCLASSIFICATIONDATA._serialized_start=3749 _VODCREATEVIDEOCLASSIFICATIONDATA._serialized_end=3809 _VODCLASSIFICATION._serialized_start=3812 _VODCLASSIFICATION._serialized_end=4127 _VODVIDEOCLASSIFICATIONSDATA._serialized_start=4129 _VODVIDEOCLASSIFICATIONSDATA._serialized_end=4238 _VODSNAPSHOT._serialized_start=4240 _VODSNAPSHOT._serialized_end=4331 _VODSPRITESNAPSHOT._serialized_start=4334 _VODSPRITESNAPSHOT._serialized_end=4513 _VODSAMPLEPOSTERSNAPSHOT._serialized_start=4516 _VODSAMPLEPOSTERSNAPSHOT._serialized_end=4789 _VODSNAPSHOTDATA._serialized_start=4792 _VODSNAPSHOTDATA._serialized_end=5298 _VODGETFILELISTDATA._serialized_start=5301 _VODGETFILELISTDATA._serialized_end=5475 _FILEBASICINFO._serialized_start=5477 _FILEBASICINFO._serialized_end=5567 _VODGETFILEINFOSDATA._serialized_start=5570 _VODGETFILEINFOSDATA._serialized_end=5716 _VODFILEINFO._serialized_start=5719 _VODFILEINFO._serialized_end=5877 _VODFILEUPDATEINFO._serialized_start=5879 _VODFILEUPDATEINFO._serialized_end=5938 _VODUPDATEFILESTORAGECLASSDATA._serialized_start=5940 _VODUPDATEFILESTORAGECLASSDATA._serialized_end=5998 _VODGETINNERAUDITURLSDATA._serialized_start=6000 _VODGETINNERAUDITURLSDATA._serialized_end=6040 _VODGETADAUDITRESULTBYVIDDATA._serialized_start=6042 _VODGETADAUDITRESULTBYVIDDATA._serialized_end=6141 _VODAUDITINFO._serialized_start=6144 _VODAUDITINFO._serialized_end=6441 _AUDITRESULT._serialized_start=6443 _AUDITRESULT._serialized_end=6488 _VODUPDATEMEDIASTORAGECLASSDATA._serialized_start=6490 _VODUPDATEMEDIASTORAGECLASSDATA._serialized_end=6544 _VODSUBMITBLOCKMEDIATASKRESULT._serialized_start=6546 _VODSUBMITBLOCKMEDIATASKRESULT._serialized_end=6644 _VODSUBMITUNBLOCKMEDIATASKRESULT._serialized_start=6646 _VODSUBMITUNBLOCKMEDIATASKRESULT._serialized_end=6746 _VODQUERYMEDIABLOCKSTATUSRESULT._serialized_start=6749 _VODQUERYMEDIABLOCKSTATUSRESULT._serialized_end=6881 _MEDIABLOCKSTATUS._serialized_start=6883 _MEDIABLOCKSTATUS._serialized_end=6930 _VODGETMEDIAENTITYLISTRESULT._serialized_start=6933 _VODGETMEDIAENTITYLISTRESULT._serialized_end=7097 _VODGETMEDIAENTITYRESULT._serialized_start=7100 _VODGETMEDIAENTITYRESULT._serialized_end=7307 _VODMEDIAPUBLICURLINFO._serialized_start=7309 _VODMEDIAPUBLICURLINFO._serialized_end=7367 _VODBASEMEDIAENTITY._serialized_start=7370 _VODBASEMEDIAENTITY._serialized_end=7594 _VODMEDIAENTITYCONFIG._serialized_start=7597 _VODMEDIAENTITYCONFIG._serialized_end=7781 _VODMEDIAENTITYVERSIONCONFIG._serialized_start=7783 _VODMEDIAENTITYVERSIONCONFIG._serialized_end=7869 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_migrate_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_migrate.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)volcengine/vod/business/vod_migrate.proto\x12\x1eVolcengine.Vod.Models.Business\"\x81\x01\n\x1cVodCloudMigrateJobSourceInfo\x12\x0e\n\x06Vendor\x18\x01 \x01(\t\x12\x10\n\x08SourceAK\x18\x02 \x01(\t\x12\x10\n\x08SourceSK\x18\x03 \x01(\t\x12\x14\n\x0cSourceDomain\x18\x04 \x01(\t\x12\x17\n\x0fSourceDomainKey\x18\x05 \x01(\t\",\n\x1bVodSetCloudMigrateJobResult\x12\r\n\x05JobId\x18\x01 \x01(\x03\"\x9a\x01\n\x1bVodGetCloudMigrateJobResult\x12\r\n\x05JobId\x18\x01 \x01(\x03\x12S\n\rJobSourceInfo\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodCloudMigrateJobSourceInfo\x12\x17\n\x0f\x43\x61llbackAddress\x18\x03 \x01(\tB\xce\x01\n)com.volcengine.service.vod.model.businessB\nVodMigrateP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODCLOUDMIGRATEJOBSOURCEINFO = DESCRIPTOR.message_types_by_name['VodCloudMigrateJobSourceInfo'] _VODSETCLOUDMIGRATEJOBRESULT = DESCRIPTOR.message_types_by_name['VodSetCloudMigrateJobResult'] _VODGETCLOUDMIGRATEJOBRESULT = DESCRIPTOR.message_types_by_name['VodGetCloudMigrateJobResult'] VodCloudMigrateJobSourceInfo = _reflection.GeneratedProtocolMessageType('VodCloudMigrateJobSourceInfo', (_message.Message,), { 'DESCRIPTOR' : _VODCLOUDMIGRATEJOBSOURCEINFO, '__module__' : 'volcengine.vod.business.vod_migrate_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCloudMigrateJobSourceInfo) }) _sym_db.RegisterMessage(VodCloudMigrateJobSourceInfo) VodSetCloudMigrateJobResult = _reflection.GeneratedProtocolMessageType('VodSetCloudMigrateJobResult', (_message.Message,), { 'DESCRIPTOR' : _VODSETCLOUDMIGRATEJOBRESULT, '__module__' : 'volcengine.vod.business.vod_migrate_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSetCloudMigrateJobResult) }) _sym_db.RegisterMessage(VodSetCloudMigrateJobResult) VodGetCloudMigrateJobResult = _reflection.GeneratedProtocolMessageType('VodGetCloudMigrateJobResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETCLOUDMIGRATEJOBRESULT, '__module__' : 'volcengine.vod.business.vod_migrate_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetCloudMigrateJobResult) }) _sym_db.RegisterMessage(VodGetCloudMigrateJobResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\nVodMigrateP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODCLOUDMIGRATEJOBSOURCEINFO._serialized_start=78 _VODCLOUDMIGRATEJOBSOURCEINFO._serialized_end=207 _VODSETCLOUDMIGRATEJOBRESULT._serialized_start=209 _VODSETCLOUDMIGRATEJOBRESULT._serialized_end=253 _VODGETCLOUDMIGRATEJOBRESULT._serialized_start=256 _VODGETCLOUDMIGRATEJOBRESULT._serialized_end=410 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_object_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_object.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(volcengine/vod/business/vod_object.proto\x12\x1eVolcengine.Vod.Models.Business\"\x80\x01\n\x1fVodSubmitBlockObjectTasksResult\x12\x11\n\tOperation\x18\x01 \x01(\t\x12J\n\x10OperateFileNames\x18\x02 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.OperateFileNames\"\xa9\x01\n\x10OperateFileNames\x12J\n\x10SuccessFileNames\x18\x01 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.FileNameTaskInfo\x12I\n\x0f\x46\x61iledFileNames\x18\x02 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.FileNameTaskInfo\"E\n\x10\x46ileNameTaskInfo\x12\x10\n\x08\x46ileName\x18\x01 \x01(\t\x12\x0f\n\x07Message\x18\x02 \x01(\t\x12\x0e\n\x06TaskId\x18\x03 \x01(\t\"r\n\x1dVodListBlockObjectTasksResult\x12Q\n\x14ObjectBlockTaskInfos\x18\x01 \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.ObjectBlockTaskInfo\"\xcb\x01\n\x13ObjectBlockTaskInfo\x12\x0e\n\x06Status\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\x12\x10\n\x08\x46ileName\x18\x03 \x01(\t\x12\x15\n\rRefreshStatus\x18\x04 \x01(\t\x12\x11\n\tOperation\x18\x05 \x01(\t\x12\x15\n\rRefreshTaskId\x18\x06 \x01(\t\x12\x41\n\x0cRefreshInfos\x18\x07 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.RefreshInfo\";\n\x0bRefreshInfo\x12\x0b\n\x03Url\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\x12\x0f\n\x07Process\x18\x03 \x01(\tB\xcd\x01\n)com.volcengine.service.vod.model.businessB\tVodObjectP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODSUBMITBLOCKOBJECTTASKSRESULT = DESCRIPTOR.message_types_by_name['VodSubmitBlockObjectTasksResult'] _OPERATEFILENAMES = DESCRIPTOR.message_types_by_name['OperateFileNames'] _FILENAMETASKINFO = DESCRIPTOR.message_types_by_name['FileNameTaskInfo'] _VODLISTBLOCKOBJECTTASKSRESULT = DESCRIPTOR.message_types_by_name['VodListBlockObjectTasksResult'] _OBJECTBLOCKTASKINFO = DESCRIPTOR.message_types_by_name['ObjectBlockTaskInfo'] _REFRESHINFO = DESCRIPTOR.message_types_by_name['RefreshInfo'] VodSubmitBlockObjectTasksResult = _reflection.GeneratedProtocolMessageType('VodSubmitBlockObjectTasksResult', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKOBJECTTASKSRESULT, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubmitBlockObjectTasksResult) }) _sym_db.RegisterMessage(VodSubmitBlockObjectTasksResult) OperateFileNames = _reflection.GeneratedProtocolMessageType('OperateFileNames', (_message.Message,), { 'DESCRIPTOR' : _OPERATEFILENAMES, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.OperateFileNames) }) _sym_db.RegisterMessage(OperateFileNames) FileNameTaskInfo = _reflection.GeneratedProtocolMessageType('FileNameTaskInfo', (_message.Message,), { 'DESCRIPTOR' : _FILENAMETASKINFO, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.FileNameTaskInfo) }) _sym_db.RegisterMessage(FileNameTaskInfo) VodListBlockObjectTasksResult = _reflection.GeneratedProtocolMessageType('VodListBlockObjectTasksResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTBLOCKOBJECTTASKSRESULT, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListBlockObjectTasksResult) }) _sym_db.RegisterMessage(VodListBlockObjectTasksResult) ObjectBlockTaskInfo = _reflection.GeneratedProtocolMessageType('ObjectBlockTaskInfo', (_message.Message,), { 'DESCRIPTOR' : _OBJECTBLOCKTASKINFO, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ObjectBlockTaskInfo) }) _sym_db.RegisterMessage(ObjectBlockTaskInfo) RefreshInfo = _reflection.GeneratedProtocolMessageType('RefreshInfo', (_message.Message,), { 'DESCRIPTOR' : _REFRESHINFO, '__module__' : 'volcengine.vod.business.vod_object_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.RefreshInfo) }) _sym_db.RegisterMessage(RefreshInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\tVodObjectP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODSUBMITBLOCKOBJECTTASKSRESULT._serialized_start=77 _VODSUBMITBLOCKOBJECTTASKSRESULT._serialized_end=205 _OPERATEFILENAMES._serialized_start=208 _OPERATEFILENAMES._serialized_end=377 _FILENAMETASKINFO._serialized_start=379 _FILENAMETASKINFO._serialized_end=448 _VODLISTBLOCKOBJECTTASKSRESULT._serialized_start=450 _VODLISTBLOCKOBJECTTASKSRESULT._serialized_end=564 _OBJECTBLOCKTASKINFO._serialized_start=567 _OBJECTBLOCKTASKINFO._serialized_end=770 _REFRESHINFO._serialized_start=772 _REFRESHINFO._serialized_end=831 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_play_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_play.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&volcengine/vod/business/vod_play.proto\x12\x1eVolcengine.Vod.Models.Business\"\xd8\x01\n\x1cVodGetOriginalPlayInfoResult\x12\x10\n\x08\x46ileType\x18\x01 \x01(\t\x12\x10\n\x08\x44uration\x18\x02 \x01(\x02\x12\x0c\n\x04Size\x18\x03 \x01(\x01\x12\x0e\n\x06Height\x18\x04 \x01(\x05\x12\r\n\x05Width\x18\x05 \x01(\x05\x12\x0e\n\x06\x46ormat\x18\x06 \x01(\t\x12\r\n\x05\x43odec\x18\x07 \x01(\t\x12\x0f\n\x07\x42itrate\x18\x08 \x01(\x05\x12\x0b\n\x03Md5\x18\t \x01(\t\x12\x13\n\x0bMainPlayUrl\x18\n \x01(\t\x12\x15\n\rBackupPlayUrl\x18\x0b \x01(\t\"g\n\x19VodPrivateDrmPlayAuthInfo\x12\x12\n\nPlayAuthId\x18\x01 \x01(\t\x12\x17\n\x0fPlayAuthContent\x18\x02 \x01(\t\x12\x1d\n\x15PlayAuthContentFormat\x18\x03 \x01(\t\"u\n\x1eVodGetPrivateDrmPlayAuthResult\x12S\n\x10PlayAuthInfoList\x18\x01 \x03(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodPrivateDrmPlayAuthInfo\"V\n\x1cVodGetHlsDecryptionKeyResult\x12\x11\n\tSecretKey\x18\x01 \x01(\t\x12\x10\n\x08IsBase64\x18\x02 \x01(\x08\x12\x11\n\tKeyFormat\x18\x03 \x01(\t\"t\n!VodPlayInfoWithLiveTimeShiftScene\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x13\n\x0bMainPlayUrl\x18\x02 \x01(\t\x12\x15\n\rBackupPlayUrl\x18\x03 \x01(\t\x12\x11\n\tUrlExpire\x18\x04 \x01(\x01\"\x85\x01\n*VodGetPlayInfoWithLiveTimeShiftSceneResult\x12W\n\x0cPlayInfoList\x18\x01 \x03(\x0b\x32\x41.Volcengine.Vod.Models.Business.VodPlayInfoWithLiveTimeShiftScene\"a\n\x1bVodDescribeDrmDataKeyResult\x12\x11\n\tSecretKey\x18\x01 \x01(\t\x12\n\n\x02\x41k\x18\x02 \x01(\t\x12\x10\n\x08IsBase64\x18\x03 \x01(\x08\x12\x11\n\tKeyFormat\x18\x04 \x01(\t\"e\n\x1fVodCreateHlsDecryptionKeyResult\x12\x11\n\tSecretKey\x18\x01 \x01(\t\x12\n\n\x02\x41k\x18\x02 \x01(\t\x12\x10\n\x08IsBase64\x18\x03 \x01(\x08\x12\x11\n\tKeyFormat\x18\x04 \x01(\tB\xcb\x01\n)com.volcengine.service.vod.model.businessB\x07VodPlayP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODGETORIGINALPLAYINFORESULT = DESCRIPTOR.message_types_by_name['VodGetOriginalPlayInfoResult'] _VODPRIVATEDRMPLAYAUTHINFO = DESCRIPTOR.message_types_by_name['VodPrivateDrmPlayAuthInfo'] _VODGETPRIVATEDRMPLAYAUTHRESULT = DESCRIPTOR.message_types_by_name['VodGetPrivateDrmPlayAuthResult'] _VODGETHLSDECRYPTIONKEYRESULT = DESCRIPTOR.message_types_by_name['VodGetHlsDecryptionKeyResult'] _VODPLAYINFOWITHLIVETIMESHIFTSCENE = DESCRIPTOR.message_types_by_name['VodPlayInfoWithLiveTimeShiftScene'] _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESULT = DESCRIPTOR.message_types_by_name['VodGetPlayInfoWithLiveTimeShiftSceneResult'] _VODDESCRIBEDRMDATAKEYRESULT = DESCRIPTOR.message_types_by_name['VodDescribeDrmDataKeyResult'] _VODCREATEHLSDECRYPTIONKEYRESULT = DESCRIPTOR.message_types_by_name['VodCreateHlsDecryptionKeyResult'] VodGetOriginalPlayInfoResult = _reflection.GeneratedProtocolMessageType('VodGetOriginalPlayInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETORIGINALPLAYINFORESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetOriginalPlayInfoResult) }) _sym_db.RegisterMessage(VodGetOriginalPlayInfoResult) VodPrivateDrmPlayAuthInfo = _reflection.GeneratedProtocolMessageType('VodPrivateDrmPlayAuthInfo', (_message.Message,), { 'DESCRIPTOR' : _VODPRIVATEDRMPLAYAUTHINFO, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPrivateDrmPlayAuthInfo) }) _sym_db.RegisterMessage(VodPrivateDrmPlayAuthInfo) VodGetPrivateDrmPlayAuthResult = _reflection.GeneratedProtocolMessageType('VodGetPrivateDrmPlayAuthResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETPRIVATEDRMPLAYAUTHRESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetPrivateDrmPlayAuthResult) }) _sym_db.RegisterMessage(VodGetPrivateDrmPlayAuthResult) VodGetHlsDecryptionKeyResult = _reflection.GeneratedProtocolMessageType('VodGetHlsDecryptionKeyResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETHLSDECRYPTIONKEYRESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetHlsDecryptionKeyResult) }) _sym_db.RegisterMessage(VodGetHlsDecryptionKeyResult) VodPlayInfoWithLiveTimeShiftScene = _reflection.GeneratedProtocolMessageType('VodPlayInfoWithLiveTimeShiftScene', (_message.Message,), { 'DESCRIPTOR' : _VODPLAYINFOWITHLIVETIMESHIFTSCENE, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodPlayInfoWithLiveTimeShiftScene) }) _sym_db.RegisterMessage(VodPlayInfoWithLiveTimeShiftScene) VodGetPlayInfoWithLiveTimeShiftSceneResult = _reflection.GeneratedProtocolMessageType('VodGetPlayInfoWithLiveTimeShiftSceneResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetPlayInfoWithLiveTimeShiftSceneResult) }) _sym_db.RegisterMessage(VodGetPlayInfoWithLiveTimeShiftSceneResult) VodDescribeDrmDataKeyResult = _reflection.GeneratedProtocolMessageType('VodDescribeDrmDataKeyResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDRMDATAKEYRESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeDrmDataKeyResult) }) _sym_db.RegisterMessage(VodDescribeDrmDataKeyResult) VodCreateHlsDecryptionKeyResult = _reflection.GeneratedProtocolMessageType('VodCreateHlsDecryptionKeyResult', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEHLSDECRYPTIONKEYRESULT, '__module__' : 'volcengine.vod.business.vod_play_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCreateHlsDecryptionKeyResult) }) _sym_db.RegisterMessage(VodCreateHlsDecryptionKeyResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\007VodPlayP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODGETORIGINALPLAYINFORESULT._serialized_start=75 _VODGETORIGINALPLAYINFORESULT._serialized_end=291 _VODPRIVATEDRMPLAYAUTHINFO._serialized_start=293 _VODPRIVATEDRMPLAYAUTHINFO._serialized_end=396 _VODGETPRIVATEDRMPLAYAUTHRESULT._serialized_start=398 _VODGETPRIVATEDRMPLAYAUTHRESULT._serialized_end=515 _VODGETHLSDECRYPTIONKEYRESULT._serialized_start=517 _VODGETHLSDECRYPTIONKEYRESULT._serialized_end=603 _VODPLAYINFOWITHLIVETIMESHIFTSCENE._serialized_start=605 _VODPLAYINFOWITHLIVETIMESHIFTSCENE._serialized_end=721 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESULT._serialized_start=724 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESULT._serialized_end=857 _VODDESCRIBEDRMDATAKEYRESULT._serialized_start=859 _VODDESCRIBEDRMDATAKEYRESULT._serialized_end=956 _VODCREATEHLSDECRYPTIONKEYRESULT._serialized_start=958 _VODCREATEHLSDECRYPTIONKEYRESULT._serialized_end=1059 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_project_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_project.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)volcengine/vod/business/vod_project.proto\x12\x1eVolcengine.Vod.Models.Business\"\\\n\x15VodListProjectsResult\x12\x43\n\x0bProjectList\x18\x01 \x03(\x0b\x32..Volcengine.Vod.Models.Business.VodProjectInfo\":\n\x0eVodProjectInfo\x12\x13\n\x0bProjectName\x18\x01 \x01(\t\x12\x13\n\x0b\x44isplayName\x18\x02 \x01(\tB\xce\x01\n)com.volcengine.service.vod.model.businessB\nVodProjectP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODLISTPROJECTSRESULT = DESCRIPTOR.message_types_by_name['VodListProjectsResult'] _VODPROJECTINFO = DESCRIPTOR.message_types_by_name['VodProjectInfo'] VodListProjectsResult = _reflection.GeneratedProtocolMessageType('VodListProjectsResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTPROJECTSRESULT, '__module__' : 'volcengine.vod.business.vod_project_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListProjectsResult) }) _sym_db.RegisterMessage(VodListProjectsResult) VodProjectInfo = _reflection.GeneratedProtocolMessageType('VodProjectInfo', (_message.Message,), { 'DESCRIPTOR' : _VODPROJECTINFO, '__module__' : 'volcengine.vod.business.vod_project_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodProjectInfo) }) _sym_db.RegisterMessage(VodProjectInfo) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\nVodProjectP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODLISTPROJECTSRESULT._serialized_start=77 _VODLISTPROJECTSRESULT._serialized_end=169 _VODPROJECTINFO._serialized_start=171 _VODPROJECTINFO._serialized_end=229 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_reporter_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_reporter.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*volcengine/vod/business/vod_reporter.proto\x12\x1eVolcengine.Vod.Models.Business\"X\n\x14VodReportEventResult\x12@\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodReportEventData\"\x14\n\x12VodReportEventDataB\xcf\x01\n)com.volcengine.service.vod.model.businessB\x0bVodReporterP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODREPORTEVENTRESULT = DESCRIPTOR.message_types_by_name['VodReportEventResult'] _VODREPORTEVENTDATA = DESCRIPTOR.message_types_by_name['VodReportEventData'] VodReportEventResult = _reflection.GeneratedProtocolMessageType('VodReportEventResult', (_message.Message,), { 'DESCRIPTOR' : _VODREPORTEVENTRESULT, '__module__' : 'volcengine.vod.business.vod_reporter_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodReportEventResult) }) _sym_db.RegisterMessage(VodReportEventResult) VodReportEventData = _reflection.GeneratedProtocolMessageType('VodReportEventData', (_message.Message,), { 'DESCRIPTOR' : _VODREPORTEVENTDATA, '__module__' : 'volcengine.vod.business.vod_reporter_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodReportEventData) }) _sym_db.RegisterMessage(VodReportEventData) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\013VodReporterP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODREPORTEVENTRESULT._serialized_start=78 _VODREPORTEVENTRESULT._serialized_end=166 _VODREPORTEVENTDATA._serialized_start=168 _VODREPORTEVENTDATA._serialized_end=188 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_smart_strategy_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_smart_strategy.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0volcengine/vod/business/vod_smart_strategy.proto\x12\x1eVolcengine.Vod.Models.Business\x1a(volcengine/vod/business/vod_common.proto\"\xbb\x02\n%VodGetSmartStrategyLitePlayInfoResult\x12V\n\nStreamType\x18\x01 \x01(\x0e\x32\x42.Volcengine.Vod.Models.Business.VodSmartStrategyResponseStreamType\x12X\n\x0f\x44\x61taStoreStatus\x18\x02 \x01(\x0e\x32?.Volcengine.Vod.Models.Business.VodSmartStrategyDataStoreStatus\x12G\n\rPlayInfoModel\x18\x03 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodPlayInfoModel\x12\x17\n\x0fOriginalPlayUrl\x18\x04 \x01(\t*\x83\x02\n\"VodSmartStrategyResponseStreamType\x12/\n+UndefinedVodSmartStrategyResponseStreamType\x10\x00\x12\x34\n0OriginalStreamVodSmartStrategyResponseStreamType\x10\x01\x12:\n6StrategyEncodeStreamVodSmartStrategyResponseStreamType\x10\x02\x12:\n6FallbackEncodeStreamVodSmartStrategyResponseStreamType\x10\x03*\xe6\x01\n\x1fVodSmartStrategyDataStoreStatus\x12,\n(UndefinedVodSmartStrategyDataStoreStatus\x10\x00\x12+\n\'NotExistVodSmartStrategyDataStoreStatus\x10\x01\x12\x34\n0HasOriginalStreamVodSmartStrategyDataStoreStatus\x10\x02\x12\x32\n.HasEncodeStreamVodSmartStrategyDataStoreStatus\x10\x03\x42\xd4\x01\n)com.volcengine.service.vod.model.businessB\x10VodSmartStrategyP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODSMARTSTRATEGYRESPONSESTREAMTYPE = DESCRIPTOR.enum_types_by_name['VodSmartStrategyResponseStreamType'] VodSmartStrategyResponseStreamType = enum_type_wrapper.EnumTypeWrapper(_VODSMARTSTRATEGYRESPONSESTREAMTYPE) _VODSMARTSTRATEGYDATASTORESTATUS = DESCRIPTOR.enum_types_by_name['VodSmartStrategyDataStoreStatus'] VodSmartStrategyDataStoreStatus = enum_type_wrapper.EnumTypeWrapper(_VODSMARTSTRATEGYDATASTORESTATUS) UndefinedVodSmartStrategyResponseStreamType = 0 OriginalStreamVodSmartStrategyResponseStreamType = 1 StrategyEncodeStreamVodSmartStrategyResponseStreamType = 2 FallbackEncodeStreamVodSmartStrategyResponseStreamType = 3 UndefinedVodSmartStrategyDataStoreStatus = 0 NotExistVodSmartStrategyDataStoreStatus = 1 HasOriginalStreamVodSmartStrategyDataStoreStatus = 2 HasEncodeStreamVodSmartStrategyDataStoreStatus = 3 _VODGETSMARTSTRATEGYLITEPLAYINFORESULT = DESCRIPTOR.message_types_by_name['VodGetSmartStrategyLitePlayInfoResult'] VodGetSmartStrategyLitePlayInfoResult = _reflection.GeneratedProtocolMessageType('VodGetSmartStrategyLitePlayInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETSMARTSTRATEGYLITEPLAYINFORESULT, '__module__' : 'volcengine.vod.business.vod_smart_strategy_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetSmartStrategyLitePlayInfoResult) }) _sym_db.RegisterMessage(VodGetSmartStrategyLitePlayInfoResult) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\020VodSmartStrategyP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODSMARTSTRATEGYRESPONSESTREAMTYPE._serialized_start=445 _VODSMARTSTRATEGYRESPONSESTREAMTYPE._serialized_end=704 _VODSMARTSTRATEGYDATASTORESTATUS._serialized_start=707 _VODSMARTSTRATEGYDATASTORESTATUS._serialized_end=937 _VODGETSMARTSTRATEGYLITEPLAYINFORESULT._serialized_start=127 _VODGETSMARTSTRATEGYLITEPLAYINFORESULT._serialized_end=442 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_space_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_space.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'volcengine/vod/business/vod_space.proto\x12\x1eVolcengine.Vod.Models.Business\"\xe7\x01\n\x0cVodSpaceInfo\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06Region\x18\x03 \x01(\t\x12\x13\n\x0bProjectName\x18\x04 \x01(\t\x12\x12\n\nBucketName\x18\x05 \x01(\t\x12\x14\n\x0c\x42ucketStatus\x18\x06 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x07 \x01(\t\x12\x10\n\x08UserName\x18\x08 \x01(\t\x12\x11\n\tCreatedAt\x18\t \x01(\t\x12\x0c\n\x04Type\x18\n \x01(\t\x12\x16\n\x0eMediaSyncLevel\x18\x0b \x01(\t\x12\x15\n\rCanUseArchive\x18\x0c \x01(\x08\"/\n\x0eVodStorageData\x12\x0c\n\x04Time\x18\x01 \x01(\t\x12\x0f\n\x07Storage\x18\x02 \x01(\x03\"\xf8\x01\n$VodDescribeVodSpaceStorageDataResult\x12\x11\n\tSpaceList\x18\x01 \x03(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x04 \x01(\x05\x12\x0c\n\x04Type\x18\x05 \x01(\t\x12\x12\n\nRegionList\x18\x06 \x03(\t\x12\x19\n\x11LatestStorageData\x18\x07 \x01(\x03\x12G\n\x0fStorageDataList\x18\x08 \x03(\x0b\x32..Volcengine.Vod.Models.Business.VodStorageData\"\xe6\x03\n\x14VodUploadSpaceConfig\x12\x12\n\nAutoPoster\x18\x01 \x01(\t\x12N\n\x12\x43ustomPosterConfig\x18\x02 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.CustomPosterConfig\x12\x15\n\rGetPosterMode\x18\x03 \x01(\t\x12\x1b\n\x13\x41utoPosterCandidate\x18\x04 \x01(\t\x12\x15\n\rAutoTranscode\x18\x05 \x01(\t\x12H\n\x0fTranscodeConfig\x18\x06 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.TranscodeConfig\x12\x1a\n\x12\x41utoSetVideoStatus\x18\x07 \x01(\t\x12\x17\n\x0fUploadOverwrite\x18\x08 \x01(\t\x12\x1d\n\x15\x43\x61llbackReturnPlayUrl\x18\t \x01(\t\x12\x1b\n\x13\x43\x61llbackReturnRunId\x18\n \x01(\t\x12\x13\n\x0bGetMetaMode\x18\x0b \x01(\t\x12\x1f\n\x17\x41utoGetArchiveVideoMeta\x18\x0c \x01(\t\x12\x1a\n\x12\x41utoGetIAVideoMeta\x18\r \x01(\t\x12\x12\n\nMetaGetMd5\x18\x0e \x01(\t\"H\n\x12\x43ustomPosterConfig\x12\x1c\n\x14\x43ustomTemplateStatus\x18\x01 \x01(\t\x12\x14\n\x0cPathTemplate\x18\x02 \x01(\t\"K\n\x0fTranscodeConfig\x12\x1d\n\x15\x44\x65\x66\x61ultTemplateStatus\x18\x01 \x01(\t\x12\x19\n\x11\x44\x65\x66\x61ultTemplateId\x18\x02 \x01(\t*\xa3\x01\n\x17VodSpaceUploadConfigKey\x12$\n UndefinedVodSpaceUploadConfigKey\x10\x00\x12/\n+CustomUploadFilePathVodSpaceUploadConfigKey\x10\x01\x12\x31\n-AutoPublishAfterUploadVodSpaceUploadConfigKey\x10\x02\x42\xcc\x01\n)com.volcengine.service.vod.model.businessB\x08VodSpaceP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODSPACEUPLOADCONFIGKEY = DESCRIPTOR.enum_types_by_name['VodSpaceUploadConfigKey'] VodSpaceUploadConfigKey = enum_type_wrapper.EnumTypeWrapper(_VODSPACEUPLOADCONFIGKEY) UndefinedVodSpaceUploadConfigKey = 0 CustomUploadFilePathVodSpaceUploadConfigKey = 1 AutoPublishAfterUploadVodSpaceUploadConfigKey = 2 _VODSPACEINFO = DESCRIPTOR.message_types_by_name['VodSpaceInfo'] _VODSTORAGEDATA = DESCRIPTOR.message_types_by_name['VodStorageData'] _VODDESCRIBEVODSPACESTORAGEDATARESULT = DESCRIPTOR.message_types_by_name['VodDescribeVodSpaceStorageDataResult'] _VODUPLOADSPACECONFIG = DESCRIPTOR.message_types_by_name['VodUploadSpaceConfig'] _CUSTOMPOSTERCONFIG = DESCRIPTOR.message_types_by_name['CustomPosterConfig'] _TRANSCODECONFIG = DESCRIPTOR.message_types_by_name['TranscodeConfig'] VodSpaceInfo = _reflection.GeneratedProtocolMessageType('VodSpaceInfo', (_message.Message,), { 'DESCRIPTOR' : _VODSPACEINFO, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSpaceInfo) }) _sym_db.RegisterMessage(VodSpaceInfo) VodStorageData = _reflection.GeneratedProtocolMessageType('VodStorageData', (_message.Message,), { 'DESCRIPTOR' : _VODSTORAGEDATA, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodStorageData) }) _sym_db.RegisterMessage(VodStorageData) VodDescribeVodSpaceStorageDataResult = _reflection.GeneratedProtocolMessageType('VodDescribeVodSpaceStorageDataResult', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODSPACESTORAGEDATARESULT, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodDescribeVodSpaceStorageDataResult) }) _sym_db.RegisterMessage(VodDescribeVodSpaceStorageDataResult) VodUploadSpaceConfig = _reflection.GeneratedProtocolMessageType('VodUploadSpaceConfig', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADSPACECONFIG, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadSpaceConfig) }) _sym_db.RegisterMessage(VodUploadSpaceConfig) CustomPosterConfig = _reflection.GeneratedProtocolMessageType('CustomPosterConfig', (_message.Message,), { 'DESCRIPTOR' : _CUSTOMPOSTERCONFIG, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CustomPosterConfig) }) _sym_db.RegisterMessage(CustomPosterConfig) TranscodeConfig = _reflection.GeneratedProtocolMessageType('TranscodeConfig', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODECONFIG, '__module__' : 'volcengine.vod.business.vod_space_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeConfig) }) _sym_db.RegisterMessage(TranscodeConfig) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\010VodSpaceP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODSPACEUPLOADCONFIGKEY._serialized_start=1250 _VODSPACEUPLOADCONFIGKEY._serialized_end=1413 _VODSPACEINFO._serialized_start=76 _VODSPACEINFO._serialized_end=307 _VODSTORAGEDATA._serialized_start=309 _VODSTORAGEDATA._serialized_end=356 _VODDESCRIBEVODSPACESTORAGEDATARESULT._serialized_start=359 _VODDESCRIBEVODSPACESTORAGEDATARESULT._serialized_end=607 _VODUPLOADSPACECONFIG._serialized_start=610 _VODUPLOADSPACECONFIG._serialized_end=1096 _CUSTOMPOSTERCONFIG._serialized_start=1098 _CUSTOMPOSTERCONFIG._serialized_end=1170 _TRANSCODECONFIG._serialized_start=1172 _TRANSCODECONFIG._serialized_end=1247 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_trade_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_trade.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'volcengine/vod/business/vod_trade.proto\x12\x1eVolcengine.Vod.Models.Business\"\x9b\x01\n\x1cTradeConfigurationInfoResult\x12;\n\x05\x42\x61sic\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.TradeProduct\x12>\n\x08\x41\x64\x64ition\x18\x02 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.TradeProduct\"\xbe\x02\n\x0cTradeProduct\x12\x15\n\rConfiguration\x18\x01 \x01(\t\x12\x19\n\x11\x43onfigurationName\x18\x02 \x01(\t\x12\x0f\n\x07Product\x18\x03 \x01(\t\x12\x18\n\x10SettlementPeriod\x18\x04 \x01(\x05\x12\x11\n\tCanPrePay\x18\x05 \x01(\x05\x12?\n\x0b\x43hargeItems\x18\x06 \x03(\x0b\x32*.Volcengine.Vod.Models.Business.ChargeItem\x12\x12\n\nInstanceID\x18\x07 \x01(\t\x12\x16\n\x0eInstanceStatus\x18\x08 \x01(\x05\x12\x1a\n\x12InstanceCreateTime\x18\t \x01(\t\x12\x1e\n\x16NextEventEffectiveTime\x18\n \x01(\t\x12\x15\n\rNextEventType\x18\x0b \x01(\t\"3\n\nChargeItem\x12\x16\n\x0e\x43hargeItemCode\x18\x01 \x01(\t\x12\r\n\x05Price\x18\x02 \x01(\x01\x42\xcc\x01\n)com.volcengine.service.vod.model.businessB\x08VodTradeP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _TRADECONFIGURATIONINFORESULT = DESCRIPTOR.message_types_by_name['TradeConfigurationInfoResult'] _TRADEPRODUCT = DESCRIPTOR.message_types_by_name['TradeProduct'] _CHARGEITEM = DESCRIPTOR.message_types_by_name['ChargeItem'] TradeConfigurationInfoResult = _reflection.GeneratedProtocolMessageType('TradeConfigurationInfoResult', (_message.Message,), { 'DESCRIPTOR' : _TRADECONFIGURATIONINFORESULT, '__module__' : 'volcengine.vod.business.vod_trade_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TradeConfigurationInfoResult) }) _sym_db.RegisterMessage(TradeConfigurationInfoResult) TradeProduct = _reflection.GeneratedProtocolMessageType('TradeProduct', (_message.Message,), { 'DESCRIPTOR' : _TRADEPRODUCT, '__module__' : 'volcengine.vod.business.vod_trade_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TradeProduct) }) _sym_db.RegisterMessage(TradeProduct) ChargeItem = _reflection.GeneratedProtocolMessageType('ChargeItem', (_message.Message,), { 'DESCRIPTOR' : _CHARGEITEM, '__module__' : 'volcengine.vod.business.vod_trade_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ChargeItem) }) _sym_db.RegisterMessage(ChargeItem) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\010VodTradeP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _TRADECONFIGURATIONINFORESULT._serialized_start=76 _TRADECONFIGURATIONINFORESULT._serialized_end=231 _TRADEPRODUCT._serialized_start=234 _TRADEPRODUCT._serialized_end=552 _CHARGEITEM._serialized_start=554 _CHARGEITEM._serialized_end=605 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_upload_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_upload.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(volcengine/vod/business/vod_upload.proto\x12\x1eVolcengine.Vod.Models.Business\x1a(volcengine/vod/business/vod_common.proto\"\xad\x05\n\x12VodUrlUploadURLSet\x12\x11\n\tSourceUrl\x18\x01 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x02 \x01(\t\x12\x0b\n\x03Md5\x18\x03 \x01(\t\x12\x12\n\nTemplateId\x18\x04 \x01(\t\x12\r\n\x05Title\x18\x05 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x06 \x01(\t\x12\x0c\n\x04Tags\x18\x07 \x01(\t\x12\x10\n\x08\x43\x61tegory\x18\x08 \x01(\t\x12\x10\n\x08\x46ileName\x18\t \x01(\t\x12\x18\n\x10\x43lassificationId\x18\n \x01(\x03\x12\x14\n\x0cStorageClass\x18\x0b \x01(\x05\x12\x15\n\rFileExtension\x18\x0c \x01(\t\x12\x1e\n\x16UrlEncryptionAlgorithm\x18\r \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x0e \x01(\x08\x12\x62\n\x10\x43ustomURLHeaders\x18\x0f \x03(\x0b\x32H.Volcengine.Vod.Models.Business.VodUrlUploadURLSet.CustomURLHeadersEntry\x12\x44\n\tTemplates\x18\x10 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodUploadTemplate\x12\x10\n\x08\x46ileType\x18\x11 \x01(\t\x12>\n\x08ImageSet\x18\x12 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodImageFile\x12@\n\nExecutions\x18\x13 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodExecution\x1a\x37\n\x15\x43ustomURLHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"-\n\x0cVodImageFile\x12\x0b\n\x03Url\x18\x01 \x01(\t\x12\x10\n\x08\x46ileName\x18\x02 \x01(\t\"\x9e\x01\n\x0cVodExecution\x12H\n\tOperation\x18\x01 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodExecutionOperation\x12\x44\n\x07\x43ontrol\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodExecutionControl\"n\n\x15VodExecutionOperation\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12G\n\x04Task\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodExecutionOperationTask\"\xbf\x01\n\x19VodExecutionOperationTask\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12I\n\x03Ocr\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodExecutionOperationTaskOcr\x12I\n\x03\x41sr\x18\x03 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodExecutionOperationTaskAsr\"B\n\x1cVodExecutionOperationTaskOcr\x12\x14\n\x0cWithImageSet\x18\x01 \x01(\x08\x12\x0c\n\x04Mode\x18\x02 \x01(\t\"}\n\x1cVodExecutionOperationTaskAsr\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12\x10\n\x08Language\x18\x02 \x01(\t\x12\x17\n\x0fWithSpeakerInfo\x18\x03 \x01(\t\x12\x16\n\x0eWithConfidence\x18\x04 \x01(\t\x12\x0c\n\x04Mode\x18\x05 \x01(\t\"@\n\x13VodExecutionControl\x12\x14\n\x0c\x43\x61llbackArgs\x18\x01 \x01(\t\x12\x13\n\x0b\x43lientToken\x18\x02 \x01(\t\"M\n\x12VodUrlResponseData\x12\x37\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32).Volcengine.Vod.Models.Business.ValuePair\"@\n\tValuePair\x12\r\n\x05JobId\x18\x01 \x01(\t\x12\x11\n\tSourceUrl\x18\x02 \x01(\t\x12\x11\n\tImageUrls\x18\x03 \x03(\t\"R\n\x0cVodQueryData\x12\x42\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodQueryUploadResult\"p\n\x14VodQueryUploadResult\x12@\n\rMediaInfoList\x18\x01 \x03(\x0b\x32).Volcengine.Vod.Models.Business.VodURLSet\x12\x16\n\x0eNotExistJobIds\x18\x02 \x03(\t\"^\n\rVodCommitData\x12M\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.VodCommitUploadInfoResponseData\"\xa7\x01\n\x1fVodCommitUploadInfoResponseData\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x41\n\nSourceInfo\x18\x02 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x11\n\tPosterUri\x18\x03 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x04 \x01(\t\x12\x0b\n\x03Mid\x18\x05 \x01(\t\"\xdb\x01\n\tVodURLSet\x12\x11\n\tRequestId\x18\x01 \x01(\t\x12\r\n\x05JobId\x18\x02 \x01(\t\x12\x11\n\tSourceUrl\x18\x03 \x01(\t\x12\r\n\x05State\x18\x04 \x01(\t\x12\x0b\n\x03Vid\x18\x05 \x01(\t\x12\x11\n\tSpaceName\x18\x06 \x01(\t\x12\x11\n\tAccountId\x18\x07 \x01(\t\x12\x41\n\nSourceInfo\x18\x08 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x14\n\x0c\x43\x61llbackArgs\x18\t \x01(\t\"`\n\x18VodApplyUploadInfoResult\x12\x44\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodApplyUploadInfoData\"\x8f\x02\n\x16VodApplyUploadInfoData\x12G\n\rUploadAddress\x18\x01 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodUploadAddress\x12Z\n\x18\x43\x61ndidateUploadAddresses\x18\x02 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.CandidateUploadAddresses\x12P\n\x13VpcTosUploadAddress\x18\x03 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VpcTosUploadAddress\"\xc2\x01\n\x10VodUploadAddress\x12@\n\nStoreInfos\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodStoreInfo\x12\x13\n\x0bUploadHosts\x18\x02 \x03(\t\x12\x43\n\x0cUploadHeader\x18\x03 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.VodHeaderPair\x12\x12\n\nSessionKey\x18\x04 \x01(\t\"\x84\x02\n\x18\x43\x61ndidateUploadAddresses\x12J\n\x13MainUploadAddresses\x18\x01 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.UploadAddress\x12L\n\x15\x42\x61\x63kupUploadAddresses\x18\x02 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.UploadAddress\x12N\n\x17\x46\x61llbackUploadAddresses\x18\x03 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.UploadAddress\".\n\x0cVodStoreInfo\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x0c\n\x04\x41uth\x18\x02 \x01(\t\"+\n\rVodHeaderPair\x12\x0b\n\x03Key\x18\x01 \x01(\t\x12\r\n\x05Value\x18\x02 \x01(\t\"\xb1\x02\n\x13VpcTosUploadAddress\x12\x12\n\nUploadMode\x18\x01 \x01(\t\x12\x0e\n\x06PutUrl\x18\x02 \x01(\t\x12\x46\n\x0ePartUploadInfo\x18\x03 \x01(\x0b\x32..Volcengine.Vod.Models.Business.PartUploadInfo\x12]\n\rPutUrlHeaders\x18\x04 \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.VpcTosUploadAddress.PutUrlHeadersEntry\x12\x19\n\x11QuickCompleteMode\x18\x05 \x01(\t\x1a\x34\n\x12PutUrlHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xef\x01\n\x0ePartUploadInfo\x12\x10\n\x08PartSize\x18\x01 \x01(\x03\x12\x13\n\x0bPartPutUrls\x18\x02 \x03(\t\x12\x17\n\x0f\x43ompletePartUrl\x18\x03 \x01(\t\x12\x62\n\x12\x43ompleteUrlHeaders\x18\x04 \x03(\x0b\x32\x46.Volcengine.Vod.Models.Business.PartUploadInfo.CompleteUrlHeadersEntry\x1a\x39\n\x17\x43ompleteUrlHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"b\n\x19VodCommitUploadInfoResult\x12\x45\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodCommitUploadInfoData\"\x89\x01\n\x17VodCommitUploadInfoData\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x11\n\tPosterUri\x18\x02 \x01(\t\x12\x41\n\nSourceInfo\x18\x03 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x0b\n\x03Mid\x18\x04 \x01(\t\"\xbc\x03\n\x16VodUploadFunctionInput\x12\x14\n\x0cSnapshotTime\x18\x01 \x01(\x01\x12\r\n\x05Title\x18\x02 \x01(\t\x12\x0c\n\x04Tags\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\x12\x10\n\x08\x43\x61tegory\x18\x05 \x01(\t\x12\x12\n\nRecordType\x18\x06 \x01(\x05\x12\x0e\n\x06\x46ormat\x18\x07 \x01(\t\x12\x18\n\x10\x43lassificationId\x18\x08 \x01(\x05\x12\x12\n\nTemplateId\x18\t \x01(\t\x12\x0b\n\x03Vid\x18\n \x01(\t\x12\x0b\n\x03\x46id\x18\x0b \x01(\t\x12\x10\n\x08Language\x18\x0c \x01(\t\x12\x10\n\x08StoreUri\x18\r \x01(\t\x12\x0e\n\x06Source\x18\x0e \x01(\t\x12\x0b\n\x03Tag\x18\x0f \x01(\t\x12\x13\n\x0b\x41utoPublish\x18\x10 \x01(\x08\x12\x12\n\nActionType\x18\x11 \x01(\t\x12\x16\n\x0eIsHlsIndexOnly\x18\x12 \x01(\x08\x12\x14\n\x0cHlsMediaSize\x18\x13 \x01(\t\x12\x44\n\tTemplates\x18\x14 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodUploadTemplate\"h\n\x11VodUploadFunction\x12\x0c\n\x04Name\x18\x01 \x01(\t\x12\x45\n\x05Input\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodUploadFunctionInput\"\xc8\x01\n\x15\x43ommitUploadInfoParam\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x02 \x01(\t\x12\x12\n\nSessionKey\x18\x03 \x01(\t\x12\x44\n\tFunctions\x18\x04 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodUploadFunction\x12\x13\n\x0bGetMetaMode\x18\x05 \x01(\t\x12\x17\n\x0fVodUploadSource\x18\x06 \x01(\t\"\x95\x01\n\x15\x43ommitRequestBodyJson\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nSessionKey\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x11\n\tFunctions\x18\x04 \x01(\t\x12\x13\n\x0bGetMetaMode\x18\x05 \x01(\t\x12\x17\n\x0fVodUploadSource\x18\x06 \x01(\t\"\xb8\x02\n\x14\x41pplyUploadInfoParam\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x10\n\x08\x46ileType\x18\x02 \x01(\t\x12\x12\n\nSessionKey\x18\x03 \x01(\t\x12\x10\n\x08\x46ileSize\x18\x04 \x01(\x01\x12\x11\n\tMediaType\x18\x05 \x01(\t\x12\x0f\n\x07TosKeys\x18\x06 \x01(\t\x12\x15\n\rFileExtension\x18\x07 \x01(\t\x12\x12\n\nFilePrefix\x18\x08 \x01(\t\x12\x17\n\x0f\x46lushUploadMode\x18\t \x01(\x05\x12\x0b\n\x03Md5\x18\n \x01(\t\x12\x14\n\x0cStorageClass\x18\x0b \x01(\x05\x12\x18\n\x10UploadHostPrefer\x18\x0c \x01(\t\x12\x19\n\x11\x43lientNetWorkMode\x18\x65 \x01(\t\x12\x15\n\rClientIDCMode\x18\x66 \x01(\t\"\x96\x01\n\x0e\x43ommitResponse\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0b\n\x03Mid\x18\x02 \x01(\t\x12\x41\n\nSourceInfo\x18\x03 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x11\n\tPosterUri\x18\x04 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x05 \x01(\t\">\n\x11VodUploadTemplate\x12\x13\n\x0bTemplateIds\x18\x01 \x03(\t\x12\x14\n\x0cTemplateType\x18\x02 \x01(\t\"\x84\x01\n\x13VodUploadOptionInfo\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x13\n\x0bTemplateIds\x18\x02 \x03(\t\x12\x44\n\tTemplates\x18\x03 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodUploadTemplate\"\x98\x02\n\x15VodUploadCallbackData\x12\x0c\n\x04\x43ode\x18\x01 \x01(\t\x12\x0f\n\x07Message\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x0b\n\x03Vid\x18\x04 \x01(\t\x12\x0b\n\x03Mid\x18\x05 \x01(\t\x12\x11\n\tSpaceName\x18\x06 \x01(\t\x12\x41\n\nSourceInfo\x18\x07 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x11\n\tPosterUri\x18\x08 \x01(\t\x12G\n\nOptionInfo\x18\t \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodUploadOptionInfo\"\xa1\x01\n\x10\x43\x61llbackResponse\x12\x11\n\tRequestId\x18\x01 \x01(\t\x12\x0f\n\x07Version\x18\x02 \x01(\t\x12\x11\n\tEventTime\x18\x03 \x01(\t\x12\x11\n\tEventType\x18\x04 \x01(\t\x12\x43\n\x04\x44\x61ta\x18\x05 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodUploadCallbackData\"+\n\tStoreInfo\x12\x10\n\x08StoreUri\x18\x01 \x01(\t\x12\x0c\n\x04\x41uth\x18\x02 \x01(\t\"(\n\nHeaderPair\x12\x0b\n\x03Key\x18\x01 \x01(\t\x12\r\n\x05Value\x18\x02 \x01(\t\"\xb9\x01\n\rUploadAddress\x12=\n\nStoreInfos\x18\x01 \x03(\x0b\x32).Volcengine.Vod.Models.Business.StoreInfo\x12\x13\n\x0bUploadHosts\x18\x02 \x03(\t\x12@\n\x0cUploadHeader\x18\x03 \x03(\x0b\x32*.Volcengine.Vod.Models.Business.HeaderPair\x12\x12\n\nSessionKey\x18\x04 \x01(\t\"\xae\x01\n\x11\x46lushUploadResult\x12\x13\n\x0b\x46lushUpload\x18\x01 \x01(\x08\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x0b\n\x03Mid\x18\x03 \x01(\t\x12\x41\n\nSourceInfo\x18\x04 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodSourceInfo\x12\x11\n\tPosterUri\x18\x05 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x06 \x01(\t\"\x87\x02\n\rApplyResponse\x12\x44\n\rUploadAddress\x18\x01 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.UploadAddress\x12L\n\x11\x46lushUploadResult\x18\x02 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.FlushUploadResult\x12\x10\n\x08SDKParam\x18\x03 \x01(\t\x12P\n\x13VpcTosUploadAddress\x18\x05 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VpcTosUploadAddress\"3\n\x1aVodParseUploadManifestData\x12\x15\n\rMediaSegments\x18\x01 \x03(\t\"h\n\x1cVodParseUploadManifestResult\x12H\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodParseUploadManifestData\"\xa7\x01\n\x19SubmitMoveObjectTaskParam\x12\x13\n\x0bSourceSpace\x18\x01 \x01(\t\x12\x16\n\x0eSourceFileName\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\x12\x16\n\x0eTargetFileName\x18\x04 \x01(\t\x12\x18\n\x10SaveSourceObject\x18\x05 \x01(\x08\x12\x16\n\x0e\x46orceOverwrite\x18\x06 \x01(\x08\"m\n\x1fVodSubmitMoveObjectTaskRespData\x12J\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.SubmitMoveObjectTaskRespData\"X\n\x1cSubmitMoveObjectTaskRespData\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\x12\x13\n\x0bSourceSpace\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\"X\n\x1cQueryMoveObjectTaskInfoParam\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\x12\x13\n\x0bSourceSpace\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\"r\n!VodQueryMoveObjectTaskInfoResData\x12M\n\x04\x44\x61ta\x18\x01 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.QueryMoveObjectTaskInfoRespData\"\x81\x01\n\x1fQueryMoveObjectTaskInfoRespData\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\x12\x13\n\x0bSourceSpace\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\x12\r\n\x05State\x18\x04 \x01(\t\x12\x15\n\rTaskRunResult\x18\x05 \x01(\t*B\n\x10StorageClassType\x12\x0b\n\x07\x44\x65\x66\x61ult\x10\x00\x12\x0c\n\x08Standard\x10\x01\x12\x0b\n\x07\x41rchive\x10\x02\x12\x06\n\x02IA\x10\x03\x42\xcd\x01\n)com.volcengine.service.vod.model.businessB\tVodUploadP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xc2\x02\x00\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _STORAGECLASSTYPE = DESCRIPTOR.enum_types_by_name['StorageClassType'] StorageClassType = enum_type_wrapper.EnumTypeWrapper(_STORAGECLASSTYPE) Default = 0 Standard = 1 Archive = 2 IA = 3 _VODURLUPLOADURLSET = DESCRIPTOR.message_types_by_name['VodUrlUploadURLSet'] _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY = _VODURLUPLOADURLSET.nested_types_by_name['CustomURLHeadersEntry'] _VODIMAGEFILE = DESCRIPTOR.message_types_by_name['VodImageFile'] _VODEXECUTION = DESCRIPTOR.message_types_by_name['VodExecution'] _VODEXECUTIONOPERATION = DESCRIPTOR.message_types_by_name['VodExecutionOperation'] _VODEXECUTIONOPERATIONTASK = DESCRIPTOR.message_types_by_name['VodExecutionOperationTask'] _VODEXECUTIONOPERATIONTASKOCR = DESCRIPTOR.message_types_by_name['VodExecutionOperationTaskOcr'] _VODEXECUTIONOPERATIONTASKASR = DESCRIPTOR.message_types_by_name['VodExecutionOperationTaskAsr'] _VODEXECUTIONCONTROL = DESCRIPTOR.message_types_by_name['VodExecutionControl'] _VODURLRESPONSEDATA = DESCRIPTOR.message_types_by_name['VodUrlResponseData'] _VALUEPAIR = DESCRIPTOR.message_types_by_name['ValuePair'] _VODQUERYDATA = DESCRIPTOR.message_types_by_name['VodQueryData'] _VODQUERYUPLOADRESULT = DESCRIPTOR.message_types_by_name['VodQueryUploadResult'] _VODCOMMITDATA = DESCRIPTOR.message_types_by_name['VodCommitData'] _VODCOMMITUPLOADINFORESPONSEDATA = DESCRIPTOR.message_types_by_name['VodCommitUploadInfoResponseData'] _VODURLSET = DESCRIPTOR.message_types_by_name['VodURLSet'] _VODAPPLYUPLOADINFORESULT = DESCRIPTOR.message_types_by_name['VodApplyUploadInfoResult'] _VODAPPLYUPLOADINFODATA = DESCRIPTOR.message_types_by_name['VodApplyUploadInfoData'] _VODUPLOADADDRESS = DESCRIPTOR.message_types_by_name['VodUploadAddress'] _CANDIDATEUPLOADADDRESSES = DESCRIPTOR.message_types_by_name['CandidateUploadAddresses'] _VODSTOREINFO = DESCRIPTOR.message_types_by_name['VodStoreInfo'] _VODHEADERPAIR = DESCRIPTOR.message_types_by_name['VodHeaderPair'] _VPCTOSUPLOADADDRESS = DESCRIPTOR.message_types_by_name['VpcTosUploadAddress'] _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY = _VPCTOSUPLOADADDRESS.nested_types_by_name['PutUrlHeadersEntry'] _PARTUPLOADINFO = DESCRIPTOR.message_types_by_name['PartUploadInfo'] _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY = _PARTUPLOADINFO.nested_types_by_name['CompleteUrlHeadersEntry'] _VODCOMMITUPLOADINFORESULT = DESCRIPTOR.message_types_by_name['VodCommitUploadInfoResult'] _VODCOMMITUPLOADINFODATA = DESCRIPTOR.message_types_by_name['VodCommitUploadInfoData'] _VODUPLOADFUNCTIONINPUT = DESCRIPTOR.message_types_by_name['VodUploadFunctionInput'] _VODUPLOADFUNCTION = DESCRIPTOR.message_types_by_name['VodUploadFunction'] _COMMITUPLOADINFOPARAM = DESCRIPTOR.message_types_by_name['CommitUploadInfoParam'] _COMMITREQUESTBODYJSON = DESCRIPTOR.message_types_by_name['CommitRequestBodyJson'] _APPLYUPLOADINFOPARAM = DESCRIPTOR.message_types_by_name['ApplyUploadInfoParam'] _COMMITRESPONSE = DESCRIPTOR.message_types_by_name['CommitResponse'] _VODUPLOADTEMPLATE = DESCRIPTOR.message_types_by_name['VodUploadTemplate'] _VODUPLOADOPTIONINFO = DESCRIPTOR.message_types_by_name['VodUploadOptionInfo'] _VODUPLOADCALLBACKDATA = DESCRIPTOR.message_types_by_name['VodUploadCallbackData'] _CALLBACKRESPONSE = DESCRIPTOR.message_types_by_name['CallbackResponse'] _STOREINFO = DESCRIPTOR.message_types_by_name['StoreInfo'] _HEADERPAIR = DESCRIPTOR.message_types_by_name['HeaderPair'] _UPLOADADDRESS = DESCRIPTOR.message_types_by_name['UploadAddress'] _FLUSHUPLOADRESULT = DESCRIPTOR.message_types_by_name['FlushUploadResult'] _APPLYRESPONSE = DESCRIPTOR.message_types_by_name['ApplyResponse'] _VODPARSEUPLOADMANIFESTDATA = DESCRIPTOR.message_types_by_name['VodParseUploadManifestData'] _VODPARSEUPLOADMANIFESTRESULT = DESCRIPTOR.message_types_by_name['VodParseUploadManifestResult'] _SUBMITMOVEOBJECTTASKPARAM = DESCRIPTOR.message_types_by_name['SubmitMoveObjectTaskParam'] _VODSUBMITMOVEOBJECTTASKRESPDATA = DESCRIPTOR.message_types_by_name['VodSubmitMoveObjectTaskRespData'] _SUBMITMOVEOBJECTTASKRESPDATA = DESCRIPTOR.message_types_by_name['SubmitMoveObjectTaskRespData'] _QUERYMOVEOBJECTTASKINFOPARAM = DESCRIPTOR.message_types_by_name['QueryMoveObjectTaskInfoParam'] _VODQUERYMOVEOBJECTTASKINFORESDATA = DESCRIPTOR.message_types_by_name['VodQueryMoveObjectTaskInfoResData'] _QUERYMOVEOBJECTTASKINFORESPDATA = DESCRIPTOR.message_types_by_name['QueryMoveObjectTaskInfoRespData'] VodUrlUploadURLSet = _reflection.GeneratedProtocolMessageType('VodUrlUploadURLSet', (_message.Message,), { 'CustomURLHeadersEntry' : _reflection.GeneratedProtocolMessageType('CustomURLHeadersEntry', (_message.Message,), { 'DESCRIPTOR' : _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUrlUploadURLSet.CustomURLHeadersEntry) }) , 'DESCRIPTOR' : _VODURLUPLOADURLSET, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUrlUploadURLSet) }) _sym_db.RegisterMessage(VodUrlUploadURLSet) _sym_db.RegisterMessage(VodUrlUploadURLSet.CustomURLHeadersEntry) VodImageFile = _reflection.GeneratedProtocolMessageType('VodImageFile', (_message.Message,), { 'DESCRIPTOR' : _VODIMAGEFILE, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodImageFile) }) _sym_db.RegisterMessage(VodImageFile) VodExecution = _reflection.GeneratedProtocolMessageType('VodExecution', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTION, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecution) }) _sym_db.RegisterMessage(VodExecution) VodExecutionOperation = _reflection.GeneratedProtocolMessageType('VodExecutionOperation', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTIONOPERATION, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecutionOperation) }) _sym_db.RegisterMessage(VodExecutionOperation) VodExecutionOperationTask = _reflection.GeneratedProtocolMessageType('VodExecutionOperationTask', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTIONOPERATIONTASK, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecutionOperationTask) }) _sym_db.RegisterMessage(VodExecutionOperationTask) VodExecutionOperationTaskOcr = _reflection.GeneratedProtocolMessageType('VodExecutionOperationTaskOcr', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTIONOPERATIONTASKOCR, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecutionOperationTaskOcr) }) _sym_db.RegisterMessage(VodExecutionOperationTaskOcr) VodExecutionOperationTaskAsr = _reflection.GeneratedProtocolMessageType('VodExecutionOperationTaskAsr', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTIONOPERATIONTASKASR, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecutionOperationTaskAsr) }) _sym_db.RegisterMessage(VodExecutionOperationTaskAsr) VodExecutionControl = _reflection.GeneratedProtocolMessageType('VodExecutionControl', (_message.Message,), { 'DESCRIPTOR' : _VODEXECUTIONCONTROL, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodExecutionControl) }) _sym_db.RegisterMessage(VodExecutionControl) VodUrlResponseData = _reflection.GeneratedProtocolMessageType('VodUrlResponseData', (_message.Message,), { 'DESCRIPTOR' : _VODURLRESPONSEDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUrlResponseData) }) _sym_db.RegisterMessage(VodUrlResponseData) ValuePair = _reflection.GeneratedProtocolMessageType('ValuePair', (_message.Message,), { 'DESCRIPTOR' : _VALUEPAIR, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ValuePair) }) _sym_db.RegisterMessage(ValuePair) VodQueryData = _reflection.GeneratedProtocolMessageType('VodQueryData', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryData) }) _sym_db.RegisterMessage(VodQueryData) VodQueryUploadResult = _reflection.GeneratedProtocolMessageType('VodQueryUploadResult', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYUPLOADRESULT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryUploadResult) }) _sym_db.RegisterMessage(VodQueryUploadResult) VodCommitData = _reflection.GeneratedProtocolMessageType('VodCommitData', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCommitData) }) _sym_db.RegisterMessage(VodCommitData) VodCommitUploadInfoResponseData = _reflection.GeneratedProtocolMessageType('VodCommitUploadInfoResponseData', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITUPLOADINFORESPONSEDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCommitUploadInfoResponseData) }) _sym_db.RegisterMessage(VodCommitUploadInfoResponseData) VodURLSet = _reflection.GeneratedProtocolMessageType('VodURLSet', (_message.Message,), { 'DESCRIPTOR' : _VODURLSET, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodURLSet) }) _sym_db.RegisterMessage(VodURLSet) VodApplyUploadInfoResult = _reflection.GeneratedProtocolMessageType('VodApplyUploadInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODAPPLYUPLOADINFORESULT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodApplyUploadInfoResult) }) _sym_db.RegisterMessage(VodApplyUploadInfoResult) VodApplyUploadInfoData = _reflection.GeneratedProtocolMessageType('VodApplyUploadInfoData', (_message.Message,), { 'DESCRIPTOR' : _VODAPPLYUPLOADINFODATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodApplyUploadInfoData) }) _sym_db.RegisterMessage(VodApplyUploadInfoData) VodUploadAddress = _reflection.GeneratedProtocolMessageType('VodUploadAddress', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADADDRESS, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadAddress) }) _sym_db.RegisterMessage(VodUploadAddress) CandidateUploadAddresses = _reflection.GeneratedProtocolMessageType('CandidateUploadAddresses', (_message.Message,), { 'DESCRIPTOR' : _CANDIDATEUPLOADADDRESSES, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CandidateUploadAddresses) }) _sym_db.RegisterMessage(CandidateUploadAddresses) VodStoreInfo = _reflection.GeneratedProtocolMessageType('VodStoreInfo', (_message.Message,), { 'DESCRIPTOR' : _VODSTOREINFO, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodStoreInfo) }) _sym_db.RegisterMessage(VodStoreInfo) VodHeaderPair = _reflection.GeneratedProtocolMessageType('VodHeaderPair', (_message.Message,), { 'DESCRIPTOR' : _VODHEADERPAIR, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodHeaderPair) }) _sym_db.RegisterMessage(VodHeaderPair) VpcTosUploadAddress = _reflection.GeneratedProtocolMessageType('VpcTosUploadAddress', (_message.Message,), { 'PutUrlHeadersEntry' : _reflection.GeneratedProtocolMessageType('PutUrlHeadersEntry', (_message.Message,), { 'DESCRIPTOR' : _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VpcTosUploadAddress.PutUrlHeadersEntry) }) , 'DESCRIPTOR' : _VPCTOSUPLOADADDRESS, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VpcTosUploadAddress) }) _sym_db.RegisterMessage(VpcTosUploadAddress) _sym_db.RegisterMessage(VpcTosUploadAddress.PutUrlHeadersEntry) PartUploadInfo = _reflection.GeneratedProtocolMessageType('PartUploadInfo', (_message.Message,), { 'CompleteUrlHeadersEntry' : _reflection.GeneratedProtocolMessageType('CompleteUrlHeadersEntry', (_message.Message,), { 'DESCRIPTOR' : _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.PartUploadInfo.CompleteUrlHeadersEntry) }) , 'DESCRIPTOR' : _PARTUPLOADINFO, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.PartUploadInfo) }) _sym_db.RegisterMessage(PartUploadInfo) _sym_db.RegisterMessage(PartUploadInfo.CompleteUrlHeadersEntry) VodCommitUploadInfoResult = _reflection.GeneratedProtocolMessageType('VodCommitUploadInfoResult', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITUPLOADINFORESULT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCommitUploadInfoResult) }) _sym_db.RegisterMessage(VodCommitUploadInfoResult) VodCommitUploadInfoData = _reflection.GeneratedProtocolMessageType('VodCommitUploadInfoData', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITUPLOADINFODATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodCommitUploadInfoData) }) _sym_db.RegisterMessage(VodCommitUploadInfoData) VodUploadFunctionInput = _reflection.GeneratedProtocolMessageType('VodUploadFunctionInput', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADFUNCTIONINPUT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadFunctionInput) }) _sym_db.RegisterMessage(VodUploadFunctionInput) VodUploadFunction = _reflection.GeneratedProtocolMessageType('VodUploadFunction', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADFUNCTION, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadFunction) }) _sym_db.RegisterMessage(VodUploadFunction) CommitUploadInfoParam = _reflection.GeneratedProtocolMessageType('CommitUploadInfoParam', (_message.Message,), { 'DESCRIPTOR' : _COMMITUPLOADINFOPARAM, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CommitUploadInfoParam) }) _sym_db.RegisterMessage(CommitUploadInfoParam) CommitRequestBodyJson = _reflection.GeneratedProtocolMessageType('CommitRequestBodyJson', (_message.Message,), { 'DESCRIPTOR' : _COMMITREQUESTBODYJSON, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CommitRequestBodyJson) }) _sym_db.RegisterMessage(CommitRequestBodyJson) ApplyUploadInfoParam = _reflection.GeneratedProtocolMessageType('ApplyUploadInfoParam', (_message.Message,), { 'DESCRIPTOR' : _APPLYUPLOADINFOPARAM, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ApplyUploadInfoParam) }) _sym_db.RegisterMessage(ApplyUploadInfoParam) CommitResponse = _reflection.GeneratedProtocolMessageType('CommitResponse', (_message.Message,), { 'DESCRIPTOR' : _COMMITRESPONSE, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CommitResponse) }) _sym_db.RegisterMessage(CommitResponse) VodUploadTemplate = _reflection.GeneratedProtocolMessageType('VodUploadTemplate', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADTEMPLATE, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadTemplate) }) _sym_db.RegisterMessage(VodUploadTemplate) VodUploadOptionInfo = _reflection.GeneratedProtocolMessageType('VodUploadOptionInfo', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADOPTIONINFO, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadOptionInfo) }) _sym_db.RegisterMessage(VodUploadOptionInfo) VodUploadCallbackData = _reflection.GeneratedProtocolMessageType('VodUploadCallbackData', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADCALLBACKDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodUploadCallbackData) }) _sym_db.RegisterMessage(VodUploadCallbackData) CallbackResponse = _reflection.GeneratedProtocolMessageType('CallbackResponse', (_message.Message,), { 'DESCRIPTOR' : _CALLBACKRESPONSE, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CallbackResponse) }) _sym_db.RegisterMessage(CallbackResponse) StoreInfo = _reflection.GeneratedProtocolMessageType('StoreInfo', (_message.Message,), { 'DESCRIPTOR' : _STOREINFO, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.StoreInfo) }) _sym_db.RegisterMessage(StoreInfo) HeaderPair = _reflection.GeneratedProtocolMessageType('HeaderPair', (_message.Message,), { 'DESCRIPTOR' : _HEADERPAIR, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.HeaderPair) }) _sym_db.RegisterMessage(HeaderPair) UploadAddress = _reflection.GeneratedProtocolMessageType('UploadAddress', (_message.Message,), { 'DESCRIPTOR' : _UPLOADADDRESS, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.UploadAddress) }) _sym_db.RegisterMessage(UploadAddress) FlushUploadResult = _reflection.GeneratedProtocolMessageType('FlushUploadResult', (_message.Message,), { 'DESCRIPTOR' : _FLUSHUPLOADRESULT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.FlushUploadResult) }) _sym_db.RegisterMessage(FlushUploadResult) ApplyResponse = _reflection.GeneratedProtocolMessageType('ApplyResponse', (_message.Message,), { 'DESCRIPTOR' : _APPLYRESPONSE, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ApplyResponse) }) _sym_db.RegisterMessage(ApplyResponse) VodParseUploadManifestData = _reflection.GeneratedProtocolMessageType('VodParseUploadManifestData', (_message.Message,), { 'DESCRIPTOR' : _VODPARSEUPLOADMANIFESTDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodParseUploadManifestData) }) _sym_db.RegisterMessage(VodParseUploadManifestData) VodParseUploadManifestResult = _reflection.GeneratedProtocolMessageType('VodParseUploadManifestResult', (_message.Message,), { 'DESCRIPTOR' : _VODPARSEUPLOADMANIFESTRESULT, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodParseUploadManifestResult) }) _sym_db.RegisterMessage(VodParseUploadManifestResult) SubmitMoveObjectTaskParam = _reflection.GeneratedProtocolMessageType('SubmitMoveObjectTaskParam', (_message.Message,), { 'DESCRIPTOR' : _SUBMITMOVEOBJECTTASKPARAM, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SubmitMoveObjectTaskParam) }) _sym_db.RegisterMessage(SubmitMoveObjectTaskParam) VodSubmitMoveObjectTaskRespData = _reflection.GeneratedProtocolMessageType('VodSubmitMoveObjectTaskRespData', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITMOVEOBJECTTASKRESPDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodSubmitMoveObjectTaskRespData) }) _sym_db.RegisterMessage(VodSubmitMoveObjectTaskRespData) SubmitMoveObjectTaskRespData = _reflection.GeneratedProtocolMessageType('SubmitMoveObjectTaskRespData', (_message.Message,), { 'DESCRIPTOR' : _SUBMITMOVEOBJECTTASKRESPDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SubmitMoveObjectTaskRespData) }) _sym_db.RegisterMessage(SubmitMoveObjectTaskRespData) QueryMoveObjectTaskInfoParam = _reflection.GeneratedProtocolMessageType('QueryMoveObjectTaskInfoParam', (_message.Message,), { 'DESCRIPTOR' : _QUERYMOVEOBJECTTASKINFOPARAM, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.QueryMoveObjectTaskInfoParam) }) _sym_db.RegisterMessage(QueryMoveObjectTaskInfoParam) VodQueryMoveObjectTaskInfoResData = _reflection.GeneratedProtocolMessageType('VodQueryMoveObjectTaskInfoResData', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMOVEOBJECTTASKINFORESDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodQueryMoveObjectTaskInfoResData) }) _sym_db.RegisterMessage(VodQueryMoveObjectTaskInfoResData) QueryMoveObjectTaskInfoRespData = _reflection.GeneratedProtocolMessageType('QueryMoveObjectTaskInfoRespData', (_message.Message,), { 'DESCRIPTOR' : _QUERYMOVEOBJECTTASKINFORESPDATA, '__module__' : 'volcengine.vod.business.vod_upload_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.QueryMoveObjectTaskInfoRespData) }) _sym_db.RegisterMessage(QueryMoveObjectTaskInfoRespData) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\tVodUploadP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\302\002\000\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY._options = None _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY._serialized_options = b'8\001' _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY._options = None _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY._serialized_options = b'8\001' _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY._options = None _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY._serialized_options = b'8\001' _STORAGECLASSTYPE._serialized_start=7735 _STORAGECLASSTYPE._serialized_end=7801 _VODURLUPLOADURLSET._serialized_start=119 _VODURLUPLOADURLSET._serialized_end=804 _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY._serialized_start=749 _VODURLUPLOADURLSET_CUSTOMURLHEADERSENTRY._serialized_end=804 _VODIMAGEFILE._serialized_start=806 _VODIMAGEFILE._serialized_end=851 _VODEXECUTION._serialized_start=854 _VODEXECUTION._serialized_end=1012 _VODEXECUTIONOPERATION._serialized_start=1014 _VODEXECUTIONOPERATION._serialized_end=1124 _VODEXECUTIONOPERATIONTASK._serialized_start=1127 _VODEXECUTIONOPERATIONTASK._serialized_end=1318 _VODEXECUTIONOPERATIONTASKOCR._serialized_start=1320 _VODEXECUTIONOPERATIONTASKOCR._serialized_end=1386 _VODEXECUTIONOPERATIONTASKASR._serialized_start=1388 _VODEXECUTIONOPERATIONTASKASR._serialized_end=1513 _VODEXECUTIONCONTROL._serialized_start=1515 _VODEXECUTIONCONTROL._serialized_end=1579 _VODURLRESPONSEDATA._serialized_start=1581 _VODURLRESPONSEDATA._serialized_end=1658 _VALUEPAIR._serialized_start=1660 _VALUEPAIR._serialized_end=1724 _VODQUERYDATA._serialized_start=1726 _VODQUERYDATA._serialized_end=1808 _VODQUERYUPLOADRESULT._serialized_start=1810 _VODQUERYUPLOADRESULT._serialized_end=1922 _VODCOMMITDATA._serialized_start=1924 _VODCOMMITDATA._serialized_end=2018 _VODCOMMITUPLOADINFORESPONSEDATA._serialized_start=2021 _VODCOMMITUPLOADINFORESPONSEDATA._serialized_end=2188 _VODURLSET._serialized_start=2191 _VODURLSET._serialized_end=2410 _VODAPPLYUPLOADINFORESULT._serialized_start=2412 _VODAPPLYUPLOADINFORESULT._serialized_end=2508 _VODAPPLYUPLOADINFODATA._serialized_start=2511 _VODAPPLYUPLOADINFODATA._serialized_end=2782 _VODUPLOADADDRESS._serialized_start=2785 _VODUPLOADADDRESS._serialized_end=2979 _CANDIDATEUPLOADADDRESSES._serialized_start=2982 _CANDIDATEUPLOADADDRESSES._serialized_end=3242 _VODSTOREINFO._serialized_start=3244 _VODSTOREINFO._serialized_end=3290 _VODHEADERPAIR._serialized_start=3292 _VODHEADERPAIR._serialized_end=3335 _VPCTOSUPLOADADDRESS._serialized_start=3338 _VPCTOSUPLOADADDRESS._serialized_end=3643 _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY._serialized_start=3591 _VPCTOSUPLOADADDRESS_PUTURLHEADERSENTRY._serialized_end=3643 _PARTUPLOADINFO._serialized_start=3646 _PARTUPLOADINFO._serialized_end=3885 _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY._serialized_start=3828 _PARTUPLOADINFO_COMPLETEURLHEADERSENTRY._serialized_end=3885 _VODCOMMITUPLOADINFORESULT._serialized_start=3887 _VODCOMMITUPLOADINFORESULT._serialized_end=3985 _VODCOMMITUPLOADINFODATA._serialized_start=3988 _VODCOMMITUPLOADINFODATA._serialized_end=4125 _VODUPLOADFUNCTIONINPUT._serialized_start=4128 _VODUPLOADFUNCTIONINPUT._serialized_end=4572 _VODUPLOADFUNCTION._serialized_start=4574 _VODUPLOADFUNCTION._serialized_end=4678 _COMMITUPLOADINFOPARAM._serialized_start=4681 _COMMITUPLOADINFOPARAM._serialized_end=4881 _COMMITREQUESTBODYJSON._serialized_start=4884 _COMMITREQUESTBODYJSON._serialized_end=5033 _APPLYUPLOADINFOPARAM._serialized_start=5036 _APPLYUPLOADINFOPARAM._serialized_end=5348 _COMMITRESPONSE._serialized_start=5351 _COMMITRESPONSE._serialized_end=5501 _VODUPLOADTEMPLATE._serialized_start=5503 _VODUPLOADTEMPLATE._serialized_end=5565 _VODUPLOADOPTIONINFO._serialized_start=5568 _VODUPLOADOPTIONINFO._serialized_end=5700 _VODUPLOADCALLBACKDATA._serialized_start=5703 _VODUPLOADCALLBACKDATA._serialized_end=5983 _CALLBACKRESPONSE._serialized_start=5986 _CALLBACKRESPONSE._serialized_end=6147 _STOREINFO._serialized_start=6149 _STOREINFO._serialized_end=6192 _HEADERPAIR._serialized_start=6194 _HEADERPAIR._serialized_end=6234 _UPLOADADDRESS._serialized_start=6237 _UPLOADADDRESS._serialized_end=6422 _FLUSHUPLOADRESULT._serialized_start=6425 _FLUSHUPLOADRESULT._serialized_end=6599 _APPLYRESPONSE._serialized_start=6602 _APPLYRESPONSE._serialized_end=6865 _VODPARSEUPLOADMANIFESTDATA._serialized_start=6867 _VODPARSEUPLOADMANIFESTDATA._serialized_end=6918 _VODPARSEUPLOADMANIFESTRESULT._serialized_start=6920 _VODPARSEUPLOADMANIFESTRESULT._serialized_end=7024 _SUBMITMOVEOBJECTTASKPARAM._serialized_start=7027 _SUBMITMOVEOBJECTTASKPARAM._serialized_end=7194 _VODSUBMITMOVEOBJECTTASKRESPDATA._serialized_start=7196 _VODSUBMITMOVEOBJECTTASKRESPDATA._serialized_end=7305 _SUBMITMOVEOBJECTTASKRESPDATA._serialized_start=7307 _SUBMITMOVEOBJECTTASKRESPDATA._serialized_end=7395 _QUERYMOVEOBJECTTASKINFOPARAM._serialized_start=7397 _QUERYMOVEOBJECTTASKINFOPARAM._serialized_end=7485 _VODQUERYMOVEOBJECTTASKINFORESDATA._serialized_start=7487 _VODQUERYMOVEOBJECTTASKINFORESDATA._serialized_end=7601 _QUERYMOVEOBJECTTASKINFORESPDATA._serialized_start=7604 _QUERYMOVEOBJECTTASKINFORESPDATA._serialized_end=7733 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/business/vod_workflow_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/business/vod_workflow.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*volcengine/vod/business/vod_workflow.proto\x12\x1eVolcengine.Vod.Models.Business\x1a\x1fgoogle/protobuf/timestamp.proto\x1a(volcengine/vod/business/vod_common.proto\"\'\n\x16VodStartWorkflowResult\x12\r\n\x05RunId\x18\x01 \x01(\t\"D\n\tDirectUrl\x12\x10\n\x08\x46ileName\x18\x01 \x01(\t\x12\x12\n\nBucketName\x18\x02 \x01(\t\x12\x11\n\tSpaceName\x18\x03 \x01(\t\"\xdc\x01\n\x0eWorkflowParams\x12\x46\n\x0eOverrideParams\x18\x01 \x01(\x0b\x32..Volcengine.Vod.Models.Business.OverrideParams\x12P\n\tCondition\x18\x02 \x03(\x0b\x32=.Volcengine.Vod.Models.Business.WorkflowParams.ConditionEntry\x1a\x30\n\x0e\x43onditionEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\"\xf2\x02\n\x0eOverrideParams\x12:\n\x04Logo\x18\x01 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.LogoOverride\x12N\n\x0eTranscodeVideo\x18\x02 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.TranscodeVideoOverride\x12N\n\x0eTranscodeAudio\x18\x03 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.TranscodeAudioOverride\x12\x42\n\x08Snapshot\x18\x04 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.SnapshotOverride\x12@\n\x07\x45nhance\x18\x05 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.EnhanceOverride\"\x95\x01\n\x0cLogoOverride\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x44\n\x04Vars\x18\x02 \x03(\x0b\x32\x36.Volcengine.Vod.Models.Business.LogoOverride.VarsEntry\x1a+\n\tVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9f\x01\n\x16TranscodeVideoOverride\x12\x12\n\nTemplateId\x18\x01 \x03(\t\x12\x32\n\x04\x43lip\x18\x02 \x01(\x0b\x32$.Volcengine.Vod.Models.Business.Clip\x12\x13\n\x0bOutputIndex\x18\x03 \x03(\x05\x12\x10\n\x08\x46ileName\x18\x04 \x01(\t\x12\x16\n\x0eLogoTemplateId\x18\x05 \x01(\t\"*\n\x04\x43lip\x12\x11\n\tStartTime\x18\x01 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\x05\"r\n\x16TranscodeAudioOverride\x12\x12\n\nTemplateId\x18\x01 \x03(\t\x12\x32\n\x04\x43lip\x18\x02 \x01(\x0b\x32$.Volcengine.Vod.Models.Business.Clip\x12\x10\n\x08\x46ileName\x18\x03 \x01(\t\"\xcc\x01\n\x10SnapshotOverride\x12\x12\n\nTemplateId\x18\x01 \x03(\t\x12\x12\n\nOffsetTime\x18\x02 \x01(\x05\x12\x16\n\x0eOffsetTimeList\x18\x03 \x03(\x05\x12\x10\n\x08\x46ileName\x18\x04 \x01(\t\x12\x11\n\tFileIndex\x18\x05 \x01(\t\x12\x15\n\rSampleOffsets\x18\x06 \x03(\x02\x12\x12\n\x05Width\x18\x07 \x01(\x05H\x00\x88\x01\x01\x12\x13\n\x06Height\x18\x08 \x01(\x05H\x01\x88\x01\x01\x42\x08\n\x06_WidthB\t\n\x07_Height\"8\n\x0f\x45nhanceOverride\x12\x13\n\x0bStorageMode\x18\x01 \x01(\t\x12\x10\n\x08\x46ileName\x18\x02 \x01(\t\"\xa5\x01\n\x0fTranscodeResult\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12>\n\nInspection\x18\x02 \x01(\x0b\x32*.Volcengine.Vod.Models.Business.Inspection\x12\x45\n\x0c\x43\x61tegoryTags\x18\x03 \x03(\x0b\x32/.Volcengine.Vod.Models.Business.CategoryTagInfo\"\x82\x01\n\nInspection\x12\x38\n\x07Quality\x18\x01 \x01(\x0b\x32\'.Volcengine.Vod.Models.Business.Quality\x12:\n\x06\x44\x65Logo\x18\x02 \x03(\x0b\x32*.Volcengine.Vod.Models.Business.DeLogoInfo\"\x88\x01\n\x07Quality\x12=\n\x06Visual\x18\x01 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VisualQuality\x12>\n\nVolumeInfo\x18\x02 \x01(\x0b\x32*.Volcengine.Vod.Models.Business.VolumeInfo\"q\n\nDeLogoInfo\x12\x13\n\x0b\x41nchorWidth\x18\x01 \x01(\x03\x12\x14\n\x0c\x41nchorHeight\x18\x02 \x01(\x03\x12\x0c\n\x04PosX\x18\x03 \x01(\x03\x12\x0c\n\x04PosY\x18\x04 \x01(\x03\x12\r\n\x05SizeX\x18\x05 \x01(\x03\x12\r\n\x05SizeY\x18\x06 \x01(\x03\"|\n\rVisualQuality\x12\x0f\n\x07VQScore\x18\x01 \x01(\x01\x12\x10\n\x08\x43ontrast\x18\x02 \x01(\x01\x12\x14\n\x0c\x43olorfulness\x18\x03 \x01(\x01\x12\x12\n\nBrightness\x18\x04 \x01(\x01\x12\x0f\n\x07Texture\x18\x05 \x01(\x01\x12\r\n\x05Noise\x18\x06 \x01(\x01\"S\n\nVolumeInfo\x12\x10\n\x08Loudness\x18\x01 \x01(\x01\x12\x0c\n\x04Peak\x18\x02 \x01(\x01\x12\x12\n\nMeanVolume\x18\x03 \x01(\x01\x12\x11\n\tMaxVolume\x18\x04 \x01(\x01\"\xd6\x01\n\x0f\x43\x61tegoryTagInfo\x12\r\n\x05TagId\x18\x01 \x01(\x03\x12\x0c\n\x04Prob\x18\x02 \x01(\x01\x12\x0f\n\x07TagName\x18\x03 \x01(\t\x12\r\n\x05Level\x18\x04 \x01(\x03\x12S\n\nParentInfo\x18\x05 \x03(\x0b\x32?.Volcengine.Vod.Models.Business.CategoryTagInfo.ParentInfoEntry\x1a\x31\n\x0fParentInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x97\x01\n\x1eVodListWorkflowExecutionResult\x12?\n\x04\x44\x61ta\x18\x01 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.WorkflowExecution\x12\x12\n\nTotalCount\x18\x02 \x01(\x05\x12\x10\n\x08PageSize\x18\x03 \x01(\x05\x12\x0e\n\x06Offset\x18\x04 \x01(\x05\"\xb0\x04\n\x11WorkflowExecution\x12\r\n\x05RunId\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x12\n\nTemplateId\x18\x03 \x01(\t\x12\x14\n\x0cTemplateName\x18\x04 \x01(\t\x12\x11\n\tSpaceName\x18\x05 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\x12\x12\n\nTaskListId\x18\x07 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x08 \x01(\x08\x12\x11\n\tJobSource\x18\t \x01(\t\x12.\n\nCreateTime\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tStartTime\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x45ndTime\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12=\n\x05Input\x18\r \x01(\x0b\x32..Volcengine.Vod.Models.Business.WorkflowParams\x12\x10\n\x08Priority\x18\x0e \x01(\x05\x12\x14\n\x0c\x43\x61llbackArgs\x18\x0f \x01(\t\x12?\n\x0bTasksDetail\x18\x10 \x03(\x0b\x32*.Volcengine.Vod.Models.Business.TaskDetail\x12<\n\tDirectUrl\x18\x11 \x01(\x0b\x32).Volcengine.Vod.Models.Business.DirectUrl\"\xc4\x03\n#VodGetWorkflowExecutionDetailResult\x12\r\n\x05RunId\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x12\n\nTemplateId\x18\x03 \x01(\t\x12\x11\n\tSpaceName\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\x12\x12\n\nTaskListId\x18\x07 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x08 \x01(\x08\x12\x11\n\tJobSource\x18\t \x01(\t\x12>\n\x06Stages\x18\n \x03(\x0b\x32..Volcengine.Vod.Models.Business.ExecutionStage\x12.\n\nCreateTime\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tStartTime\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x45ndTime\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\tDirectUrl\x18\x0e \x01(\x0b\x32).Volcengine.Vod.Models.Business.DirectUrl\"\xc3\x01\n\x0e\x45xecutionStage\x12\x13\n\x0b\x44isplayName\x18\x01 \x01(\t\x12@\n\x0bStageDetail\x18\x02 \x03(\x0b\x32+.Volcengine.Vod.Models.Business.StageDetail\x12-\n\tStartTime\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x45ndTime\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8d\x02\n\x0bStageDetail\x12\n\n\x02Id\x18\x01 \x01(\t\x12\x13\n\x0b\x44isplayName\x18\x02 \x01(\t\x12\x0c\n\x04Type\x18\x03 \x01(\t\x12\x12\n\nTemplateId\x18\x04 \x01(\t\x12;\n\x06Status\x18\x05 \x01(\x0e\x32+.Volcengine.Vod.Models.Business.StageStatus\x12\x11\n\tErrorCode\x18\x06 \x01(\x03\x12\x0f\n\x07Message\x18\x07 \x01(\t\x12-\n\tStartTime\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x45ndTime\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe0\x01\n\nTaskDetail\x12\x13\n\x0b\x44isplayName\x18\x02 \x01(\t\x12\x12\n\nTemplateId\x18\x04 \x01(\t\x12;\n\x06Status\x18\x05 \x01(\x0e\x32+.Volcengine.Vod.Models.Business.StageStatus\x12\x10\n\x08Progress\x18\x08 \x01(\x05\x12-\n\tStartTime\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x45ndTime\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"W\n\x14SnapshotParamsPoster\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08StoreUri\x18\x02 \x01(\t\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x0e\n\x06Height\x18\x04 \x01(\x05\"X\n\x15SnapshotParamsDynpost\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08StoreUri\x18\x02 \x01(\t\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x0e\n\x06Height\x18\x04 \x01(\x05\"Z\n\x17SnapshotParamsAIDynpost\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08StoreUri\x18\x02 \x01(\t\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x0e\n\x06Height\x18\x04 \x01(\x05\"_\n\x1cSnapshotParamsAnimatedPoster\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08StoreUri\x18\x02 \x01(\t\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x0e\n\x06Height\x18\x04 \x01(\x05\"\xa8\x01\n\x14SnapshotParamsSprite\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x11\n\tStoreUris\x18\x02 \x03(\t\x12\x11\n\tCellWidth\x18\x03 \x01(\x05\x12\x12\n\nCellHeight\x18\x04 \x01(\x05\x12\x0f\n\x07ImgXLen\x18\x05 \x01(\x05\x12\x0f\n\x07ImgYLen\x18\x06 \x01(\x05\x12\x10\n\x08Interval\x18\x07 \x01(\x02\x12\x12\n\nCaptureNum\x18\x08 \x01(\x05\"\xb3\x01\n\x14SnapshotParamsSample\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x11\n\tStoreUris\x18\x02 \x03(\t\x12\r\n\x05Width\x18\x03 \x01(\x05\x12\x0e\n\x06Height\x18\x04 \x01(\x05\x12\x10\n\x08Interval\x18\x05 \x01(\x02\x12\x12\n\nCaptureNum\x18\x06 \x01(\x05\x12\x10\n\x08\x44uration\x18\x07 \x01(\x02\x12\x10\n\x08IndexUri\x18\x08 \x01(\t\x12\x0f\n\x07Offsets\x18\t \x03(\x02\"\xf8\x03\n\x0eSnapshotResult\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12\x46\n\x06Poster\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.SnapshotParamsPosterH\x00\x12H\n\x07\x44ynpost\x18\x03 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.SnapshotParamsDynpostH\x00\x12V\n\x0e\x41nimatedPoster\x18\x04 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.SnapshotParamsAnimatedPosterH\x00\x12L\n\tAIDynpost\x18\x05 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.SnapshotParamsAIDynpostH\x00\x12\x46\n\x06Sprite\x18\x06 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.SnapshotParamsSpriteH\x00\x12\x46\n\x06Sample\x18\x07 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.SnapshotParamsSampleH\x00\x42\x10\n\x0eSnapshotParams\"\xdc\x02\n\x11VodWorkflowResult\x12<\n\tDirectUrl\x18\x01 \x01(\x0b\x32).Volcengine.Vod.Models.Business.DirectUrl\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\r\n\x05RunId\x18\x03 \x01(\t\x12\x11\n\tSpaceName\x18\x04 \x01(\t\x12\x12\n\nTemplateId\x18\x05 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x06 \x01(\t\x12\x0e\n\x06Status\x18\x07 \x01(\t\x12H\n\x0eTranscodeInfos\x18\x08 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodTranscodeInfo\x12\x41\n\tSnapshots\x18\t \x03(\x0b\x32..Volcengine.Vod.Models.Business.SnapshotResult\x12\x13\n\x0b\x43lientToken\x18\n \x01(\t\"\xca\x04\n\x0cTaskTemplate\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\t\x12\x10\n\x08\x43ommitId\x18\t \x01(\t\x12\x0c\n\x04Hash\x18\x0b \x01(\t\x12-\n\tCreatedAt\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tUpdatedAt\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08TaskType\x18\x0e \x01(\t\x12Z\n\x18TranscodeVideoTaskParams\x18\x0f \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeVideoTaskParams\x12J\n\x10\x42yteHDTaskParams\x18\x12 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.ByteHDTaskParams\x12Z\n\x18TranscodeAudioTaskParams\x18\x13 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeAudioTaskParams\x12N\n\x12SnapshotTaskParams\x18\x14 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.SnapshotTaskParams\"\xc4\x03\n\x18TranscodeVideoTaskParams\x12\x1d\n\x15TranscodeTemplateType\x18\x01 \x01(\t\x12\x11\n\tContainer\x18\x02 \x01(\t\x12\x34\n\x05Video\x18\x03 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.Video\x12\x34\n\x05\x41udio\x18\x04 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.Audio\x12\x14\n\x0c\x44isableAudio\x18\x05 \x01(\x08\x12\x0f\n\x07Quality\x18\x06 \x01(\t\x12\x0f\n\x07Vladder\x18\x07 \x01(\t\x12\x0f\n\x07UserTag\x18\x08 \x01(\t\x12\x0f\n\x07\x45ncrypt\x18\t \x01(\x08\x12>\n\nEncryption\x18\n \x01(\x0b\x32*.Volcengine.Vod.Models.Business.Encryption\x12\x38\n\x07Segment\x18\x0b \x01(\x0b\x32\'.Volcengine.Vod.Models.Business.Segment\x12\x36\n\x06Volume\x18\x0c \x01(\x0b\x32&.Volcengine.Vod.Models.Business.Volume\"\x9d\x03\n\x10\x42yteHDTaskParams\x12\x11\n\tContainer\x18\x01 \x01(\t\x12\x34\n\x05Video\x18\x02 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.Video\x12\x34\n\x05\x41udio\x18\x03 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.Audio\x12\x14\n\x0c\x44isableAudio\x18\x04 \x01(\x08\x12\x0f\n\x07Quality\x18\x05 \x01(\t\x12\x0f\n\x07Vladder\x18\x06 \x01(\t\x12\x0f\n\x07UserTag\x18\x07 \x01(\t\x12\x0f\n\x07\x45ncrypt\x18\x08 \x01(\x08\x12>\n\nEncryption\x18\t \x01(\x0b\x32*.Volcengine.Vod.Models.Business.Encryption\x12\x38\n\x07Segment\x18\n \x01(\x0b\x32\'.Volcengine.Vod.Models.Business.Segment\x12\x36\n\x06Volume\x18\x0b \x01(\x0b\x32&.Volcengine.Vod.Models.Business.Volume\"\xc8\x02\n\x18TranscodeAudioTaskParams\x12\x11\n\tContainer\x18\x01 \x01(\t\x12\x34\n\x05\x41udio\x18\x02 \x01(\x0b\x32%.Volcengine.Vod.Models.Business.Audio\x12\x0f\n\x07Quality\x18\x03 \x01(\t\x12\x0f\n\x07UserTag\x18\x04 \x01(\t\x12\x0f\n\x07\x45ncrypt\x18\x05 \x01(\x08\x12>\n\nEncryption\x18\x06 \x01(\x0b\x32*.Volcengine.Vod.Models.Business.Encryption\x12\x38\n\x07Segment\x18\x07 \x01(\x0b\x32\'.Volcengine.Vod.Models.Business.Segment\x12\x36\n\x06Volume\x18\x08 \x01(\x0b\x32&.Volcengine.Vod.Models.Business.Volume\"\xd8\x03\n\x12SnapshotTaskParams\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12R\n\x14PosterSnapshotParams\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.PosterSnapshotParams\x12T\n\x15\x44ynpostSnapshotParams\x18\x03 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.DynpostSnapshotParams\x12\x62\n\x1c\x41nimatedPosterSnapshotParams\x18\x04 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.AnimatedPosterSnapshotParams\x12R\n\x14SpriteSnapshotParams\x18\x05 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.SpriteSnapshotParams\x12R\n\x14SampleSnapshotParams\x18\x07 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.SampleSnapshotParams\"\x8f\x01\n\x14PosterSnapshotParams\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08ResAdapt\x18\x02 \x01(\x08\x12\x10\n\x08ResLimit\x18\x03 \x01(\x05\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\x12\n\nOffsetTime\x18\x06 \x01(\x05\x12\x10\n\x08\x46illType\x18\x07 \x01(\t\"\xc5\x01\n\x15\x44ynpostSnapshotParams\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08ResAdapt\x18\x02 \x01(\x08\x12\x10\n\x08ResLimit\x18\x03 \x01(\x05\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\x12\n\nOffsetTime\x18\x06 \x01(\x05\x12\x10\n\x08\x44uration\x18\x07 \x01(\x05\x12\x12\n\nCaptureFps\x18\x08 \x01(\x02\x12\r\n\x05Speed\x18\t \x01(\x02\x12\x10\n\x08\x46illType\x18\n \x01(\t\"\xbf\x01\n\x1c\x41nimatedPosterSnapshotParams\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08ResAdapt\x18\x02 \x01(\x08\x12\x10\n\x08ResLimit\x18\x03 \x01(\x05\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\x12\n\nOffsetTime\x18\x06 \x01(\x05\x12\x12\n\nCaptureFps\x18\x07 \x01(\x02\x12\x12\n\nCaptureNum\x18\x08 \x01(\x05\x12\x10\n\x08\x46illType\x18\t \x01(\t\"\xdf\x01\n\x14SpriteSnapshotParams\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x11\n\tCellWidth\x18\x02 \x01(\x05\x12\x12\n\nCellHeight\x18\x03 \x01(\x05\x12\x0f\n\x07ImgXLen\x18\x04 \x01(\x05\x12\x0f\n\x07ImgYLen\x18\x05 \x01(\x05\x12\x10\n\x08Interval\x18\x06 \x01(\x05\x12\x12\n\nOffsetTime\x18\x07 \x01(\x05\x12\x12\n\nCaptureNum\x18\x08 \x01(\x05\x12\x10\n\x08ResAdapt\x18\t \x01(\x08\x12\x10\n\x08ResLimit\x18\n \x01(\x05\x12\x10\n\x08\x46illType\x18\x0b \x01(\t\"\xd8\x01\n\x14SampleSnapshotParams\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x10\n\x08ResAdapt\x18\x02 \x01(\x08\x12\x10\n\x08ResLimit\x18\x03 \x01(\x05\x12\r\n\x05Width\x18\x04 \x01(\x05\x12\x0e\n\x06Height\x18\x05 \x01(\x05\x12\x12\n\nCaptureNum\x18\x06 \x01(\x05\x12\x13\n\x0b\x43\x61ptureMode\x18\x07 \x01(\x05\x12\x10\n\x08Interval\x18\x08 \x01(\x01\x12\x0f\n\x07OutMode\x18\t \x01(\t\x12\x10\n\x08\x46illType\x18\n \x01(\t\x12\x0f\n\x07Offsets\x18\x0b \x03(\x02\"[\n\x15VodTaskTemplateResult\x12\x42\n\x0cTaskTemplate\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.TaskTemplate\"\x85\x01\n\x19VodListTaskTemplateResult\x12\r\n\x05Limit\x18\x01 \x01(\x05\x12\x0e\n\x06Offset\x18\x02 \x01(\x05\x12\r\n\x05Total\x18\x03 \x01(\x03\x12:\n\x04\x44\x61ta\x18\x04 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.TaskTemplate\"\x98\x02\n\x10WorkflowTemplate\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\t\x12-\n\tCreatedAt\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tUpdatedAt\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x43ommitId\x18\x0e \x01(\t\x12<\n\nActivities\x18\x13 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.Activity\"\xab\x02\n\x08\x41\x63tivity\x12\x12\n\nActivityId\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x0c\n\x04Type\x18\x04 \x01(\t\x12J\n\x10SnapshotActivity\x18\x0c \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.SnapshotActivity\x12@\n\x0b\x45ndActivity\x18\x13 \x01(\x0b\x32+.Volcengine.Vod.Models.Business.EndActivity\x12L\n\x11TranscodeActivity\x18\x17 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.TranscodeActivity\"\xe5\x03\n\x11TranscodeActivity\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12P\n\x07\x45nhance\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.TranscodeActivity.EnhanceParams\x12J\n\x04Logo\x18\x03 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.TranscodeActivity.LogoParams\x12\x10\n\x08\x46ileName\x18\x05 \x01(\t\x12@\n\x08Parallel\x18\x06 \x01(\x0b\x32..Volcengine.Vod.Models.Business.ParallelParams\x12<\n\tCondition\x18\x07 \x01(\x0b\x32).Volcengine.Vod.Models.Business.Condition\x1a\x34\n\rEnhanceParams\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x0f\n\x07Version\x18\x02 \x01(\t\x1a \n\nLogoParams\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x1a\x34\n\x0eSubtitleParams\x12\x10\n\x08Language\x18\x01 \x01(\t\x12\x10\n\x08\x46ontType\x18\x02 \x01(\t\"v\n\x10SnapshotActivity\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x10\n\x08\x46ileName\x18\x02 \x01(\t\x12<\n\tCondition\x18\x03 \x01(\x0b\x32).Volcengine.Vod.Models.Business.Condition\"%\n\x0b\x45ndActivity\x12\x16\n\x0eTranscodeEvent\x18\x01 \x01(\t\"g\n\x19VodWorkflowTemplateResult\x12J\n\x10WorkflowTemplate\x18\x02 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.WorkflowTemplate\"\x8d\x01\n\x1dVodListWorkflowTemplateResult\x12\r\n\x05Limit\x18\x01 \x01(\x05\x12\x0e\n\x06Offset\x18\x02 \x01(\x05\x12\r\n\x05Total\x18\x03 \x01(\x03\x12>\n\x04\x44\x61ta\x18\x04 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.WorkflowTemplate\"\xa9\x03\n\x0cLogoTemplate\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\t\x12-\n\tCreatedAt\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tUpdatedAt\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04Hash\x18\x0b \x01(\t\x12\x10\n\x08LogoType\x18\x0c \x01(\t\x12\x38\n\x05Logos\x18\r \x03(\x0b\x32).Volcengine.Vod.Models.Business.AdaptLogo\x12<\n\x07\x43oncats\x18\x0e \x03(\x0b\x32+.Volcengine.Vod.Models.Business.AdaptConcat\x12K\n\x0fHiddenWatermark\x18\x0f \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.HiddenWatermarkAdd\"\x8a\x01\n\tAdaptLogo\x12>\n\nAnchorSize\x18\x01 \x01(\x0b\x32*.Volcengine.Vod.Models.Business.AnchorSize\x12=\n\x05Logos\x18\x02 \x03(\x0b\x32..Volcengine.Vod.Models.Business.LogoDefinition\"+\n\nAnchorSize\x12\r\n\x05Width\x18\x01 \x01(\x05\x12\x0e\n\x06Height\x18\x02 \x01(\x05\"\x9b\x02\n\x13ImageLogoDefinition\x12\x0b\n\x03Mid\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\x05\x12\x0e\n\x06Locate\x18\x04 \x01(\t\x12\x0c\n\x04PosX\x18\x05 \x01(\x05\x12\x0c\n\x04PosY\x18\x06 \x01(\x05\x12\r\n\x05SizeX\x18\x07 \x01(\x05\x12\r\n\x05SizeY\x18\x08 \x01(\x05\x12\x11\n\tLoopTimes\x18\t \x01(\x05\x12\x12\n\nRepeatLast\x18\n \x01(\x08\x12\x14\n\x0cTransparency\x18\x0b \x01(\x05\x12\x11\n\tPosRatioX\x18\x0c \x01(\x01\x12\x11\n\tPosRatioY\x18\r \x01(\x01\x12\x12\n\nSizeRatioX\x18\x0e \x01(\x01\x12\x12\n\nSizeRatioY\x18\x0f \x01(\x01\"\x9b\x02\n\x13VideoLogoDefinition\x12\x0b\n\x03Mid\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\x05\x12\x11\n\tLoopTimes\x18\x04 \x01(\x05\x12\x12\n\nRepeatLast\x18\x05 \x01(\x08\x12\x0e\n\x06Locate\x18\x06 \x01(\t\x12\x0c\n\x04PosX\x18\x07 \x01(\x05\x12\x0c\n\x04PosY\x18\x08 \x01(\x05\x12\r\n\x05SizeX\x18\t \x01(\x05\x12\r\n\x05SizeY\x18\n \x01(\x05\x12\x14\n\x0cTransparency\x18\x0b \x01(\x05\x12\x11\n\tPosRatioX\x18\x0c \x01(\x01\x12\x11\n\tPosRatioY\x18\r \x01(\x01\x12\x12\n\nSizeRatioX\x18\x0e \x01(\x01\x12\x12\n\nSizeRatioY\x18\x0f \x01(\x01\"\x98\x02\n\x12TextLogoDefinition\x12\x0f\n\x07\x43ontent\x18\x01 \x01(\t\x12\x10\n\x08\x46ontType\x18\x02 \x01(\t\x12\x10\n\x08\x46ontSize\x18\x03 \x01(\x05\x12\x11\n\tFontColor\x18\x04 \x01(\t\x12\x11\n\tStartTime\x18\x05 \x01(\x05\x12\x0f\n\x07\x45ndTime\x18\x06 \x01(\x05\x12\x0e\n\x06Locate\x18\x07 \x01(\t\x12\x0c\n\x04PosX\x18\x08 \x01(\x05\x12\x0c\n\x04PosY\x18\t \x01(\x05\x12\r\n\x05SizeX\x18\n \x01(\x05\x12\r\n\x05SizeY\x18\x0b \x01(\x05\x12\x11\n\tPosRatioX\x18\x0c \x01(\x01\x12\x11\n\tPosRatioY\x18\r \x01(\x01\x12\x12\n\nSizeRatioX\x18\x0e \x01(\x01\x12\x12\n\nSizeRatioY\x18\x0f \x01(\x01\"\x92\x02\n\x0eLogoDefinition\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12P\n\x13ImageLogoDefinition\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.ImageLogoDefinition\x12P\n\x13VideoLogoDefinition\x18\x03 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VideoLogoDefinition\x12N\n\x12TextLogoDefinition\x18\x04 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.TextLogoDefinition\"=\n\nFontShadow\x12\r\n\x05\x43olor\x18\x01 \x01(\t\x12\x0f\n\x07OffsetX\x18\x02 \x01(\x05\x12\x0f\n\x07OffsetY\x18\x03 \x01(\x05\"\x90\x01\n\x0b\x41\x64\x61ptConcat\x12>\n\nAnchorSize\x18\x01 \x01(\x0b\x32*.Volcengine.Vod.Models.Business.AnchorSize\x12\x41\n\x07\x43oncats\x18\x02 \x03(\x0b\x32\x30.Volcengine.Vod.Models.Business.ConcatDefinition\"?\n\x10\x43oncatDefinition\x12\x0c\n\x04Type\x18\x01 \x01(\t\x12\x0b\n\x03Mid\x18\x02 \x01(\t\x12\x10\n\x08Position\x18\x04 \x01(\t\"3\n\x12HiddenWatermarkAdd\x12\x0f\n\x07\x43ontent\x18\x01 \x01(\t\x12\x0c\n\x04Type\x18\x03 \x01(\t\"\x8a\x01\n\x1eVodListWatermarkResponseResult\x12\r\n\x05Limit\x18\x01 \x01(\x05\x12\x0e\n\x06Offset\x18\x02 \x01(\x05\x12\r\n\x05Total\x18\x03 \x01(\x03\x12:\n\x04\x44\x61ta\x18\x04 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.LogoTemplate\"\xc9\x02\n\x05Video\x12\x0b\n\x03Res\x18\x01 \x01(\t\x12\x11\n\tScaleType\x18\x04 \x01(\x05\x12\x11\n\tScaleMode\x18\x16 \x01(\x05\x12\x12\n\nScaleWidth\x18\x05 \x01(\x05\x12\x13\n\x0bScaleHeight\x18\x06 \x01(\x05\x12\x12\n\nScaleShort\x18\x07 \x01(\x05\x12\x11\n\tScaleLong\x18\x08 \x01(\x05\x12\r\n\x05\x43odec\x18\t \x01(\t\x12\x17\n\x0fRateControlMode\x18\n \x01(\t\x12\x12\n\nMaxBitrate\x18\x0b \x01(\x05\x12\x0f\n\x07\x42itrate\x18\x0c \x01(\x05\x12\x0b\n\x03\x43rf\x18\r \x01(\x02\x12\x0e\n\x06MaxFps\x18\x0f \x01(\x05\x12\r\n\x05Vsync\x18\x10 \x01(\t\x12\x0b\n\x03\x46ps\x18\x11 \x01(\x02\x12\x0f\n\x07HDRMode\x18\x15 \x01(\x05\x12\x0f\n\x07GopSize\x18\x18 \x01(\x05\x12\x15\n\rDisableBFrame\x18\x19 \x01(\x08\"\x99\x01\n\x05\x41udio\x12\r\n\x05\x43odec\x18\x01 \x01(\t\x12\x12\n\nSampleRate\x18\x02 \x01(\x05\x12\x17\n\x0fRateControlMode\x18\x03 \x01(\t\x12\x0f\n\x07\x42itrate\x18\x04 \x01(\x05\x12\x0f\n\x07MinRate\x18\x05 \x01(\x05\x12\x0f\n\x07MaxRate\x18\x06 \x01(\x05\x12\x10\n\x08\x43hannels\x18\x07 \x01(\x05\x12\x0f\n\x07Profile\x18\x08 \x01(\t\"9\n\x07Segment\x12\x0e\n\x06\x46ormat\x18\x01 \x01(\t\x12\x0c\n\x04Type\x18\x02 \x01(\t\x12\x10\n\x08\x44uration\x18\x03 \x01(\x05\"\x84\x02\n\tCondition\x12\x10\n\x08ResRange\x18\x01 \x01(\t\x12\x14\n\x0cLongResRange\x18\x02 \x01(\t\x12\x15\n\rDurationRange\x18\x03 \x01(\t\x12\x10\n\x08\x46psRange\x18\x04 \x01(\t\x12\x14\n\x0c\x42itrateRange\x18\x05 \x01(\t\x12\x19\n\x11\x41udioBitrateRange\x18\x06 \x01(\t\x12\x10\n\x08\x46ileType\x18\x07 \x01(\t\x12\x14\n\x0cVQScoreRange\x18\x08 \x01(\t\x12\x1a\n\x12VideoDurationRange\x18\t \x01(\t\x12\x1a\n\x12\x41udioDurationRange\x18\n \x01(\t\x12\x15\n\rUserCondition\x18\x0b \x01(\t\"!\n\x0eParallelParams\x12\x0f\n\x07\x45nabled\x18\x01 \x01(\x08\"\x1c\n\nEncryption\x12\x0e\n\x06Vendor\x18\x01 \x01(\t\"j\n\x06Volume\x12\x0e\n\x06Method\x18\x01 \x01(\t\x12\x1a\n\x12IntegratedLoudness\x18\x02 \x01(\x01\x12\x10\n\x08TruePeak\x18\x03 \x01(\x01\x12\x0e\n\x06Volume\x18\x04 \x01(\x01\x12\x12\n\nVolumeTime\x18\x05 \x01(\x01*z\n\x0bStageStatus\x12\x0b\n\x07Unknown\x10\x00\x12\r\n\tScheduled\x10\x01\x12\x0b\n\x07Running\x10\x02\x12\x0c\n\x08\x43\x61nceled\x10\x03\x12\x0c\n\x08TimedOut\x10\x04\x12\x0b\n\x07Skipped\x10\x05\x12\r\n\tCompleted\x10\x06\x12\n\n\x06\x46\x61iled\x10\x07\x42\xcc\x01\n)com.volcengine.service.vod.model.businessB\x0bVodWorkflowP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Vod\\Models\\Business\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _STAGESTATUS = DESCRIPTOR.enum_types_by_name['StageStatus'] StageStatus = enum_type_wrapper.EnumTypeWrapper(_STAGESTATUS) Unknown = 0 Scheduled = 1 Running = 2 Canceled = 3 TimedOut = 4 Skipped = 5 Completed = 6 Failed = 7 _VODSTARTWORKFLOWRESULT = DESCRIPTOR.message_types_by_name['VodStartWorkflowResult'] _DIRECTURL = DESCRIPTOR.message_types_by_name['DirectUrl'] _WORKFLOWPARAMS = DESCRIPTOR.message_types_by_name['WorkflowParams'] _WORKFLOWPARAMS_CONDITIONENTRY = _WORKFLOWPARAMS.nested_types_by_name['ConditionEntry'] _OVERRIDEPARAMS = DESCRIPTOR.message_types_by_name['OverrideParams'] _LOGOOVERRIDE = DESCRIPTOR.message_types_by_name['LogoOverride'] _LOGOOVERRIDE_VARSENTRY = _LOGOOVERRIDE.nested_types_by_name['VarsEntry'] _TRANSCODEVIDEOOVERRIDE = DESCRIPTOR.message_types_by_name['TranscodeVideoOverride'] _CLIP = DESCRIPTOR.message_types_by_name['Clip'] _TRANSCODEAUDIOOVERRIDE = DESCRIPTOR.message_types_by_name['TranscodeAudioOverride'] _SNAPSHOTOVERRIDE = DESCRIPTOR.message_types_by_name['SnapshotOverride'] _ENHANCEOVERRIDE = DESCRIPTOR.message_types_by_name['EnhanceOverride'] _TRANSCODERESULT = DESCRIPTOR.message_types_by_name['TranscodeResult'] _INSPECTION = DESCRIPTOR.message_types_by_name['Inspection'] _QUALITY = DESCRIPTOR.message_types_by_name['Quality'] _DELOGOINFO = DESCRIPTOR.message_types_by_name['DeLogoInfo'] _VISUALQUALITY = DESCRIPTOR.message_types_by_name['VisualQuality'] _VOLUMEINFO = DESCRIPTOR.message_types_by_name['VolumeInfo'] _CATEGORYTAGINFO = DESCRIPTOR.message_types_by_name['CategoryTagInfo'] _CATEGORYTAGINFO_PARENTINFOENTRY = _CATEGORYTAGINFO.nested_types_by_name['ParentInfoEntry'] _VODLISTWORKFLOWEXECUTIONRESULT = DESCRIPTOR.message_types_by_name['VodListWorkflowExecutionResult'] _WORKFLOWEXECUTION = DESCRIPTOR.message_types_by_name['WorkflowExecution'] _VODGETWORKFLOWEXECUTIONDETAILRESULT = DESCRIPTOR.message_types_by_name['VodGetWorkflowExecutionDetailResult'] _EXECUTIONSTAGE = DESCRIPTOR.message_types_by_name['ExecutionStage'] _STAGEDETAIL = DESCRIPTOR.message_types_by_name['StageDetail'] _TASKDETAIL = DESCRIPTOR.message_types_by_name['TaskDetail'] _SNAPSHOTPARAMSPOSTER = DESCRIPTOR.message_types_by_name['SnapshotParamsPoster'] _SNAPSHOTPARAMSDYNPOST = DESCRIPTOR.message_types_by_name['SnapshotParamsDynpost'] _SNAPSHOTPARAMSAIDYNPOST = DESCRIPTOR.message_types_by_name['SnapshotParamsAIDynpost'] _SNAPSHOTPARAMSANIMATEDPOSTER = DESCRIPTOR.message_types_by_name['SnapshotParamsAnimatedPoster'] _SNAPSHOTPARAMSSPRITE = DESCRIPTOR.message_types_by_name['SnapshotParamsSprite'] _SNAPSHOTPARAMSSAMPLE = DESCRIPTOR.message_types_by_name['SnapshotParamsSample'] _SNAPSHOTRESULT = DESCRIPTOR.message_types_by_name['SnapshotResult'] _VODWORKFLOWRESULT = DESCRIPTOR.message_types_by_name['VodWorkflowResult'] _TASKTEMPLATE = DESCRIPTOR.message_types_by_name['TaskTemplate'] _TRANSCODEVIDEOTASKPARAMS = DESCRIPTOR.message_types_by_name['TranscodeVideoTaskParams'] _BYTEHDTASKPARAMS = DESCRIPTOR.message_types_by_name['ByteHDTaskParams'] _TRANSCODEAUDIOTASKPARAMS = DESCRIPTOR.message_types_by_name['TranscodeAudioTaskParams'] _SNAPSHOTTASKPARAMS = DESCRIPTOR.message_types_by_name['SnapshotTaskParams'] _POSTERSNAPSHOTPARAMS = DESCRIPTOR.message_types_by_name['PosterSnapshotParams'] _DYNPOSTSNAPSHOTPARAMS = DESCRIPTOR.message_types_by_name['DynpostSnapshotParams'] _ANIMATEDPOSTERSNAPSHOTPARAMS = DESCRIPTOR.message_types_by_name['AnimatedPosterSnapshotParams'] _SPRITESNAPSHOTPARAMS = DESCRIPTOR.message_types_by_name['SpriteSnapshotParams'] _SAMPLESNAPSHOTPARAMS = DESCRIPTOR.message_types_by_name['SampleSnapshotParams'] _VODTASKTEMPLATERESULT = DESCRIPTOR.message_types_by_name['VodTaskTemplateResult'] _VODLISTTASKTEMPLATERESULT = DESCRIPTOR.message_types_by_name['VodListTaskTemplateResult'] _WORKFLOWTEMPLATE = DESCRIPTOR.message_types_by_name['WorkflowTemplate'] _ACTIVITY = DESCRIPTOR.message_types_by_name['Activity'] _TRANSCODEACTIVITY = DESCRIPTOR.message_types_by_name['TranscodeActivity'] _TRANSCODEACTIVITY_ENHANCEPARAMS = _TRANSCODEACTIVITY.nested_types_by_name['EnhanceParams'] _TRANSCODEACTIVITY_LOGOPARAMS = _TRANSCODEACTIVITY.nested_types_by_name['LogoParams'] _TRANSCODEACTIVITY_SUBTITLEPARAMS = _TRANSCODEACTIVITY.nested_types_by_name['SubtitleParams'] _SNAPSHOTACTIVITY = DESCRIPTOR.message_types_by_name['SnapshotActivity'] _ENDACTIVITY = DESCRIPTOR.message_types_by_name['EndActivity'] _VODWORKFLOWTEMPLATERESULT = DESCRIPTOR.message_types_by_name['VodWorkflowTemplateResult'] _VODLISTWORKFLOWTEMPLATERESULT = DESCRIPTOR.message_types_by_name['VodListWorkflowTemplateResult'] _LOGOTEMPLATE = DESCRIPTOR.message_types_by_name['LogoTemplate'] _ADAPTLOGO = DESCRIPTOR.message_types_by_name['AdaptLogo'] _ANCHORSIZE = DESCRIPTOR.message_types_by_name['AnchorSize'] _IMAGELOGODEFINITION = DESCRIPTOR.message_types_by_name['ImageLogoDefinition'] _VIDEOLOGODEFINITION = DESCRIPTOR.message_types_by_name['VideoLogoDefinition'] _TEXTLOGODEFINITION = DESCRIPTOR.message_types_by_name['TextLogoDefinition'] _LOGODEFINITION = DESCRIPTOR.message_types_by_name['LogoDefinition'] _FONTSHADOW = DESCRIPTOR.message_types_by_name['FontShadow'] _ADAPTCONCAT = DESCRIPTOR.message_types_by_name['AdaptConcat'] _CONCATDEFINITION = DESCRIPTOR.message_types_by_name['ConcatDefinition'] _HIDDENWATERMARKADD = DESCRIPTOR.message_types_by_name['HiddenWatermarkAdd'] _VODLISTWATERMARKRESPONSERESULT = DESCRIPTOR.message_types_by_name['VodListWatermarkResponseResult'] _VIDEO = DESCRIPTOR.message_types_by_name['Video'] _AUDIO = DESCRIPTOR.message_types_by_name['Audio'] _SEGMENT = DESCRIPTOR.message_types_by_name['Segment'] _CONDITION = DESCRIPTOR.message_types_by_name['Condition'] _PARALLELPARAMS = DESCRIPTOR.message_types_by_name['ParallelParams'] _ENCRYPTION = DESCRIPTOR.message_types_by_name['Encryption'] _VOLUME = DESCRIPTOR.message_types_by_name['Volume'] VodStartWorkflowResult = _reflection.GeneratedProtocolMessageType('VodStartWorkflowResult', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTWORKFLOWRESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodStartWorkflowResult) }) _sym_db.RegisterMessage(VodStartWorkflowResult) DirectUrl = _reflection.GeneratedProtocolMessageType('DirectUrl', (_message.Message,), { 'DESCRIPTOR' : _DIRECTURL, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DirectUrl) }) _sym_db.RegisterMessage(DirectUrl) WorkflowParams = _reflection.GeneratedProtocolMessageType('WorkflowParams', (_message.Message,), { 'ConditionEntry' : _reflection.GeneratedProtocolMessageType('ConditionEntry', (_message.Message,), { 'DESCRIPTOR' : _WORKFLOWPARAMS_CONDITIONENTRY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.WorkflowParams.ConditionEntry) }) , 'DESCRIPTOR' : _WORKFLOWPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.WorkflowParams) }) _sym_db.RegisterMessage(WorkflowParams) _sym_db.RegisterMessage(WorkflowParams.ConditionEntry) OverrideParams = _reflection.GeneratedProtocolMessageType('OverrideParams', (_message.Message,), { 'DESCRIPTOR' : _OVERRIDEPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.OverrideParams) }) _sym_db.RegisterMessage(OverrideParams) LogoOverride = _reflection.GeneratedProtocolMessageType('LogoOverride', (_message.Message,), { 'VarsEntry' : _reflection.GeneratedProtocolMessageType('VarsEntry', (_message.Message,), { 'DESCRIPTOR' : _LOGOOVERRIDE_VARSENTRY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.LogoOverride.VarsEntry) }) , 'DESCRIPTOR' : _LOGOOVERRIDE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.LogoOverride) }) _sym_db.RegisterMessage(LogoOverride) _sym_db.RegisterMessage(LogoOverride.VarsEntry) TranscodeVideoOverride = _reflection.GeneratedProtocolMessageType('TranscodeVideoOverride', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEVIDEOOVERRIDE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeVideoOverride) }) _sym_db.RegisterMessage(TranscodeVideoOverride) Clip = _reflection.GeneratedProtocolMessageType('Clip', (_message.Message,), { 'DESCRIPTOR' : _CLIP, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Clip) }) _sym_db.RegisterMessage(Clip) TranscodeAudioOverride = _reflection.GeneratedProtocolMessageType('TranscodeAudioOverride', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEAUDIOOVERRIDE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeAudioOverride) }) _sym_db.RegisterMessage(TranscodeAudioOverride) SnapshotOverride = _reflection.GeneratedProtocolMessageType('SnapshotOverride', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTOVERRIDE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotOverride) }) _sym_db.RegisterMessage(SnapshotOverride) EnhanceOverride = _reflection.GeneratedProtocolMessageType('EnhanceOverride', (_message.Message,), { 'DESCRIPTOR' : _ENHANCEOVERRIDE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.EnhanceOverride) }) _sym_db.RegisterMessage(EnhanceOverride) TranscodeResult = _reflection.GeneratedProtocolMessageType('TranscodeResult', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeResult) }) _sym_db.RegisterMessage(TranscodeResult) Inspection = _reflection.GeneratedProtocolMessageType('Inspection', (_message.Message,), { 'DESCRIPTOR' : _INSPECTION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Inspection) }) _sym_db.RegisterMessage(Inspection) Quality = _reflection.GeneratedProtocolMessageType('Quality', (_message.Message,), { 'DESCRIPTOR' : _QUALITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Quality) }) _sym_db.RegisterMessage(Quality) DeLogoInfo = _reflection.GeneratedProtocolMessageType('DeLogoInfo', (_message.Message,), { 'DESCRIPTOR' : _DELOGOINFO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DeLogoInfo) }) _sym_db.RegisterMessage(DeLogoInfo) VisualQuality = _reflection.GeneratedProtocolMessageType('VisualQuality', (_message.Message,), { 'DESCRIPTOR' : _VISUALQUALITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VisualQuality) }) _sym_db.RegisterMessage(VisualQuality) VolumeInfo = _reflection.GeneratedProtocolMessageType('VolumeInfo', (_message.Message,), { 'DESCRIPTOR' : _VOLUMEINFO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VolumeInfo) }) _sym_db.RegisterMessage(VolumeInfo) CategoryTagInfo = _reflection.GeneratedProtocolMessageType('CategoryTagInfo', (_message.Message,), { 'ParentInfoEntry' : _reflection.GeneratedProtocolMessageType('ParentInfoEntry', (_message.Message,), { 'DESCRIPTOR' : _CATEGORYTAGINFO_PARENTINFOENTRY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CategoryTagInfo.ParentInfoEntry) }) , 'DESCRIPTOR' : _CATEGORYTAGINFO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.CategoryTagInfo) }) _sym_db.RegisterMessage(CategoryTagInfo) _sym_db.RegisterMessage(CategoryTagInfo.ParentInfoEntry) VodListWorkflowExecutionResult = _reflection.GeneratedProtocolMessageType('VodListWorkflowExecutionResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWEXECUTIONRESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListWorkflowExecutionResult) }) _sym_db.RegisterMessage(VodListWorkflowExecutionResult) WorkflowExecution = _reflection.GeneratedProtocolMessageType('WorkflowExecution', (_message.Message,), { 'DESCRIPTOR' : _WORKFLOWEXECUTION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.WorkflowExecution) }) _sym_db.RegisterMessage(WorkflowExecution) VodGetWorkflowExecutionDetailResult = _reflection.GeneratedProtocolMessageType('VodGetWorkflowExecutionDetailResult', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWEXECUTIONDETAILRESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodGetWorkflowExecutionDetailResult) }) _sym_db.RegisterMessage(VodGetWorkflowExecutionDetailResult) ExecutionStage = _reflection.GeneratedProtocolMessageType('ExecutionStage', (_message.Message,), { 'DESCRIPTOR' : _EXECUTIONSTAGE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ExecutionStage) }) _sym_db.RegisterMessage(ExecutionStage) StageDetail = _reflection.GeneratedProtocolMessageType('StageDetail', (_message.Message,), { 'DESCRIPTOR' : _STAGEDETAIL, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.StageDetail) }) _sym_db.RegisterMessage(StageDetail) TaskDetail = _reflection.GeneratedProtocolMessageType('TaskDetail', (_message.Message,), { 'DESCRIPTOR' : _TASKDETAIL, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TaskDetail) }) _sym_db.RegisterMessage(TaskDetail) SnapshotParamsPoster = _reflection.GeneratedProtocolMessageType('SnapshotParamsPoster', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSPOSTER, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsPoster) }) _sym_db.RegisterMessage(SnapshotParamsPoster) SnapshotParamsDynpost = _reflection.GeneratedProtocolMessageType('SnapshotParamsDynpost', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSDYNPOST, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsDynpost) }) _sym_db.RegisterMessage(SnapshotParamsDynpost) SnapshotParamsAIDynpost = _reflection.GeneratedProtocolMessageType('SnapshotParamsAIDynpost', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSAIDYNPOST, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsAIDynpost) }) _sym_db.RegisterMessage(SnapshotParamsAIDynpost) SnapshotParamsAnimatedPoster = _reflection.GeneratedProtocolMessageType('SnapshotParamsAnimatedPoster', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSANIMATEDPOSTER, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsAnimatedPoster) }) _sym_db.RegisterMessage(SnapshotParamsAnimatedPoster) SnapshotParamsSprite = _reflection.GeneratedProtocolMessageType('SnapshotParamsSprite', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSSPRITE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsSprite) }) _sym_db.RegisterMessage(SnapshotParamsSprite) SnapshotParamsSample = _reflection.GeneratedProtocolMessageType('SnapshotParamsSample', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTPARAMSSAMPLE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotParamsSample) }) _sym_db.RegisterMessage(SnapshotParamsSample) SnapshotResult = _reflection.GeneratedProtocolMessageType('SnapshotResult', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTRESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotResult) }) _sym_db.RegisterMessage(SnapshotResult) VodWorkflowResult = _reflection.GeneratedProtocolMessageType('VodWorkflowResult', (_message.Message,), { 'DESCRIPTOR' : _VODWORKFLOWRESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodWorkflowResult) }) _sym_db.RegisterMessage(VodWorkflowResult) TaskTemplate = _reflection.GeneratedProtocolMessageType('TaskTemplate', (_message.Message,), { 'DESCRIPTOR' : _TASKTEMPLATE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TaskTemplate) }) _sym_db.RegisterMessage(TaskTemplate) TranscodeVideoTaskParams = _reflection.GeneratedProtocolMessageType('TranscodeVideoTaskParams', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEVIDEOTASKPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeVideoTaskParams) }) _sym_db.RegisterMessage(TranscodeVideoTaskParams) ByteHDTaskParams = _reflection.GeneratedProtocolMessageType('ByteHDTaskParams', (_message.Message,), { 'DESCRIPTOR' : _BYTEHDTASKPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ByteHDTaskParams) }) _sym_db.RegisterMessage(ByteHDTaskParams) TranscodeAudioTaskParams = _reflection.GeneratedProtocolMessageType('TranscodeAudioTaskParams', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEAUDIOTASKPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeAudioTaskParams) }) _sym_db.RegisterMessage(TranscodeAudioTaskParams) SnapshotTaskParams = _reflection.GeneratedProtocolMessageType('SnapshotTaskParams', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTTASKPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotTaskParams) }) _sym_db.RegisterMessage(SnapshotTaskParams) PosterSnapshotParams = _reflection.GeneratedProtocolMessageType('PosterSnapshotParams', (_message.Message,), { 'DESCRIPTOR' : _POSTERSNAPSHOTPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.PosterSnapshotParams) }) _sym_db.RegisterMessage(PosterSnapshotParams) DynpostSnapshotParams = _reflection.GeneratedProtocolMessageType('DynpostSnapshotParams', (_message.Message,), { 'DESCRIPTOR' : _DYNPOSTSNAPSHOTPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.DynpostSnapshotParams) }) _sym_db.RegisterMessage(DynpostSnapshotParams) AnimatedPosterSnapshotParams = _reflection.GeneratedProtocolMessageType('AnimatedPosterSnapshotParams', (_message.Message,), { 'DESCRIPTOR' : _ANIMATEDPOSTERSNAPSHOTPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AnimatedPosterSnapshotParams) }) _sym_db.RegisterMessage(AnimatedPosterSnapshotParams) SpriteSnapshotParams = _reflection.GeneratedProtocolMessageType('SpriteSnapshotParams', (_message.Message,), { 'DESCRIPTOR' : _SPRITESNAPSHOTPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SpriteSnapshotParams) }) _sym_db.RegisterMessage(SpriteSnapshotParams) SampleSnapshotParams = _reflection.GeneratedProtocolMessageType('SampleSnapshotParams', (_message.Message,), { 'DESCRIPTOR' : _SAMPLESNAPSHOTPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SampleSnapshotParams) }) _sym_db.RegisterMessage(SampleSnapshotParams) VodTaskTemplateResult = _reflection.GeneratedProtocolMessageType('VodTaskTemplateResult', (_message.Message,), { 'DESCRIPTOR' : _VODTASKTEMPLATERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodTaskTemplateResult) }) _sym_db.RegisterMessage(VodTaskTemplateResult) VodListTaskTemplateResult = _reflection.GeneratedProtocolMessageType('VodListTaskTemplateResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTTASKTEMPLATERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListTaskTemplateResult) }) _sym_db.RegisterMessage(VodListTaskTemplateResult) WorkflowTemplate = _reflection.GeneratedProtocolMessageType('WorkflowTemplate', (_message.Message,), { 'DESCRIPTOR' : _WORKFLOWTEMPLATE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.WorkflowTemplate) }) _sym_db.RegisterMessage(WorkflowTemplate) Activity = _reflection.GeneratedProtocolMessageType('Activity', (_message.Message,), { 'DESCRIPTOR' : _ACTIVITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Activity) }) _sym_db.RegisterMessage(Activity) TranscodeActivity = _reflection.GeneratedProtocolMessageType('TranscodeActivity', (_message.Message,), { 'EnhanceParams' : _reflection.GeneratedProtocolMessageType('EnhanceParams', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEACTIVITY_ENHANCEPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeActivity.EnhanceParams) }) , 'LogoParams' : _reflection.GeneratedProtocolMessageType('LogoParams', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEACTIVITY_LOGOPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeActivity.LogoParams) }) , 'SubtitleParams' : _reflection.GeneratedProtocolMessageType('SubtitleParams', (_message.Message,), { 'DESCRIPTOR' : _TRANSCODEACTIVITY_SUBTITLEPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeActivity.SubtitleParams) }) , 'DESCRIPTOR' : _TRANSCODEACTIVITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TranscodeActivity) }) _sym_db.RegisterMessage(TranscodeActivity) _sym_db.RegisterMessage(TranscodeActivity.EnhanceParams) _sym_db.RegisterMessage(TranscodeActivity.LogoParams) _sym_db.RegisterMessage(TranscodeActivity.SubtitleParams) SnapshotActivity = _reflection.GeneratedProtocolMessageType('SnapshotActivity', (_message.Message,), { 'DESCRIPTOR' : _SNAPSHOTACTIVITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.SnapshotActivity) }) _sym_db.RegisterMessage(SnapshotActivity) EndActivity = _reflection.GeneratedProtocolMessageType('EndActivity', (_message.Message,), { 'DESCRIPTOR' : _ENDACTIVITY, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.EndActivity) }) _sym_db.RegisterMessage(EndActivity) VodWorkflowTemplateResult = _reflection.GeneratedProtocolMessageType('VodWorkflowTemplateResult', (_message.Message,), { 'DESCRIPTOR' : _VODWORKFLOWTEMPLATERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodWorkflowTemplateResult) }) _sym_db.RegisterMessage(VodWorkflowTemplateResult) VodListWorkflowTemplateResult = _reflection.GeneratedProtocolMessageType('VodListWorkflowTemplateResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWTEMPLATERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListWorkflowTemplateResult) }) _sym_db.RegisterMessage(VodListWorkflowTemplateResult) LogoTemplate = _reflection.GeneratedProtocolMessageType('LogoTemplate', (_message.Message,), { 'DESCRIPTOR' : _LOGOTEMPLATE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.LogoTemplate) }) _sym_db.RegisterMessage(LogoTemplate) AdaptLogo = _reflection.GeneratedProtocolMessageType('AdaptLogo', (_message.Message,), { 'DESCRIPTOR' : _ADAPTLOGO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AdaptLogo) }) _sym_db.RegisterMessage(AdaptLogo) AnchorSize = _reflection.GeneratedProtocolMessageType('AnchorSize', (_message.Message,), { 'DESCRIPTOR' : _ANCHORSIZE, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AnchorSize) }) _sym_db.RegisterMessage(AnchorSize) ImageLogoDefinition = _reflection.GeneratedProtocolMessageType('ImageLogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _IMAGELOGODEFINITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ImageLogoDefinition) }) _sym_db.RegisterMessage(ImageLogoDefinition) VideoLogoDefinition = _reflection.GeneratedProtocolMessageType('VideoLogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _VIDEOLOGODEFINITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VideoLogoDefinition) }) _sym_db.RegisterMessage(VideoLogoDefinition) TextLogoDefinition = _reflection.GeneratedProtocolMessageType('TextLogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _TEXTLOGODEFINITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.TextLogoDefinition) }) _sym_db.RegisterMessage(TextLogoDefinition) LogoDefinition = _reflection.GeneratedProtocolMessageType('LogoDefinition', (_message.Message,), { 'DESCRIPTOR' : _LOGODEFINITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.LogoDefinition) }) _sym_db.RegisterMessage(LogoDefinition) FontShadow = _reflection.GeneratedProtocolMessageType('FontShadow', (_message.Message,), { 'DESCRIPTOR' : _FONTSHADOW, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.FontShadow) }) _sym_db.RegisterMessage(FontShadow) AdaptConcat = _reflection.GeneratedProtocolMessageType('AdaptConcat', (_message.Message,), { 'DESCRIPTOR' : _ADAPTCONCAT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.AdaptConcat) }) _sym_db.RegisterMessage(AdaptConcat) ConcatDefinition = _reflection.GeneratedProtocolMessageType('ConcatDefinition', (_message.Message,), { 'DESCRIPTOR' : _CONCATDEFINITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ConcatDefinition) }) _sym_db.RegisterMessage(ConcatDefinition) HiddenWatermarkAdd = _reflection.GeneratedProtocolMessageType('HiddenWatermarkAdd', (_message.Message,), { 'DESCRIPTOR' : _HIDDENWATERMARKADD, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.HiddenWatermarkAdd) }) _sym_db.RegisterMessage(HiddenWatermarkAdd) VodListWatermarkResponseResult = _reflection.GeneratedProtocolMessageType('VodListWatermarkResponseResult', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWATERMARKRESPONSERESULT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.VodListWatermarkResponseResult) }) _sym_db.RegisterMessage(VodListWatermarkResponseResult) Video = _reflection.GeneratedProtocolMessageType('Video', (_message.Message,), { 'DESCRIPTOR' : _VIDEO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Video) }) _sym_db.RegisterMessage(Video) Audio = _reflection.GeneratedProtocolMessageType('Audio', (_message.Message,), { 'DESCRIPTOR' : _AUDIO, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Audio) }) _sym_db.RegisterMessage(Audio) Segment = _reflection.GeneratedProtocolMessageType('Segment', (_message.Message,), { 'DESCRIPTOR' : _SEGMENT, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Segment) }) _sym_db.RegisterMessage(Segment) Condition = _reflection.GeneratedProtocolMessageType('Condition', (_message.Message,), { 'DESCRIPTOR' : _CONDITION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Condition) }) _sym_db.RegisterMessage(Condition) ParallelParams = _reflection.GeneratedProtocolMessageType('ParallelParams', (_message.Message,), { 'DESCRIPTOR' : _PARALLELPARAMS, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.ParallelParams) }) _sym_db.RegisterMessage(ParallelParams) Encryption = _reflection.GeneratedProtocolMessageType('Encryption', (_message.Message,), { 'DESCRIPTOR' : _ENCRYPTION, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Encryption) }) _sym_db.RegisterMessage(Encryption) Volume = _reflection.GeneratedProtocolMessageType('Volume', (_message.Message,), { 'DESCRIPTOR' : _VOLUME, '__module__' : 'volcengine.vod.business.vod_workflow_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Business.Volume) }) _sym_db.RegisterMessage(Volume) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.businessB\013VodWorkflowP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/business\240\001\001\330\001\001\312\002 Volc\\Service\\Vod\\Models\\Business\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _WORKFLOWPARAMS_CONDITIONENTRY._options = None _WORKFLOWPARAMS_CONDITIONENTRY._serialized_options = b'8\001' _LOGOOVERRIDE_VARSENTRY._options = None _LOGOOVERRIDE_VARSENTRY._serialized_options = b'8\001' _CATEGORYTAGINFO_PARENTINFOENTRY._options = None _CATEGORYTAGINFO_PARENTINFOENTRY._serialized_options = b'8\001' _STAGESTATUS._serialized_start=14189 _STAGESTATUS._serialized_end=14311 _VODSTARTWORKFLOWRESULT._serialized_start=153 _VODSTARTWORKFLOWRESULT._serialized_end=192 _DIRECTURL._serialized_start=194 _DIRECTURL._serialized_end=262 _WORKFLOWPARAMS._serialized_start=265 _WORKFLOWPARAMS._serialized_end=485 _WORKFLOWPARAMS_CONDITIONENTRY._serialized_start=437 _WORKFLOWPARAMS_CONDITIONENTRY._serialized_end=485 _OVERRIDEPARAMS._serialized_start=488 _OVERRIDEPARAMS._serialized_end=858 _LOGOOVERRIDE._serialized_start=861 _LOGOOVERRIDE._serialized_end=1010 _LOGOOVERRIDE_VARSENTRY._serialized_start=967 _LOGOOVERRIDE_VARSENTRY._serialized_end=1010 _TRANSCODEVIDEOOVERRIDE._serialized_start=1013 _TRANSCODEVIDEOOVERRIDE._serialized_end=1172 _CLIP._serialized_start=1174 _CLIP._serialized_end=1216 _TRANSCODEAUDIOOVERRIDE._serialized_start=1218 _TRANSCODEAUDIOOVERRIDE._serialized_end=1332 _SNAPSHOTOVERRIDE._serialized_start=1335 _SNAPSHOTOVERRIDE._serialized_end=1539 _ENHANCEOVERRIDE._serialized_start=1541 _ENHANCEOVERRIDE._serialized_end=1597 _TRANSCODERESULT._serialized_start=1600 _TRANSCODERESULT._serialized_end=1765 _INSPECTION._serialized_start=1768 _INSPECTION._serialized_end=1898 _QUALITY._serialized_start=1901 _QUALITY._serialized_end=2037 _DELOGOINFO._serialized_start=2039 _DELOGOINFO._serialized_end=2152 _VISUALQUALITY._serialized_start=2154 _VISUALQUALITY._serialized_end=2278 _VOLUMEINFO._serialized_start=2280 _VOLUMEINFO._serialized_end=2363 _CATEGORYTAGINFO._serialized_start=2366 _CATEGORYTAGINFO._serialized_end=2580 _CATEGORYTAGINFO_PARENTINFOENTRY._serialized_start=2531 _CATEGORYTAGINFO_PARENTINFOENTRY._serialized_end=2580 _VODLISTWORKFLOWEXECUTIONRESULT._serialized_start=2583 _VODLISTWORKFLOWEXECUTIONRESULT._serialized_end=2734 _WORKFLOWEXECUTION._serialized_start=2737 _WORKFLOWEXECUTION._serialized_end=3297 _VODGETWORKFLOWEXECUTIONDETAILRESULT._serialized_start=3300 _VODGETWORKFLOWEXECUTIONDETAILRESULT._serialized_end=3752 _EXECUTIONSTAGE._serialized_start=3755 _EXECUTIONSTAGE._serialized_end=3950 _STAGEDETAIL._serialized_start=3953 _STAGEDETAIL._serialized_end=4222 _TASKDETAIL._serialized_start=4225 _TASKDETAIL._serialized_end=4449 _SNAPSHOTPARAMSPOSTER._serialized_start=4451 _SNAPSHOTPARAMSPOSTER._serialized_end=4538 _SNAPSHOTPARAMSDYNPOST._serialized_start=4540 _SNAPSHOTPARAMSDYNPOST._serialized_end=4628 _SNAPSHOTPARAMSAIDYNPOST._serialized_start=4630 _SNAPSHOTPARAMSAIDYNPOST._serialized_end=4720 _SNAPSHOTPARAMSANIMATEDPOSTER._serialized_start=4722 _SNAPSHOTPARAMSANIMATEDPOSTER._serialized_end=4817 _SNAPSHOTPARAMSSPRITE._serialized_start=4820 _SNAPSHOTPARAMSSPRITE._serialized_end=4988 _SNAPSHOTPARAMSSAMPLE._serialized_start=4991 _SNAPSHOTPARAMSSAMPLE._serialized_end=5170 _SNAPSHOTRESULT._serialized_start=5173 _SNAPSHOTRESULT._serialized_end=5677 _VODWORKFLOWRESULT._serialized_start=5680 _VODWORKFLOWRESULT._serialized_end=6028 _TASKTEMPLATE._serialized_start=6031 _TASKTEMPLATE._serialized_end=6617 _TRANSCODEVIDEOTASKPARAMS._serialized_start=6620 _TRANSCODEVIDEOTASKPARAMS._serialized_end=7072 _BYTEHDTASKPARAMS._serialized_start=7075 _BYTEHDTASKPARAMS._serialized_end=7488 _TRANSCODEAUDIOTASKPARAMS._serialized_start=7491 _TRANSCODEAUDIOTASKPARAMS._serialized_end=7819 _SNAPSHOTTASKPARAMS._serialized_start=7822 _SNAPSHOTTASKPARAMS._serialized_end=8294 _POSTERSNAPSHOTPARAMS._serialized_start=8297 _POSTERSNAPSHOTPARAMS._serialized_end=8440 _DYNPOSTSNAPSHOTPARAMS._serialized_start=8443 _DYNPOSTSNAPSHOTPARAMS._serialized_end=8640 _ANIMATEDPOSTERSNAPSHOTPARAMS._serialized_start=8643 _ANIMATEDPOSTERSNAPSHOTPARAMS._serialized_end=8834 _SPRITESNAPSHOTPARAMS._serialized_start=8837 _SPRITESNAPSHOTPARAMS._serialized_end=9060 _SAMPLESNAPSHOTPARAMS._serialized_start=9063 _SAMPLESNAPSHOTPARAMS._serialized_end=9279 _VODTASKTEMPLATERESULT._serialized_start=9281 _VODTASKTEMPLATERESULT._serialized_end=9372 _VODLISTTASKTEMPLATERESULT._serialized_start=9375 _VODLISTTASKTEMPLATERESULT._serialized_end=9508 _WORKFLOWTEMPLATE._serialized_start=9511 _WORKFLOWTEMPLATE._serialized_end=9791 _ACTIVITY._serialized_start=9794 _ACTIVITY._serialized_end=10093 _TRANSCODEACTIVITY._serialized_start=10096 _TRANSCODEACTIVITY._serialized_end=10581 _TRANSCODEACTIVITY_ENHANCEPARAMS._serialized_start=10441 _TRANSCODEACTIVITY_ENHANCEPARAMS._serialized_end=10493 _TRANSCODEACTIVITY_LOGOPARAMS._serialized_start=10495 _TRANSCODEACTIVITY_LOGOPARAMS._serialized_end=10527 _TRANSCODEACTIVITY_SUBTITLEPARAMS._serialized_start=10529 _TRANSCODEACTIVITY_SUBTITLEPARAMS._serialized_end=10581 _SNAPSHOTACTIVITY._serialized_start=10583 _SNAPSHOTACTIVITY._serialized_end=10701 _ENDACTIVITY._serialized_start=10703 _ENDACTIVITY._serialized_end=10740 _VODWORKFLOWTEMPLATERESULT._serialized_start=10742 _VODWORKFLOWTEMPLATERESULT._serialized_end=10845 _VODLISTWORKFLOWTEMPLATERESULT._serialized_start=10848 _VODLISTWORKFLOWTEMPLATERESULT._serialized_end=10989 _LOGOTEMPLATE._serialized_start=10992 _LOGOTEMPLATE._serialized_end=11417 _ADAPTLOGO._serialized_start=11420 _ADAPTLOGO._serialized_end=11558 _ANCHORSIZE._serialized_start=11560 _ANCHORSIZE._serialized_end=11603 _IMAGELOGODEFINITION._serialized_start=11606 _IMAGELOGODEFINITION._serialized_end=11889 _VIDEOLOGODEFINITION._serialized_start=11892 _VIDEOLOGODEFINITION._serialized_end=12175 _TEXTLOGODEFINITION._serialized_start=12178 _TEXTLOGODEFINITION._serialized_end=12458 _LOGODEFINITION._serialized_start=12461 _LOGODEFINITION._serialized_end=12735 _FONTSHADOW._serialized_start=12737 _FONTSHADOW._serialized_end=12798 _ADAPTCONCAT._serialized_start=12801 _ADAPTCONCAT._serialized_end=12945 _CONCATDEFINITION._serialized_start=12947 _CONCATDEFINITION._serialized_end=13010 _HIDDENWATERMARKADD._serialized_start=13012 _HIDDENWATERMARKADD._serialized_end=13063 _VODLISTWATERMARKRESPONSERESULT._serialized_start=13066 _VODLISTWATERMARKRESPONSERESULT._serialized_end=13204 _VIDEO._serialized_start=13207 _VIDEO._serialized_end=13536 _AUDIO._serialized_start=13539 _AUDIO._serialized_end=13692 _SEGMENT._serialized_start=13694 _SEGMENT._serialized_end=13751 _CONDITION._serialized_start=13754 _CONDITION._serialized_end=14014 _PARALLELPARAMS._serialized_start=14016 _PARALLELPARAMS._serialized_end=14049 _ENCRYPTION._serialized_start=14051 _ENCRYPTION._serialized_end=14079 _VOLUME._serialized_start=14081 _VOLUME._serialized_end=14187 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/request/__init__.py ================================================ ================================================ FILE: volcengine/vod/models/request/request_vod_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/request/request_vod.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 from volcengine.vod.models.business import vod_workflow_pb2 as volcengine_dot_vod_dot_business_dot_vod__workflow__pb2 from volcengine.vod.models.business import vod_upload_pb2 as volcengine_dot_vod_dot_business_dot_vod__upload__pb2 from volcengine.vod.models.business import vod_media_pb2 as volcengine_dot_vod_dot_business_dot_vod__media__pb2 from volcengine.vod.models.business import vod_cdn_pb2 as volcengine_dot_vod_dot_business_dot_vod__cdn__pb2 from volcengine.vod.models.business import vod_migrate_pb2 as volcengine_dot_vod_dot_business_dot_vod__migrate__pb2 from volcengine.vod.models.business import vod_space_pb2 as volcengine_dot_vod_dot_business_dot_vod__space__pb2 from volcengine.vod.models.business import vod_drama_pb2 as volcengine_dot_vod_dot_business_dot_vod__drama__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(volcengine/vod/request/request_vod.proto\x12\x1dVolcengine.Vod.Models.Request\x1a\x1egoogle/protobuf/wrappers.proto\x1a*volcengine/vod/business/vod_workflow.proto\x1a(volcengine/vod/business/vod_upload.proto\x1a\'volcengine/vod/business/vod_media.proto\x1a%volcengine/vod/business/vod_cdn.proto\x1a)volcengine/vod/business/vod_migrate.proto\x1a\'volcengine/vod/business/vod_space.proto\x1a\'volcengine/vod/business/vod_drama.proto\"\x84\x03\n\x18VodGetAllPlayInfoRequest\x12\x0c\n\x04Vids\x18\x01 \x01(\t\x12\x0f\n\x07\x46ormats\x18\x02 \x01(\t\x12\x0e\n\x06\x43odecs\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65\x66initions\x18\x04 \x01(\t\x12\x11\n\tFileTypes\x18\x05 \x01(\t\x12\x11\n\tLogoTypes\x18\x06 \x01(\t\x12\x19\n\x11NeedEncryptStream\x18\x07 \x01(\t\x12\x0b\n\x03Ssl\x18\x08 \x01(\t\x12\x12\n\nNeedThumbs\x18\t \x01(\t\x12\x17\n\x0fNeedBarrageMask\x18\n \x01(\t\x12\x0f\n\x07\x43\x64nType\x18\x0b \x01(\t\x12\x11\n\tUnionInfo\x18\x0c \x01(\t\x12\x11\n\tPlayScene\x18\r \x01(\t\x12\x1a\n\x12\x44rmExpireTimestamp\x18\x0e \x01(\t\x12\x0f\n\x07HDRType\x18\x0f \x01(\t\x12 \n\x18KeyFrameAlignmentVersion\x18\x10 \x01(\t\x12\x12\n\nUserAction\x18\x11 \x01(\t\x12\x0f\n\x07Quality\x18\x12 \x01(\t\"\xe2\x03\n\x15VodGetPlayInfoRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x02 \x01(\t\x12\r\n\x05\x43odec\x18\x03 \x01(\t\x12\x12\n\nDefinition\x18\x04 \x01(\t\x12\x10\n\x08\x46ileType\x18\x05 \x01(\t\x12\x10\n\x08LogoType\x18\x06 \x01(\t\x12\x0e\n\x06\x42\x61se64\x18\x07 \x01(\t\x12\x0b\n\x03Ssl\x18\x08 \x01(\t\x12\x12\n\nNeedThumbs\x18\t \x01(\t\x12\x17\n\x0fNeedBarrageMask\x18\n \x01(\t\x12\x0f\n\x07\x43\x64nType\x18\x0b \x01(\t\x12\x11\n\tUnionInfo\x18\x0c \x01(\t\x12\x15\n\rHDRDefinition\x18\r \x01(\t\x12\x11\n\tPlayScene\x18\x0e \x01(\t\x12\x1a\n\x12\x44rmExpireTimestamp\x18\x0f \x01(\t\x12\x0f\n\x07Quality\x18\x10 \x01(\t\x12\x12\n\nPlayConfig\x18\x11 \x01(\t\x12\x14\n\x0cNeedOriginal\x18\x12 \x01(\t\x12\x13\n\x0b\x46orceExpire\x18\x13 \x01(\t\x12\x0e\n\x06GetAll\x18\x14 \x01(\x08\x12\x1c\n\x14\x44igitalWatermarkType\x18\x15 \x01(\t\x12\x11\n\tUserToken\x18\x16 \x01(\t\x12\x0e\n\x06\x44rmKEK\x18\x17 \x01(\t\x12\x10\n\x08JSPlayer\x18\x18 \x01(\t\"g\n\x1fVodGetPrivateDrmPlayAuthRequest\x12\x0f\n\x07\x44rmType\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x13\n\x0bPlayAuthIds\x18\x03 \x01(\t\x12\x11\n\tUnionInfo\x18\x04 \x01(\t\"Q\n\x1dVodGetHlsDecryptionKeyRequest\x12\x14\n\x0c\x44rmAuthToken\x18\x01 \x01(\t\x12\n\n\x02\x41k\x18\x02 \x01(\t\x12\x0e\n\x06Source\x18\x03 \x01(\t\"5\n VodCreateHlsDecryptionKeyRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\"\x98\x01\n+VodGetPlayInfoWithLiveTimeShiftSceneRequest\x12\x11\n\tStoreUris\x18\x01 \x01(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\x12\x0b\n\x03Ssl\x18\x03 \x01(\t\x12\x17\n\x0f\x45xpireTimestamp\x18\x04 \x01(\t\x12\x1d\n\x15NeedComposeBucketName\x18\x05 \x01(\t\"*\n\x1cVodDescribeDrmDataKeyRequest\x12\n\n\x02\x41k\x18\x01 \x01(\t\"\xac\x01\n\x1eVodSubmitMoveObjectTaskRequest\x12\x13\n\x0bSourceSpace\x18\x01 \x01(\t\x12\x16\n\x0eSourceFileName\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\x12\x16\n\x0eTargetFileName\x18\x04 \x01(\t\x12\x18\n\x10SaveSourceObject\x18\x05 \x01(\x08\x12\x16\n\x0e\x46orceOverwrite\x18\x06 \x01(\x08\"]\n!VodQueryMoveObjectTaskInfoRequest\x12\x0e\n\x06TaskId\x18\x01 \x01(\t\x12\x13\n\x0bSourceSpace\x18\x02 \x01(\t\x12\x13\n\x0bTargetSpace\x18\x03 \x01(\t\"y\n VodSubmitBlockObjectTasksRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x11\n\tOperation\x18\x02 \x01(\t\x12\x1b\n\x13\x46ileNamesUrlEncoded\x18\x03 \x01(\t\x12\x12\n\nRefreshCdn\x18\x04 \x01(\t\"a\n\x1eVodListBlockObjectTasksRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x1b\n\x13\x46ileNamesUrlEncoded\x18\x02 \x01(\t\x12\x0f\n\x07TaskIds\x18\x03 \x01(\t\"m\n\x13VodUrlUploadRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x43\n\x07URLSets\x18\x02 \x03(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodUrlUploadURLSet\"/\n\x1dVodQueryUploadTaskInfoRequest\x12\x0e\n\x06JobIds\x18\x01 \x01(\t\"\x87\x02\n\x19VodApplyUploadInfoRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nSessionKey\x18\x02 \x01(\t\x12\x10\n\x08\x46ileSize\x18\x03 \x01(\x01\x12\x10\n\x08\x46ileType\x18\x04 \x01(\t\x12\x10\n\x08\x46ileName\x18\x05 \x01(\t\x12\x14\n\x0cStorageClass\x18\x06 \x01(\x05\x12\x15\n\rFileExtension\x18\x07 \x01(\t\x12\x19\n\x11\x43lientNetWorkMode\x18\x08 \x01(\t\x12\x15\n\rClientIDCMode\x18\t \x01(\t\x12\x14\n\x0cNeedFallback\x18\n \x01(\x08\x12\x18\n\x10UploadHostPrefer\x18\x0b \x01(\t\"\xfb\x02\n\x15VodUploadMediaRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x10\n\x08\x46ilePath\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x11\n\tFunctions\x18\x04 \x01(\t\x12\x10\n\x08\x46ileName\x18\x05 \x01(\t\x12\x14\n\x0cStorageClass\x18\x06 \x01(\x05\x12\x15\n\rFileExtension\x18\x07 \x01(\t\x12\x17\n\x0fVodUploadSource\x18\x08 \x01(\t\x12\x16\n\x0eUploadStrategy\x18\t \x01(\x05\x12\x13\n\x0bParallelNum\x18\n \x01(\x05\x12\x19\n\x11\x43lientNetWorkMode\x18\x0b \x01(\t\x12\x15\n\rClientIDCMode\x18\x0c \x01(\t\x12\x12\n\nExpireTime\x18\r \x01(\t\x12\x18\n\x10UploadHostPrefer\x18\x0e \x01(\t\x12\x11\n\tChunkSize\x18\x0f \x01(\x03\x12\x1c\n\x14SupportParseManifest\x18\x10 \x01(\x08\"\xaf\x02\n\x18VodUploadMaterialRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x10\n\x08\x46ilePath\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x11\n\tFunctions\x18\x04 \x01(\t\x12\x10\n\x08\x46ileType\x18\x05 \x01(\t\x12\x10\n\x08\x46ileName\x18\x06 \x01(\t\x12\x15\n\rFileExtension\x18\x07 \x01(\t\x12\x16\n\x0eUploadStrategy\x18\x08 \x01(\x05\x12\x13\n\x0bParallelNum\x18\t \x01(\x05\x12\x19\n\x11\x43lientNetWorkMode\x18\n \x01(\t\x12\x15\n\rClientIDCMode\x18\x0b \x01(\t\x12\x18\n\x10UploadHostPrefer\x18\x0c \x01(\t\x12\x11\n\tChunkSize\x18\r \x01(\x03\"\x9b\x02\n\x16VodUploadObjectRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x10\n\x08\x46ilePath\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x11\n\tFunctions\x18\x04 \x01(\t\x12\x10\n\x08\x46ileName\x18\x05 \x01(\t\x12\x15\n\rFileExtension\x18\x06 \x01(\t\x12\x16\n\x0eUploadStrategy\x18\x07 \x01(\x05\x12\x13\n\x0bParallelNum\x18\x08 \x01(\x05\x12\x19\n\x11\x43lientNetWorkMode\x18\t \x01(\t\x12\x15\n\rClientIDCMode\x18\n \x01(\t\x12\x18\n\x10UploadHostPrefer\x18\x0b \x01(\t\x12\x11\n\tChunkSize\x18\x0c \x01(\x03\"\x99\x01\n\x1aVodCommitUploadInfoRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nSessionKey\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x11\n\tFunctions\x18\x04 \x01(\t\x12\x17\n\x0fVodUploadSource\x18\x05 \x01(\t\x12\x12\n\nExpireTime\x18\x06 \x01(\t\"=\n\x17VodUrlUploadJsonRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0f\n\x07URLSets\x18\x02 \x01(\t\"a\n\x1dVodParseUploadManifestRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x14\n\x0cManifestType\x18\x02 \x01(\t\x12\x17\n\x0fManifestContent\x18\x03 \x01(\t\"i\n&VodListFileMetaInfosByFileNamesRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x46ileNameEncodeds\x18\x02 \x01(\t\x12\x12\n\nBucketName\x18\x03 \x01(\t\".\n\x1eVodGetRecommendedPosterRequest\x12\x0c\n\x04Vids\x18\x01 \x01(\t\"A\n\"VodUpdateMediaPublishStatusRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06Status\x18\x02 \x01(\t\"n\n!VodUpdateMediaStorageClassRequest\x12\x0c\n\x04Vids\x18\x01 \x01(\t\x12\x14\n\x0cStorageClass\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\x12\x0f\n\x07\x46ileIds\x18\x04 \x01(\t\"\xce\x02\n\x19VodUpdateMediaInfoRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12/\n\tPosterUri\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12+\n\x05Title\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x31\n\x0b\x44\x65scription\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12*\n\x04Tags\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x35\n\x10\x43lassificationId\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x30\n\nExpireTime\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.StringValue\"\'\n\x17VodGetMediaInfosRequest\x12\x0c\n\x04Vids\x18\x01 \x01(\t\":\n\x18VodDeleteMaterialRequest\x12\x0b\n\x03Mid\x18\x01 \x01(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\";\n\x15VodDeleteMediaRequest\x12\x0c\n\x04Vids\x18\x01 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x02 \x01(\t\"P\n\x1aVodDeleteTranscodesRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0f\n\x07\x46ileIds\x18\x02 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x03 \x01(\t\"D\n\x1cVodDeleteMediaTosFileRequest\x12\x11\n\tFileNames\x18\x01 \x03(\t\x12\x11\n\tSpaceName\x18\x02 \x01(\t\"\x8a\x02\n\x16VodGetMediaListRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\t\x12\r\n\x05Order\x18\x04 \x01(\t\x12\x0c\n\x04Tags\x18\x05 \x01(\t\x12\x11\n\tStartTime\x18\x06 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x07 \x01(\t\x12\x0e\n\x06Offset\x18\x08 \x01(\t\x12\x10\n\x08PageSize\x18\t \x01(\t\x12\x19\n\x11\x43lassificationIds\x18\n \x01(\t\x12\x19\n\x11TosStorageClasses\x18\x0b \x01(\t\x12\x18\n\x10VodUploadSources\x18\x0c \x01(\t\x12\r\n\x05Title\x18\r \x01(\t\"\xe6\x01\n\x1dVodGetSubtitleInfoListRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0f\n\x07\x46ileIds\x18\x02 \x01(\t\x12\x11\n\tLanguages\x18\x03 \x01(\t\x12\x0f\n\x07\x46ormats\x18\x04 \x01(\t\x12\x13\n\x0bLanguageIds\x18\x05 \x01(\t\x12\x13\n\x0bSubtitleIds\x18\x06 \x01(\t\x12\x0e\n\x06Status\x18\x07 \x01(\t\x12\r\n\x05Title\x18\x08 \x01(\t\x12\x0b\n\x03Tag\x18\t \x01(\t\x12\x0e\n\x06Offset\x18\n \x01(\t\x12\x10\n\x08PageSize\x18\x0b \x01(\t\x12\x0b\n\x03Ssl\x18\x0c \x01(\t\"r\n\x1eVodUpdateSubtitleStatusRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0f\n\x07\x46ileIds\x18\x02 \x01(\t\x12\x11\n\tLanguages\x18\x03 \x01(\t\x12\x0f\n\x07\x46ormats\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x05 \x01(\t\"\xb5\x01\n\x1cVodUpdateSubtitleInfoRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x0e\n\x06\x46ileId\x18\x02 \x01(\t\x12\x10\n\x08Language\x18\x03 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x04 \x01(\t\x12+\n\x05Title\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12)\n\x03Tag\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.StringValue\"w\n VodGetAuditFramesForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\x12\x19\n\x11MinNumberOfFrames\x18\x03 \x01(\t\x12\x19\n\x11MaxNumberOfFrames\x18\x04 \x01(\t\"\xa1\x02\n\x1dVodGetMLFramesForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\x12\x10\n\x08\x46rameOpt\x18\x03 \x01(\t\x12\x10\n\x08\x46rameFps\x18\x04 \x01(\t\x12\x16\n\x0eNumberOfFrames\x18\x05 \x01(\t\x12\x14\n\x0c\x43utTimeMills\x18\x06 \x01(\t\x12\x16\n\x0eNeedFirstFrame\x18\x07 \x01(\t\x12\x15\n\rNeedLastFrame\x18\x08 \x01(\t\x12\x15\n\rStartTimeMill\x18\t \x01(\t\x12\x13\n\x0b\x45ndTimeMill\x18\n \x01(\t\x12\x19\n\x11MinNumberOfFrames\x18\x0b \x01(\t\x12\x19\n\x11MaxNumberOfFrames\x18\x0c \x01(\t\"U\n!VodGetBetterFramesForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\x12\x11\n\tCoverRate\x18\x03 \x01(\t\"?\n\x1eVodGetAudioInfoForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\"P\n/VodGetAutomaticSpeechRecognitionForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\"I\n(VodGetAudioEventDetectionForAuditRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x10\n\x08Strategy\x18\x02 \x01(\t\"q\n#VodCreateVideoClassificationRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\r\n\x05Level\x18\x02 \x01(\x05\x12\x10\n\x08ParentId\x18\x03 \x01(\x03\x12\x16\n\x0e\x43lassification\x18\x04 \x01(\t\"j\n#VodUpdateVideoClassificationRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x43lassificationId\x18\x02 \x01(\x03\x12\x16\n\x0e\x43lassification\x18\x03 \x01(\t\"R\n#VodDeleteVideoClassificationRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x43lassificationId\x18\x02 \x01(\x03\"Q\n\"VodListVideoClassificationsRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x43lassificationId\x18\x02 \x01(\x03\"&\n\x17VodListSnapshotsRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\"Z\n\x15VodGetFileListRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06Prefix\x18\x02 \x01(\t\x12\r\n\x05Limit\x18\x03 \x01(\t\x12\x0f\n\x07Starter\x18\x04 \x01(\t\"\xad\x01\n\x16VodGetFileInfosRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x18\n\x10\x45ncodedFileNames\x18\x02 \x01(\t\x12\x12\n\nBucketName\x18\x03 \x01(\t\x12\x17\n\x0fNeedDownloadUrl\x18\x04 \x01(\x08\x12\x1e\n\x16\x44ownloadUrlNetworkType\x18\x05 \x01(\t\x12\x19\n\x11\x44ownloadUrlExpire\x18\x06 \x01(\x03\"\x95\x01\n VodUpdateFileStorageClassRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12J\n\x0f\x46ileUpdateInfos\x18\x02 \x03(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodFileUpdateInfo\x12\x12\n\nBucketName\x18\x03 \x01(\t\"P\n\x1bVodGetInnerAuditURLsRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x11\n\tFileNames\x18\x03 \x03(\t\"R\n\x1fVodGetAdAuditResultByVidRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x0f\n\x07\x46ileIds\x18\x03 \x03(\t\"-\n\x1eVodExtractMediaMetaTaskRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\"\xa3\x02\n\x17VodStartWorkflowRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x12\n\nTemplateId\x18\x02 \x01(\t\x12=\n\x05Input\x18\x03 \x01(\x0b\x32..Volcengine.Vod.Models.Business.WorkflowParams\x12\x10\n\x08Priority\x18\x04 \x01(\x05\x12\x14\n\x0c\x43\x61llbackArgs\x18\x05 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x06 \x01(\x08\x12<\n\tDirectUrl\x18\x07 \x01(\x0b\x32).Volcengine.Vod.Models.Business.DirectUrl\x12\x12\n\nTaskListId\x18\x08 \x01(\t\x12\x13\n\x0b\x43lientToken\x18\t \x01(\t\"D\n!VodRetrieveTranscodeResultRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x12\n\nResultType\x18\x02 \x01(\t\"\x9f\x02\n\x1fVodListWorkflowExecutionRequest\x12\r\n\x05RunId\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x11\n\tSpaceName\x18\x03 \x01(\t\x12\x12\n\nTemplateId\x18\x04 \x01(\t\x12\x12\n\nTaskListId\x18\x05 \x01(\t\x12\x19\n\x11\x45nableLowPriority\x18\x06 \x01(\t\x12\x11\n\tJobSource\x18\x07 \x01(\t\x12\x0e\n\x06Status\x18\x08 \x01(\t\x12\x11\n\tStartTime\x18\t \x01(\t\x12\x0f\n\x07\x45ndTime\x18\n \x01(\t\x12\x10\n\x08PageSize\x18\x0b \x01(\t\x12\x0e\n\x06Offset\x18\x0c \x01(\t\x12\x12\n\nOrderByKey\x18\r \x01(\t\x12\r\n\x05Order\x18\x0e \x01(\t\"5\n$VodGetWorkflowExecutionDetailRequest\x12\r\n\x05RunId\x18\x01 \x01(\t\",\n\x1bVodGetWorkflowResultRequest\x12\r\n\x05RunId\x18\x01 \x01(\t\"N\n$VodGetWorkflowExecutionStatusRequest\x12\r\n\x05RunId\x18\x01 \x01(\t\x12\x17\n\x0fNeedTasksDetail\x18\x02 \x01(\t\"\xba\x03\n\x1cVodCreateTaskTemplateRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x07 \x01(\t\x12Z\n\x18TranscodeVideoTaskParams\x18\x08 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeVideoTaskParams\x12J\n\x10\x42yteHDTaskParams\x18\x0b \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.ByteHDTaskParams\x12Z\n\x18TranscodeAudioTaskParams\x18\x0c \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeAudioTaskParams\x12N\n\x12SnapshotTaskParams\x18\r \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.SnapshotTaskParams\"\xbb\x03\n\x1cVodUpdateTaskTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x07 \x01(\t\x12Z\n\x18TranscodeVideoTaskParams\x18\x08 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeVideoTaskParams\x12J\n\x10\x42yteHDTaskParams\x18\x0b \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.ByteHDTaskParams\x12Z\n\x18TranscodeAudioTaskParams\x18\x0c \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.TranscodeAudioTaskParams\x12N\n\x12SnapshotTaskParams\x18\r \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.SnapshotTaskParams\"2\n\x1cVodDeleteTaskTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\"/\n\x19VodGetTaskTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\"\xb3\x01\n\x1aVodListTaskTemplateRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nTemplateId\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x04 \x01(\t\x12\x0c\n\x04Type\x18\x06 \x01(\t\x12\r\n\x05Limit\x18\x07 \x01(\x05\x12\x0e\n\x06Offset\x18\x08 \x01(\x05\x12\x12\n\nOrderByKey\x18\t \x01(\t\x12\r\n\x05Order\x18\n \x01(\t\"\xa8\x02\n\x19VodCreateWatermarkRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x10\n\x08LogoType\x18\x07 \x01(\t\x12\x38\n\x05Logos\x18\x08 \x03(\x0b\x32).Volcengine.Vod.Models.Business.AdaptLogo\x12<\n\x07\x43oncats\x18\t \x03(\x0b\x32+.Volcengine.Vod.Models.Business.AdaptConcat\x12K\n\x0fHiddenWatermark\x18\n \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.HiddenWatermarkAdd\"\xa9\x02\n\x19VodUpdateWatermarkRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x10\n\x08LogoType\x18\x07 \x01(\t\x12\x38\n\x05Logos\x18\x08 \x03(\x0b\x32).Volcengine.Vod.Models.Business.AdaptLogo\x12<\n\x07\x43oncats\x18\t \x03(\x0b\x32+.Volcengine.Vod.Models.Business.AdaptConcat\x12K\n\x0fHiddenWatermark\x18\n \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.HiddenWatermarkAdd\"/\n\x19VodDeleteWatermarkRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\",\n\x16VodGetWatermarkRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\"\x9e\x01\n\x17VodListWatermarkRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nTemplateId\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x0c\n\x04Type\x18\x05 \x01(\t\x12\r\n\x05Limit\x18\x06 \x01(\x05\x12\x0e\n\x06Offset\x18\x07 \x01(\x05\x12\x12\n\nOrderByKey\x18\x08 \x01(\t\x12\r\n\x05Order\x18\t \x01(\t\"\x96\x01\n VodCreateWorkflowTemplateRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12<\n\nActivities\x18\x07 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.Activity\"\x97\x01\n VodUpdateWorkflowTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\x12\x0c\n\x04Name\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12<\n\nActivities\x18\x07 \x03(\x0b\x32(.Volcengine.Vod.Models.Business.Activity\"6\n VodDeleteWorkflowTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\"3\n\x1dVodGetWorkflowTemplateRequest\x12\x12\n\nTemplateId\x18\x01 \x01(\t\"\xa5\x01\n\x1eVodListWorkflowTemplateRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nTemplateId\x18\x02 \x01(\t\x12\x0c\n\x04Name\x18\x03 \x01(\t\x12\x0c\n\x04Type\x18\x05 \x01(\t\x12\r\n\x05Limit\x18\x06 \x01(\x05\x12\x0e\n\x06Offset\x18\x07 \x01(\x05\x12\x12\n\nOrderByKey\x18\x08 \x01(\t\x12\r\n\x05Order\x18\t \x01(\t\"\x9c\x01\n#VodSubmitDirectEditTaskAsyncRequest\x12\x10\n\x08Uploader\x18\x01 \x01(\t\x12\x13\n\x0b\x41pplication\x18\x02 \x01(\t\x12\x11\n\tEditParam\x18\x04 \x01(\x0c\x12\x10\n\x08Priority\x18\x05 \x01(\x05\x12\x13\n\x0b\x43\x61llbackUri\x18\x06 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x07 \x01(\t\"^\n\"VodSubmitDirectEditTaskSyncRequest\x12\x10\n\x08Uploader\x18\x01 \x01(\t\x12\x13\n\x0b\x41pplication\x18\x02 \x01(\t\x12\x11\n\tEditParam\x18\x03 \x01(\x0c\"/\n\x1dVodGetDirectEditResultRequest\x12\x0e\n\x06ReqIds\x18\x01 \x03(\t\"0\n\x1fVodGetDirectEditProgressRequest\x12\r\n\x05ReqId\x18\x01 \x01(\t\"/\n\x1eVodCancelDirectEditTaskRequest\x12\r\n\x05ReqId\x18\x01 \x01(\t\"g\n\x1cVodAsyncVCreativeTaskRequest\x12\x10\n\x08Uploader\x18\x01 \x01(\t\x12\x10\n\x08ParamStr\x18\x02 \x01(\t\x12\r\n\x05Scene\x18\x03 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x04 \x01(\t\"7\n VodGetVCreativeTaskResultRequest\x12\x13\n\x0bVCreativeId\x18\x01 \x01(\t\"*\n\x15VodDeleteSpaceRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\"v\n\x15VodCreateSpaceRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x13\n\x0bProjectName\x18\x02 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x03 \x01(\t\x12\x0e\n\x06Region\x18\x04 \x01(\t\x12\x10\n\x08UserName\x18\x05 \x01(\t\"-\n\x18VodGetSpaceDetailRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\"4\n\x13VodListSpaceRequest\x12\x0e\n\x06Offset\x18\x01 \x01(\x01\x12\r\n\x05Limit\x18\x02 \x01(\x01\"u\n\x15VodUpdateSpaceRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x19\n\x11SourceProjectName\x18\x02 \x01(\t\x12\x19\n\x11TargetProjectName\x18\x03 \x01(\t\x12\x13\n\x0b\x44\x65scription\x18\x04 \x01(\t\"^\n!VodUpdateSpaceUploadConfigRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x11\n\tConfigKey\x18\x02 \x01(\t\x12\x13\n\x0b\x43onfigValue\x18\x03 \x01(\t\"8\n#VodDescribeUploadSpaceConfigRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\"\x86\x04\n!VodUpdateUploadSpaceConfigRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nAutoPoster\x18\x02 \x01(\t\x12N\n\x12\x43ustomPosterConfig\x18\x03 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.CustomPosterConfig\x12\x15\n\rGetPosterMode\x18\x04 \x01(\t\x12\x1b\n\x13\x41utoPosterCandidate\x18\x05 \x01(\t\x12\x15\n\rAutoTranscode\x18\x06 \x01(\t\x12H\n\x0fTranscodeConfig\x18\x07 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.TranscodeConfig\x12\x1a\n\x12\x41utoSetVideoStatus\x18\x08 \x01(\t\x12\x17\n\x0fUploadOverwrite\x18\t \x01(\t\x12\x1d\n\x15\x43\x61llbackReturnPlayUrl\x18\n \x01(\t\x12\x1b\n\x13\x43\x61llbackReturnRunId\x18\x0b \x01(\t\x12\x13\n\x0bGetMetaMode\x18\x0c \x01(\t\x12\x1f\n\x17\x41utoGetArchiveVideoMeta\x18\r \x01(\t\x12\x1a\n\x12\x41utoGetIAVideoMeta\x18\x0e \x01(\t\x12\x12\n\nMetaGetMd5\x18\x0f \x01(\t\"\x95\x01\n%VodDescribeVodSpaceStorageDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x04 \x01(\x05\x12\x0c\n\x04Type\x18\x05 \x01(\t\x12\x12\n\nRegionList\x18\x06 \x01(\t\"\\\n\x1eVodUpdateDomainPlayRuleRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x15\n\rDefaultDomain\x18\x02 \x01(\t\x12\x10\n\x08PlayRule\x18\x03 \x01(\x05\"r\n\x1eVodAddDomainToSchedulerRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x04 \x01(\x05\"w\n#VodRemoveDomainFromSchedulerRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x04 \x01(\x05\"O\n\x16VodDeleteDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\"i\n\x15VodStartDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x04 \x01(\x05\"h\n\x14VodStopDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x04 \x01(\x05\"w\n\x14VodListDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x19\n\x11SourceStationType\x18\x03 \x01(\x05\x12\x0e\n\x06Offset\x18\x04 \x01(\x05\x12\r\n\x05Limit\x18\x05 \x01(\x05\"O\n\x1eVodCreateCdnRefreshTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Urls\x18\x02 \x01(\t\x12\x0c\n\x04Type\x18\x03 \x01(\t\"A\n\x1eVodCreateCdnPreloadTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Urls\x18\x02 \x01(\t\"\xc2\x01\n\x16VodListCdnTasksRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\x12\x12\n\nDomainName\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x05 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x06 \x01(\x05\x12\x14\n\x0c\x45ndTimestamp\x18\x07 \x01(\x05\x12\x0f\n\x07PageNum\x18\x08 \x01(\x05\x12\x10\n\x08PageSize\x18\t \x01(\x05\"\xb4\x01\n\x1aVodListCdnAccessLogRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x02 \x01(\x05\x12\x14\n\x0c\x45ndTimestamp\x18\x03 \x01(\x05\x12\x11\n\tSpaceName\x18\x04 \x01(\t\x12\x14\n\x07PageNum\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x15\n\x08PageSize\x18\x06 \x01(\x03H\x01\x88\x01\x01\x42\n\n\x08_PageNumB\x0b\n\t_PageSize\"p\n\x1dVodListCdnTopAccessUrlRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x02 \x01(\x05\x12\x14\n\x0c\x45ndTimestamp\x18\x03 \x01(\x05\x12\x10\n\x08SortType\x18\x04 \x01(\t\"{\n\x1aVodListCdnTopAccessRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x02 \x01(\x05\x12\x14\n\x0c\x45ndTimestamp\x18\x03 \x01(\x05\x12\x10\n\x08SortType\x18\x04 \x01(\t\x12\x0c\n\x04Item\x18\x05 \x01(\t\"\xcb\x01\n(VodDescribeVodDomainBandwidthDataRequest\x12\x12\n\nDomainList\x18\x01 \x01(\t\x12\x19\n\x11\x44omainInSpaceList\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x05\x12\x15\n\rBandwidthType\x18\x06 \x01(\t\x12\x0c\n\x04\x41rea\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"\x8a\x02\n\x1aVodListCdnUsageDataRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x10\n\x08Interval\x18\x02 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x03 \x01(\x03\x12\x14\n\x0c\x45ndTimestamp\x18\x04 \x01(\x03\x12\x10\n\x08\x44\x61taType\x18\x05 \x01(\t\x12\x0e\n\x06Metric\x18\x06 \x01(\t\x12\x12\n\nNeedDetail\x18\x07 \x01(\x08\x12\x0c\n\x04\x41rea\x18\x08 \x01(\t\x12\x0e\n\x06Region\x18\t \x01(\t\x12\x0b\n\x03Isp\x18\n \x01(\t\x12\x10\n\x08Protocol\x18\x0b \x01(\t\x12\x11\n\tIpVersion\x18\x0c \x01(\t\x12\x15\n\rBillingRegion\x18\r \x01(\t\"\xa4\x01\n\x1bVodListCdnStatusDataRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x10\n\x08Interval\x18\x02 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x03 \x01(\x03\x12\x14\n\x0c\x45ndTimestamp\x18\x04 \x01(\x03\x12\x10\n\x08\x44\x61taType\x18\x05 \x01(\t\x12\x0e\n\x06Metric\x18\x06 \x01(\t\x12\x12\n\nNeedDetail\x18\x07 \x01(\x08\"\'\n\x18VodDescribeIPInfoRequest\x12\x0b\n\x03Ips\x18\x01 \x01(\t\"\xa2\x01\n\x17VodListCdnPvDataRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x10\n\x08Interval\x18\x02 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x03 \x01(\x03\x12\x14\n\x0c\x45ndTimestamp\x18\x04 \x01(\x03\x12\x10\n\x08\x44\x61taType\x18\x05 \x01(\t\x12\x12\n\nNeedDetail\x18\x06 \x01(\x08\x12\x10\n\x08Protocol\x18\x07 \x01(\t\"\x93\x01\n\x1cVodListCdnHitrateDataRequest\x12\x0f\n\x07\x44omains\x18\x01 \x01(\t\x12\x10\n\x08Interval\x18\x02 \x01(\t\x12\x16\n\x0eStartTimestamp\x18\x03 \x01(\x03\x12\x14\n\x0c\x45ndTimestamp\x18\x04 \x01(\x03\x12\x0e\n\x06Metric\x18\x05 \x01(\t\x12\x12\n\nNeedDetail\x18\x06 \x01(\x08\"\xc7\x01\n&VodDescribeVodDomainTrafficDataRequest\x12\x12\n\nDomainList\x18\x01 \x01(\t\x12\x19\n\x11\x44omainInSpaceList\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x05\x12\x13\n\x0bTrafficType\x18\x06 \x01(\t\x12\x0c\n\x04\x41rea\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"T\n\x1aVodSubmitBlockTasksRequest\x12\x10\n\x08\x46ileUrls\x18\x01 \x01(\t\x12\x11\n\tOperation\x18\x02 \x01(\t\x12\x11\n\tSpaceName\x18\x03 \x01(\t\"\xb6\x01\n\x1eVodGetContentBlockTasksRequest\x12\x0b\n\x03Url\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x0e\n\x06TaskID\x18\x03 \x01(\t\x12\x10\n\x08TaskType\x18\x04 \x01(\t\x12\x0e\n\x06Status\x18\x05 \x01(\t\x12\x11\n\tStartTime\x18\x06 \x01(\x03\x12\x0f\n\x07\x45ndTime\x18\x07 \x01(\x03\x12\x0f\n\x07PageNum\x18\x08 \x01(\x03\x12\x10\n\x08PageSize\x18\t \x01(\x03\"\xef\x03\n\x18VodCreateDomainV2Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x05 \x01(\x05\x12 \n\x18SourceStationAddressType\x18\x06 \x01(\x05\x12\x0f\n\x07Origins\x18\x07 \x01(\t\x12\x0c\n\x04\x41rea\x18\x08 \x01(\t\x12\x12\n\nBucketName\x18\t \x01(\t\x12\x0c\n\x04Host\x18\n \x01(\t\x12\x1b\n\x13PrivateBucketAccess\x18\x0b \x01(\x08\x12O\n\x11PrivateBucketAuth\x18\x0c \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodPrivateBucketAuth\x12\x0e\n\x06Region\x18\r \x01(\t\x12\x16\n\x0eOriginProtocol\x18\x0e \x01(\t\x12\x10\n\x08HttpPort\x18\x0f \x01(\t\x12\x11\n\tHttpsPort\x18\x10 \x01(\t\x12\x0e\n\x06Weight\x18\x11 \x01(\t\x12=\n\x06Origin\x18\x12 \x03(\x0b\x32-.Volcengine.Vod.Models.Business.CdnOriginRule\x12\x14\n\x0c\x42usinessType\x18\x13 \x01(\t\"\x81\x02\n\x18VodCreateDomainV3Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x19\n\x11SourceStationType\x18\x05 \x01(\x05\x12\x0c\n\x04\x41rea\x18\x08 \x01(\t\x12\x12\n\nBucketName\x18\t \x01(\t\x12\x32\n\x04IPv6\x18\n \x01(\x0b\x32$.Volcengine.Vod.Models.Business.IPv6\x12=\n\x06Origin\x18\x0b \x03(\x0b\x32-.Volcengine.Vod.Models.Business.CdnOriginRule\"g\n\x1eVodUpdateDomainExpireV2Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x0e\n\x06\x45xpire\x18\x04 \x01(\x05\"\x8f\x01\n\"VodUpdateDomainAuthConfigV2Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x0f\n\x07MainKey\x18\x04 \x01(\t\x12\x11\n\tBackupKey\x18\x05 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\"\x92\x01\n%VodUpdateDomainUrlAuthConfigV2Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x0f\n\x07MainKey\x18\x04 \x01(\t\x12\x11\n\tBackupKey\x18\x05 \x01(\t\x12\x0e\n\x06Status\x18\x06 \x01(\t\"\xd4\x01\n\x1bVodDescribeCdnEdgeIpRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12\x16\n\tIpVersion\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03Isp\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06Region\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06Status\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_IpVersionB\x06\n\x04_IspB\t\n\x07_RegionB\t\n\x07_Status\"?\n!VodDescribeCdnRegionAndIspRequest\x12\x11\n\x04\x41rea\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_Area\"A\n\x1bVodVerifyDomainOwnerRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\x12\x12\n\nVerifyType\x18\x02 \x01(\t\"7\n%VodDescribeDomainVerifyContentRequest\x12\x0e\n\x06\x44omain\x18\x01 \x01(\t\"L\n\x18VodListPCDNDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06Offset\x18\x02 \x01(\x05\x12\r\n\x05Limit\x18\x03 \x01(\x05\"?\n\x1aVodCreatePCDNDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\">\n\x19VodStartPCDNDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\"=\n\x18VodStopPCDNDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\"?\n\x1aVodDeletePCDNDomainRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\"\x96\x01\n\x1cVodUpdateDomainConfigRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\x12?\n\x06\x43onfig\x18\x04 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.VodDomainConfig\"W\n\x1eVodDescribeDomainConfigRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x12\n\nDomainType\x18\x02 \x01(\t\x12\x0e\n\x06\x44omain\x18\x03 \x01(\t\"\x84\x01\n\x1f\x41\x64\x64OrUpdateCertificateV2Request\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x12\n\nDomainType\x18\x03 \x01(\t\x12\x15\n\rCertificateId\x18\x04 \x01(\t\x12\x13\n\x0bHttpsStatus\x18\x05 \x01(\t\"^\n\x17UpdateDomainAreaRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x44omain\x18\x02 \x01(\t\x12\x12\n\nDomainType\x18\x03 \x01(\t\x12\x0c\n\x04\x41rea\x18\x04 \x01(\t\"X\n!VodAddCallbackSubscriptionRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Url\x18\x02 \x01(\t\x12\x13\n\x0b\x43ontentType\x18\x03 \x01(\t\"h\n\x1aVodSetCallbackEventRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06\x45vents\x18\x02 \x01(\t\x12\x13\n\x0b\x41uthEnabled\x18\x03 \x01(\t\x12\x12\n\nPrivateKey\x18\x04 \x01(\t\"\xab\x01\n\x18GetCallbackRecordRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0b\n\x03Vid\x18\x02 \x01(\t\x12\x0e\n\x06Status\x18\x03 \x01(\t\x12\x11\n\tStartTime\x18\x04 \x01(\x03\x12\x0f\n\x07\x45ndTime\x18\x05 \x01(\x03\x12\r\n\x05Limit\x18\x06 \x01(\x05\x12\x11\n\tEventType\x18\x07 \x01(\t\x12\x19\n\x11\x43ontinuationToken\x18\x08 \x01(\t\"\xf4\x01\n&VodGetSmartStrategyLitePlayInfoRequest\x12\x0f\n\x07PlayUrl\x18\x01 \x01(\t\x12\x0e\n\x06\x46ormat\x18\x02 \x01(\t\x12\r\n\x05\x43odec\x18\x03 \x01(\t\x12\x12\n\nDefinition\x18\x04 \x01(\t\x12\x10\n\x08\x46ileType\x18\x05 \x01(\t\x12\x10\n\x08LogoType\x18\x06 \x01(\t\x12\x0b\n\x03Ssl\x18\x07 \x01(\t\x12\x12\n\nNeedThumbs\x18\x08 \x01(\t\x12\x17\n\x0fNeedBarrageMask\x18\t \x01(\t\x12\x11\n\tUnionInfo\x18\n \x01(\t\x12\x15\n\rHDRDefinition\x18\x0b \x01(\t\"%\n\x14VodGetAppInfoRequest\x12\r\n\x05\x41ppId\x18\x01 \x01(\x04\"\xe4\x01\n$DescribeVodSpaceTranscodeDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x15\n\rTranscodeType\x18\x04 \x01(\t\x12\x15\n\rSpecification\x18\x05 \x01(\t\x12\x15\n\rTaskStageList\x18\x06 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x07 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x08 \x01(\t\x12\x12\n\nRegionList\x18\t \x01(\t\"\xca\x01\n#DescribeVodSpaceAIStatisDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0bMediaAiType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"\xd1\x01\n)DescribeVodSpaceSubtitleStatisDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cSubtitleType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"\xcd\x01\n\'DescribeVodSpaceDetectStatisDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x12\n\nDetectType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"\xc6\x01\n\x1e\x44\x65scribeVodSnapshotDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cSnapshotType\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x07 \x01(\t\x12\x12\n\nRegionList\x18\x08 \x01(\t\"\x91\x01\n)DescribeVodSpaceWorkflowDetailDataRequest\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\"\x8d\x01\n%DescribeVodSpaceEditDetailDataRequest\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\"_\n%DescribeVodPlayFileLogByDomainRequest\x12\x11\n\tStartTime\x18\x01 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x02 \x01(\t\x12\x12\n\nDomainList\x18\x03 \x01(\t\"\xb1\x01\n\"DescribeVodEnhanceImageDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x14\n\x0cTaskTypeList\x18\x04 \x01(\t\x12\x15\n\rTaskStageList\x18\x05 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x06 \x01(\x03\x12\x12\n\nRegionList\x18\x07 \x01(\t\"\xb7\x01\n%DescribeVodSpaceEditStatisDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x15\n\rSpecification\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x06 \x01(\t\x12\x12\n\nRegionList\x18\x07 \x01(\t\"{\n\"DescribeVodPlayedStatisDataRequest\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x0f\n\x07VidList\x18\x04 \x01(\t\x12\x11\n\tOrderType\x18\x05 \x01(\t\"|\n&DescribeVodMostPlayedStatisDataRequest\x12\r\n\x05Space\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x11\n\tOrderType\x18\x04 \x01(\t\x12\x0c\n\x04TopN\x18\x05 \x01(\x03\"\x9f\x01\n#DescribeVodRealtimeMediaDataRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\x12\x13\n\x0bProcessType\x18\x04 \x01(\t\x12\x13\n\x0b\x41ggregation\x18\x05 \x01(\x03\x12\x17\n\x0f\x44\x65tailFieldList\x18\x06 \x01(\t\"\x91\x01\n)DescribeVodRealtimeMediaDetailDataRequest\x12\x0e\n\x06Region\x18\x01 \x01(\t\x12\r\n\x05Space\x18\x02 \x01(\t\x12\x11\n\tStartTime\x18\x03 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x04 \x01(\t\x12\x10\n\x08PageSize\x18\x05 \x01(\x03\x12\x0f\n\x07PageNum\x18\x06 \x01(\x03\"\\\n#DescribeVodVidTrafficFileLogRequest\x12\x11\n\tSpaceList\x18\x01 \x01(\t\x12\x11\n\tStartTime\x18\x02 \x01(\t\x12\x0f\n\x07\x45ndTime\x18\x03 \x01(\t\"A\n\x1eVodSubmitBlockMediaTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Vids\x18\x02 \x01(\t\"C\n VodSubmitUnblockMediaTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Vids\x18\x02 \x01(\t\"B\n\x1fVodQueryMediaBlockStatusRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Vids\x18\x02 \x01(\t\"\x18\n\x16VodListProjectsRequest\"!\n\x1fVodGetTradeConfigurationRequest\"4\n\x15VodReportEventRequest\x12\n\n\x02Id\x18\x01 \x01(\t\x12\x0f\n\x07Reports\x18\x02 \x01(\x0c\"\xae\x01\n\x1cVodSetCloudMigrateJobRequest\x12\r\n\x05JobId\x18\x01 \x01(\x03\x12S\n\rJobSourceInfo\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodCloudMigrateJobSourceInfo\x12\x17\n\x0f\x43\x61llbackAddress\x18\x03 \x01(\t\x12\x11\n\tSpaceName\x18\x04 \x01(\t\"\x91\x01\n\x1fVodSubmitCloudMigrateJobRequest\x12\r\n\x05JobId\x18\x01 \x01(\x03\x12\x10\n\x08SubAppId\x18\x02 \x01(\t\x12\x11\n\tSourceVid\x18\x03 \x01(\t\x12\x11\n\tTargetVid\x18\x04 \x01(\t\x12\x14\n\x0c\x43\x61llbackArgs\x18\x05 \x01(\t\x12\x11\n\tSpaceName\x18\x06 \x01(\t\"@\n\x1cVodGetCloudMigrateJobRequest\x12\r\n\x05JobId\x18\x01 \x01(\x03\x12\x11\n\tSpaceName\x18\x02 \x01(\t\"\x8e\x04\n\x1eVodCreateDramaRecapTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Vids\x18\x02 \x03(\t\x12\x1e\n\x11\x44ramaScriptTaskId\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x11\n\tRecapText\x18\x04 \x01(\t\x12[\n\rSpeakerConfig\x18\x05 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskSpeakerConfig\x12\x1c\n\x0fIsEraseSubtitle\x18\x06 \x01(\x08H\x01\x88\x01\x01\x12U\n\nFontConfig\x18\x07 \x01(\x0b\x32\x41.Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskFontconfig\x12\x1f\n\x12\x42\x61tchGenerateCount\x18\x08 \x01(\x05H\x02\x88\x01\x01\x12O\n\x10\x44ramaRecapConfig\x18\t \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.DramaRecapConfigH\x03\x88\x01\x01\x42\x14\n\x12_DramaScriptTaskIdB\x12\n\x10_IsEraseSubtitleB\x15\n\x13_BatchGenerateCountB\x13\n\x11_DramaRecapConfig\"\xc9\x01\n\x1fVodCreateDramaScriptTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0c\n\x04Vids\x18\x02 \x03(\t\x12#\n\x16ReRunDramaScriptTaskId\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x0fHasHardSubtitle\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12\x13\n\x0b\x43lientToken\x18\x05 \x01(\tB\x19\n\x17_ReRunDramaScriptTaskIdB\x12\n\x10_HasHardSubtitle\"B\n\x1dVodQueryDramaRecapTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\"C\n\x1eVodQueryDramaScriptTaskRequest\x12\x11\n\tSpaceName\x18\x01 \x01(\t\x12\x0e\n\x06TaskId\x18\x02 \x01(\t\"\x8f\x01\n\x1cVodGetMediaEntityListRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x13\n\x0b\x45ntityTypes\x18\x02 \x01(\t\x12\x16\n\x0e\x45ntityVersions\x18\x03 \x01(\t\x12\x0f\n\x07Sources\x18\x04 \x01(\t\x12\x12\n\nPageNumber\x18\x05 \x01(\x05\x12\x10\n\x08PageSize\x18\x06 \x01(\x05\"i\n\x18VodGetMediaEntityRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x12\n\nEntityType\x18\x02 \x01(\t\x12\x15\n\rEntityVersion\x18\x03 \x01(\t\x12\x15\n\rNeedPublicUrl\x18\x04 \x01(\x08\"U\n\x1bVodDeleteMediaEntityRequest\x12\x0b\n\x03Vid\x18\x01 \x01(\t\x12\x12\n\nEntityType\x18\x02 \x01(\t\x12\x15\n\rEntityVersion\x18\x03 \x01(\tB\xc8\x01\n(com.volcengine.service.vod.model.requestB\nVodRequestP\x01Z@github.com/volcengine/volc-sdk-golang/service/vod/models/request\xa0\x01\x01\xd8\x01\x01\xca\x02\x1fVolc\\Service\\Vod\\Models\\Request\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODGETALLPLAYINFOREQUEST = DESCRIPTOR.message_types_by_name['VodGetAllPlayInfoRequest'] _VODGETPLAYINFOREQUEST = DESCRIPTOR.message_types_by_name['VodGetPlayInfoRequest'] _VODGETPRIVATEDRMPLAYAUTHREQUEST = DESCRIPTOR.message_types_by_name['VodGetPrivateDrmPlayAuthRequest'] _VODGETHLSDECRYPTIONKEYREQUEST = DESCRIPTOR.message_types_by_name['VodGetHlsDecryptionKeyRequest'] _VODCREATEHLSDECRYPTIONKEYREQUEST = DESCRIPTOR.message_types_by_name['VodCreateHlsDecryptionKeyRequest'] _VODGETPLAYINFOWITHLIVETIMESHIFTSCENEREQUEST = DESCRIPTOR.message_types_by_name['VodGetPlayInfoWithLiveTimeShiftSceneRequest'] _VODDESCRIBEDRMDATAKEYREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeDrmDataKeyRequest'] _VODSUBMITMOVEOBJECTTASKREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitMoveObjectTaskRequest'] _VODQUERYMOVEOBJECTTASKINFOREQUEST = DESCRIPTOR.message_types_by_name['VodQueryMoveObjectTaskInfoRequest'] _VODSUBMITBLOCKOBJECTTASKSREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitBlockObjectTasksRequest'] _VODLISTBLOCKOBJECTTASKSREQUEST = DESCRIPTOR.message_types_by_name['VodListBlockObjectTasksRequest'] _VODURLUPLOADREQUEST = DESCRIPTOR.message_types_by_name['VodUrlUploadRequest'] _VODQUERYUPLOADTASKINFOREQUEST = DESCRIPTOR.message_types_by_name['VodQueryUploadTaskInfoRequest'] _VODAPPLYUPLOADINFOREQUEST = DESCRIPTOR.message_types_by_name['VodApplyUploadInfoRequest'] _VODUPLOADMEDIAREQUEST = DESCRIPTOR.message_types_by_name['VodUploadMediaRequest'] _VODUPLOADMATERIALREQUEST = DESCRIPTOR.message_types_by_name['VodUploadMaterialRequest'] _VODUPLOADOBJECTREQUEST = DESCRIPTOR.message_types_by_name['VodUploadObjectRequest'] _VODCOMMITUPLOADINFOREQUEST = DESCRIPTOR.message_types_by_name['VodCommitUploadInfoRequest'] _VODURLUPLOADJSONREQUEST = DESCRIPTOR.message_types_by_name['VodUrlUploadJsonRequest'] _VODPARSEUPLOADMANIFESTREQUEST = DESCRIPTOR.message_types_by_name['VodParseUploadManifestRequest'] _VODLISTFILEMETAINFOSBYFILENAMESREQUEST = DESCRIPTOR.message_types_by_name['VodListFileMetaInfosByFileNamesRequest'] _VODGETRECOMMENDEDPOSTERREQUEST = DESCRIPTOR.message_types_by_name['VodGetRecommendedPosterRequest'] _VODUPDATEMEDIAPUBLISHSTATUSREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateMediaPublishStatusRequest'] _VODUPDATEMEDIASTORAGECLASSREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateMediaStorageClassRequest'] _VODUPDATEMEDIAINFOREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateMediaInfoRequest'] _VODGETMEDIAINFOSREQUEST = DESCRIPTOR.message_types_by_name['VodGetMediaInfosRequest'] _VODDELETEMATERIALREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteMaterialRequest'] _VODDELETEMEDIAREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteMediaRequest'] _VODDELETETRANSCODESREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteTranscodesRequest'] _VODDELETEMEDIATOSFILEREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteMediaTosFileRequest'] _VODGETMEDIALISTREQUEST = DESCRIPTOR.message_types_by_name['VodGetMediaListRequest'] _VODGETSUBTITLEINFOLISTREQUEST = DESCRIPTOR.message_types_by_name['VodGetSubtitleInfoListRequest'] _VODUPDATESUBTITLESTATUSREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateSubtitleStatusRequest'] _VODUPDATESUBTITLEINFOREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateSubtitleInfoRequest'] _VODGETAUDITFRAMESFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetAuditFramesForAuditRequest'] _VODGETMLFRAMESFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetMLFramesForAuditRequest'] _VODGETBETTERFRAMESFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetBetterFramesForAuditRequest'] _VODGETAUDIOINFOFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetAudioInfoForAuditRequest'] _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetAutomaticSpeechRecognitionForAuditRequest'] _VODGETAUDIOEVENTDETECTIONFORAUDITREQUEST = DESCRIPTOR.message_types_by_name['VodGetAudioEventDetectionForAuditRequest'] _VODCREATEVIDEOCLASSIFICATIONREQUEST = DESCRIPTOR.message_types_by_name['VodCreateVideoClassificationRequest'] _VODUPDATEVIDEOCLASSIFICATIONREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateVideoClassificationRequest'] _VODDELETEVIDEOCLASSIFICATIONREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteVideoClassificationRequest'] _VODLISTVIDEOCLASSIFICATIONSREQUEST = DESCRIPTOR.message_types_by_name['VodListVideoClassificationsRequest'] _VODLISTSNAPSHOTSREQUEST = DESCRIPTOR.message_types_by_name['VodListSnapshotsRequest'] _VODGETFILELISTREQUEST = DESCRIPTOR.message_types_by_name['VodGetFileListRequest'] _VODGETFILEINFOSREQUEST = DESCRIPTOR.message_types_by_name['VodGetFileInfosRequest'] _VODUPDATEFILESTORAGECLASSREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateFileStorageClassRequest'] _VODGETINNERAUDITURLSREQUEST = DESCRIPTOR.message_types_by_name['VodGetInnerAuditURLsRequest'] _VODGETADAUDITRESULTBYVIDREQUEST = DESCRIPTOR.message_types_by_name['VodGetAdAuditResultByVidRequest'] _VODEXTRACTMEDIAMETATASKREQUEST = DESCRIPTOR.message_types_by_name['VodExtractMediaMetaTaskRequest'] _VODSTARTWORKFLOWREQUEST = DESCRIPTOR.message_types_by_name['VodStartWorkflowRequest'] _VODRETRIEVETRANSCODERESULTREQUEST = DESCRIPTOR.message_types_by_name['VodRetrieveTranscodeResultRequest'] _VODLISTWORKFLOWEXECUTIONREQUEST = DESCRIPTOR.message_types_by_name['VodListWorkflowExecutionRequest'] _VODGETWORKFLOWEXECUTIONDETAILREQUEST = DESCRIPTOR.message_types_by_name['VodGetWorkflowExecutionDetailRequest'] _VODGETWORKFLOWRESULTREQUEST = DESCRIPTOR.message_types_by_name['VodGetWorkflowResultRequest'] _VODGETWORKFLOWEXECUTIONSTATUSREQUEST = DESCRIPTOR.message_types_by_name['VodGetWorkflowExecutionStatusRequest'] _VODCREATETASKTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodCreateTaskTemplateRequest'] _VODUPDATETASKTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateTaskTemplateRequest'] _VODDELETETASKTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteTaskTemplateRequest'] _VODGETTASKTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodGetTaskTemplateRequest'] _VODLISTTASKTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodListTaskTemplateRequest'] _VODCREATEWATERMARKREQUEST = DESCRIPTOR.message_types_by_name['VodCreateWatermarkRequest'] _VODUPDATEWATERMARKREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateWatermarkRequest'] _VODDELETEWATERMARKREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteWatermarkRequest'] _VODGETWATERMARKREQUEST = DESCRIPTOR.message_types_by_name['VodGetWatermarkRequest'] _VODLISTWATERMARKREQUEST = DESCRIPTOR.message_types_by_name['VodListWatermarkRequest'] _VODCREATEWORKFLOWTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodCreateWorkflowTemplateRequest'] _VODUPDATEWORKFLOWTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateWorkflowTemplateRequest'] _VODDELETEWORKFLOWTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteWorkflowTemplateRequest'] _VODGETWORKFLOWTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodGetWorkflowTemplateRequest'] _VODLISTWORKFLOWTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['VodListWorkflowTemplateRequest'] _VODSUBMITDIRECTEDITTASKASYNCREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitDirectEditTaskAsyncRequest'] _VODSUBMITDIRECTEDITTASKSYNCREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitDirectEditTaskSyncRequest'] _VODGETDIRECTEDITRESULTREQUEST = DESCRIPTOR.message_types_by_name['VodGetDirectEditResultRequest'] _VODGETDIRECTEDITPROGRESSREQUEST = DESCRIPTOR.message_types_by_name['VodGetDirectEditProgressRequest'] _VODCANCELDIRECTEDITTASKREQUEST = DESCRIPTOR.message_types_by_name['VodCancelDirectEditTaskRequest'] _VODASYNCVCREATIVETASKREQUEST = DESCRIPTOR.message_types_by_name['VodAsyncVCreativeTaskRequest'] _VODGETVCREATIVETASKRESULTREQUEST = DESCRIPTOR.message_types_by_name['VodGetVCreativeTaskResultRequest'] _VODDELETESPACEREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteSpaceRequest'] _VODCREATESPACEREQUEST = DESCRIPTOR.message_types_by_name['VodCreateSpaceRequest'] _VODGETSPACEDETAILREQUEST = DESCRIPTOR.message_types_by_name['VodGetSpaceDetailRequest'] _VODLISTSPACEREQUEST = DESCRIPTOR.message_types_by_name['VodListSpaceRequest'] _VODUPDATESPACEREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateSpaceRequest'] _VODUPDATESPACEUPLOADCONFIGREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateSpaceUploadConfigRequest'] _VODDESCRIBEUPLOADSPACECONFIGREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeUploadSpaceConfigRequest'] _VODUPDATEUPLOADSPACECONFIGREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateUploadSpaceConfigRequest'] _VODDESCRIBEVODSPACESTORAGEDATAREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeVodSpaceStorageDataRequest'] _VODUPDATEDOMAINPLAYRULEREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateDomainPlayRuleRequest'] _VODADDDOMAINTOSCHEDULERREQUEST = DESCRIPTOR.message_types_by_name['VodAddDomainToSchedulerRequest'] _VODREMOVEDOMAINFROMSCHEDULERREQUEST = DESCRIPTOR.message_types_by_name['VodRemoveDomainFromSchedulerRequest'] _VODDELETEDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteDomainRequest'] _VODSTARTDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodStartDomainRequest'] _VODSTOPDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodStopDomainRequest'] _VODLISTDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodListDomainRequest'] _VODCREATECDNREFRESHTASKREQUEST = DESCRIPTOR.message_types_by_name['VodCreateCdnRefreshTaskRequest'] _VODCREATECDNPRELOADTASKREQUEST = DESCRIPTOR.message_types_by_name['VodCreateCdnPreloadTaskRequest'] _VODLISTCDNTASKSREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnTasksRequest'] _VODLISTCDNACCESSLOGREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnAccessLogRequest'] _VODLISTCDNTOPACCESSURLREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessUrlRequest'] _VODLISTCDNTOPACCESSREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessRequest'] _VODDESCRIBEVODDOMAINBANDWIDTHDATAREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainBandwidthDataRequest'] _VODLISTCDNUSAGEDATAREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnUsageDataRequest'] _VODLISTCDNSTATUSDATAREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnStatusDataRequest'] _VODDESCRIBEIPINFOREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeIPInfoRequest'] _VODLISTCDNPVDATAREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnPvDataRequest'] _VODLISTCDNHITRATEDATAREQUEST = DESCRIPTOR.message_types_by_name['VodListCdnHitrateDataRequest'] _VODDESCRIBEVODDOMAINTRAFFICDATAREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainTrafficDataRequest'] _VODSUBMITBLOCKTASKSREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitBlockTasksRequest'] _VODGETCONTENTBLOCKTASKSREQUEST = DESCRIPTOR.message_types_by_name['VodGetContentBlockTasksRequest'] _VODCREATEDOMAINV2REQUEST = DESCRIPTOR.message_types_by_name['VodCreateDomainV2Request'] _VODCREATEDOMAINV3REQUEST = DESCRIPTOR.message_types_by_name['VodCreateDomainV3Request'] _VODUPDATEDOMAINEXPIREV2REQUEST = DESCRIPTOR.message_types_by_name['VodUpdateDomainExpireV2Request'] _VODUPDATEDOMAINAUTHCONFIGV2REQUEST = DESCRIPTOR.message_types_by_name['VodUpdateDomainAuthConfigV2Request'] _VODUPDATEDOMAINURLAUTHCONFIGV2REQUEST = DESCRIPTOR.message_types_by_name['VodUpdateDomainUrlAuthConfigV2Request'] _VODDESCRIBECDNEDGEIPREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeCdnEdgeIpRequest'] _VODDESCRIBECDNREGIONANDISPREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeCdnRegionAndIspRequest'] _VODVERIFYDOMAINOWNERREQUEST = DESCRIPTOR.message_types_by_name['VodVerifyDomainOwnerRequest'] _VODDESCRIBEDOMAINVERIFYCONTENTREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeDomainVerifyContentRequest'] _VODLISTPCDNDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodListPCDNDomainRequest'] _VODCREATEPCDNDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodCreatePCDNDomainRequest'] _VODSTARTPCDNDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodStartPCDNDomainRequest'] _VODSTOPPCDNDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodStopPCDNDomainRequest'] _VODDELETEPCDNDOMAINREQUEST = DESCRIPTOR.message_types_by_name['VodDeletePCDNDomainRequest'] _VODUPDATEDOMAINCONFIGREQUEST = DESCRIPTOR.message_types_by_name['VodUpdateDomainConfigRequest'] _VODDESCRIBEDOMAINCONFIGREQUEST = DESCRIPTOR.message_types_by_name['VodDescribeDomainConfigRequest'] _ADDORUPDATECERTIFICATEV2REQUEST = DESCRIPTOR.message_types_by_name['AddOrUpdateCertificateV2Request'] _UPDATEDOMAINAREAREQUEST = DESCRIPTOR.message_types_by_name['UpdateDomainAreaRequest'] _VODADDCALLBACKSUBSCRIPTIONREQUEST = DESCRIPTOR.message_types_by_name['VodAddCallbackSubscriptionRequest'] _VODSETCALLBACKEVENTREQUEST = DESCRIPTOR.message_types_by_name['VodSetCallbackEventRequest'] _GETCALLBACKRECORDREQUEST = DESCRIPTOR.message_types_by_name['GetCallbackRecordRequest'] _VODGETSMARTSTRATEGYLITEPLAYINFOREQUEST = DESCRIPTOR.message_types_by_name['VodGetSmartStrategyLitePlayInfoRequest'] _VODGETAPPINFOREQUEST = DESCRIPTOR.message_types_by_name['VodGetAppInfoRequest'] _DESCRIBEVODSPACETRANSCODEDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeDataRequest'] _DESCRIBEVODSPACEAISTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceAIStatisDataRequest'] _DESCRIBEVODSPACESUBTITLESTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceSubtitleStatisDataRequest'] _DESCRIBEVODSPACEDETECTSTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceDetectStatisDataRequest'] _DESCRIBEVODSNAPSHOTDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSnapshotDataRequest'] _DESCRIBEVODSPACEWORKFLOWDETAILDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowDetailDataRequest'] _DESCRIBEVODSPACEEDITDETAILDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditDetailDataRequest'] _DESCRIBEVODPLAYFILELOGBYDOMAINREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodPlayFileLogByDomainRequest'] _DESCRIBEVODENHANCEIMAGEDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodEnhanceImageDataRequest'] _DESCRIBEVODSPACEEDITSTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDataRequest'] _DESCRIBEVODPLAYEDSTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodPlayedStatisDataRequest'] _DESCRIBEVODMOSTPLAYEDSTATISDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodMostPlayedStatisDataRequest'] _DESCRIBEVODREALTIMEMEDIADATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDataRequest'] _DESCRIBEVODREALTIMEMEDIADETAILDATAREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDetailDataRequest'] _DESCRIBEVODVIDTRAFFICFILELOGREQUEST = DESCRIPTOR.message_types_by_name['DescribeVodVidTrafficFileLogRequest'] _VODSUBMITBLOCKMEDIATASKREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitBlockMediaTaskRequest'] _VODSUBMITUNBLOCKMEDIATASKREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitUnblockMediaTaskRequest'] _VODQUERYMEDIABLOCKSTATUSREQUEST = DESCRIPTOR.message_types_by_name['VodQueryMediaBlockStatusRequest'] _VODLISTPROJECTSREQUEST = DESCRIPTOR.message_types_by_name['VodListProjectsRequest'] _VODGETTRADECONFIGURATIONREQUEST = DESCRIPTOR.message_types_by_name['VodGetTradeConfigurationRequest'] _VODREPORTEVENTREQUEST = DESCRIPTOR.message_types_by_name['VodReportEventRequest'] _VODSETCLOUDMIGRATEJOBREQUEST = DESCRIPTOR.message_types_by_name['VodSetCloudMigrateJobRequest'] _VODSUBMITCLOUDMIGRATEJOBREQUEST = DESCRIPTOR.message_types_by_name['VodSubmitCloudMigrateJobRequest'] _VODGETCLOUDMIGRATEJOBREQUEST = DESCRIPTOR.message_types_by_name['VodGetCloudMigrateJobRequest'] _VODCREATEDRAMARECAPTASKREQUEST = DESCRIPTOR.message_types_by_name['VodCreateDramaRecapTaskRequest'] _VODCREATEDRAMASCRIPTTASKREQUEST = DESCRIPTOR.message_types_by_name['VodCreateDramaScriptTaskRequest'] _VODQUERYDRAMARECAPTASKREQUEST = DESCRIPTOR.message_types_by_name['VodQueryDramaRecapTaskRequest'] _VODQUERYDRAMASCRIPTTASKREQUEST = DESCRIPTOR.message_types_by_name['VodQueryDramaScriptTaskRequest'] _VODGETMEDIAENTITYLISTREQUEST = DESCRIPTOR.message_types_by_name['VodGetMediaEntityListRequest'] _VODGETMEDIAENTITYREQUEST = DESCRIPTOR.message_types_by_name['VodGetMediaEntityRequest'] _VODDELETEMEDIAENTITYREQUEST = DESCRIPTOR.message_types_by_name['VodDeleteMediaEntityRequest'] VodGetAllPlayInfoRequest = _reflection.GeneratedProtocolMessageType('VodGetAllPlayInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETALLPLAYINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAllPlayInfoRequest) }) _sym_db.RegisterMessage(VodGetAllPlayInfoRequest) VodGetPlayInfoRequest = _reflection.GeneratedProtocolMessageType('VodGetPlayInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETPLAYINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetPlayInfoRequest) }) _sym_db.RegisterMessage(VodGetPlayInfoRequest) VodGetPrivateDrmPlayAuthRequest = _reflection.GeneratedProtocolMessageType('VodGetPrivateDrmPlayAuthRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETPRIVATEDRMPLAYAUTHREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetPrivateDrmPlayAuthRequest) }) _sym_db.RegisterMessage(VodGetPrivateDrmPlayAuthRequest) VodGetHlsDecryptionKeyRequest = _reflection.GeneratedProtocolMessageType('VodGetHlsDecryptionKeyRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETHLSDECRYPTIONKEYREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetHlsDecryptionKeyRequest) }) _sym_db.RegisterMessage(VodGetHlsDecryptionKeyRequest) VodCreateHlsDecryptionKeyRequest = _reflection.GeneratedProtocolMessageType('VodCreateHlsDecryptionKeyRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEHLSDECRYPTIONKEYREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateHlsDecryptionKeyRequest) }) _sym_db.RegisterMessage(VodCreateHlsDecryptionKeyRequest) VodGetPlayInfoWithLiveTimeShiftSceneRequest = _reflection.GeneratedProtocolMessageType('VodGetPlayInfoWithLiveTimeShiftSceneRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETPLAYINFOWITHLIVETIMESHIFTSCENEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetPlayInfoWithLiveTimeShiftSceneRequest) }) _sym_db.RegisterMessage(VodGetPlayInfoWithLiveTimeShiftSceneRequest) VodDescribeDrmDataKeyRequest = _reflection.GeneratedProtocolMessageType('VodDescribeDrmDataKeyRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDRMDATAKEYREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeDrmDataKeyRequest) }) _sym_db.RegisterMessage(VodDescribeDrmDataKeyRequest) VodSubmitMoveObjectTaskRequest = _reflection.GeneratedProtocolMessageType('VodSubmitMoveObjectTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITMOVEOBJECTTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitMoveObjectTaskRequest) }) _sym_db.RegisterMessage(VodSubmitMoveObjectTaskRequest) VodQueryMoveObjectTaskInfoRequest = _reflection.GeneratedProtocolMessageType('VodQueryMoveObjectTaskInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMOVEOBJECTTASKINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodQueryMoveObjectTaskInfoRequest) }) _sym_db.RegisterMessage(VodQueryMoveObjectTaskInfoRequest) VodSubmitBlockObjectTasksRequest = _reflection.GeneratedProtocolMessageType('VodSubmitBlockObjectTasksRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKOBJECTTASKSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitBlockObjectTasksRequest) }) _sym_db.RegisterMessage(VodSubmitBlockObjectTasksRequest) VodListBlockObjectTasksRequest = _reflection.GeneratedProtocolMessageType('VodListBlockObjectTasksRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTBLOCKOBJECTTASKSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListBlockObjectTasksRequest) }) _sym_db.RegisterMessage(VodListBlockObjectTasksRequest) VodUrlUploadRequest = _reflection.GeneratedProtocolMessageType('VodUrlUploadRequest', (_message.Message,), { 'DESCRIPTOR' : _VODURLUPLOADREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUrlUploadRequest) }) _sym_db.RegisterMessage(VodUrlUploadRequest) VodQueryUploadTaskInfoRequest = _reflection.GeneratedProtocolMessageType('VodQueryUploadTaskInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYUPLOADTASKINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodQueryUploadTaskInfoRequest) }) _sym_db.RegisterMessage(VodQueryUploadTaskInfoRequest) VodApplyUploadInfoRequest = _reflection.GeneratedProtocolMessageType('VodApplyUploadInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODAPPLYUPLOADINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodApplyUploadInfoRequest) }) _sym_db.RegisterMessage(VodApplyUploadInfoRequest) VodUploadMediaRequest = _reflection.GeneratedProtocolMessageType('VodUploadMediaRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADMEDIAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUploadMediaRequest) }) _sym_db.RegisterMessage(VodUploadMediaRequest) VodUploadMaterialRequest = _reflection.GeneratedProtocolMessageType('VodUploadMaterialRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADMATERIALREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUploadMaterialRequest) }) _sym_db.RegisterMessage(VodUploadMaterialRequest) VodUploadObjectRequest = _reflection.GeneratedProtocolMessageType('VodUploadObjectRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADOBJECTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUploadObjectRequest) }) _sym_db.RegisterMessage(VodUploadObjectRequest) VodCommitUploadInfoRequest = _reflection.GeneratedProtocolMessageType('VodCommitUploadInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITUPLOADINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCommitUploadInfoRequest) }) _sym_db.RegisterMessage(VodCommitUploadInfoRequest) VodUrlUploadJsonRequest = _reflection.GeneratedProtocolMessageType('VodUrlUploadJsonRequest', (_message.Message,), { 'DESCRIPTOR' : _VODURLUPLOADJSONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUrlUploadJsonRequest) }) _sym_db.RegisterMessage(VodUrlUploadJsonRequest) VodParseUploadManifestRequest = _reflection.GeneratedProtocolMessageType('VodParseUploadManifestRequest', (_message.Message,), { 'DESCRIPTOR' : _VODPARSEUPLOADMANIFESTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodParseUploadManifestRequest) }) _sym_db.RegisterMessage(VodParseUploadManifestRequest) VodListFileMetaInfosByFileNamesRequest = _reflection.GeneratedProtocolMessageType('VodListFileMetaInfosByFileNamesRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTFILEMETAINFOSBYFILENAMESREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListFileMetaInfosByFileNamesRequest) }) _sym_db.RegisterMessage(VodListFileMetaInfosByFileNamesRequest) VodGetRecommendedPosterRequest = _reflection.GeneratedProtocolMessageType('VodGetRecommendedPosterRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETRECOMMENDEDPOSTERREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetRecommendedPosterRequest) }) _sym_db.RegisterMessage(VodGetRecommendedPosterRequest) VodUpdateMediaPublishStatusRequest = _reflection.GeneratedProtocolMessageType('VodUpdateMediaPublishStatusRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIAPUBLISHSTATUSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateMediaPublishStatusRequest) }) _sym_db.RegisterMessage(VodUpdateMediaPublishStatusRequest) VodUpdateMediaStorageClassRequest = _reflection.GeneratedProtocolMessageType('VodUpdateMediaStorageClassRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIASTORAGECLASSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateMediaStorageClassRequest) }) _sym_db.RegisterMessage(VodUpdateMediaStorageClassRequest) VodUpdateMediaInfoRequest = _reflection.GeneratedProtocolMessageType('VodUpdateMediaInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIAINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateMediaInfoRequest) }) _sym_db.RegisterMessage(VodUpdateMediaInfoRequest) VodGetMediaInfosRequest = _reflection.GeneratedProtocolMessageType('VodGetMediaInfosRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAINFOSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetMediaInfosRequest) }) _sym_db.RegisterMessage(VodGetMediaInfosRequest) VodDeleteMaterialRequest = _reflection.GeneratedProtocolMessageType('VodDeleteMaterialRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMATERIALREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteMaterialRequest) }) _sym_db.RegisterMessage(VodDeleteMaterialRequest) VodDeleteMediaRequest = _reflection.GeneratedProtocolMessageType('VodDeleteMediaRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteMediaRequest) }) _sym_db.RegisterMessage(VodDeleteMediaRequest) VodDeleteTranscodesRequest = _reflection.GeneratedProtocolMessageType('VodDeleteTranscodesRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETETRANSCODESREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteTranscodesRequest) }) _sym_db.RegisterMessage(VodDeleteTranscodesRequest) VodDeleteMediaTosFileRequest = _reflection.GeneratedProtocolMessageType('VodDeleteMediaTosFileRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIATOSFILEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteMediaTosFileRequest) }) _sym_db.RegisterMessage(VodDeleteMediaTosFileRequest) VodGetMediaListRequest = _reflection.GeneratedProtocolMessageType('VodGetMediaListRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIALISTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetMediaListRequest) }) _sym_db.RegisterMessage(VodGetMediaListRequest) VodGetSubtitleInfoListRequest = _reflection.GeneratedProtocolMessageType('VodGetSubtitleInfoListRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETSUBTITLEINFOLISTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetSubtitleInfoListRequest) }) _sym_db.RegisterMessage(VodGetSubtitleInfoListRequest) VodUpdateSubtitleStatusRequest = _reflection.GeneratedProtocolMessageType('VodUpdateSubtitleStatusRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESUBTITLESTATUSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateSubtitleStatusRequest) }) _sym_db.RegisterMessage(VodUpdateSubtitleStatusRequest) VodUpdateSubtitleInfoRequest = _reflection.GeneratedProtocolMessageType('VodUpdateSubtitleInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESUBTITLEINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateSubtitleInfoRequest) }) _sym_db.RegisterMessage(VodUpdateSubtitleInfoRequest) VodGetAuditFramesForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetAuditFramesForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDITFRAMESFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAuditFramesForAuditRequest) }) _sym_db.RegisterMessage(VodGetAuditFramesForAuditRequest) VodGetMLFramesForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetMLFramesForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETMLFRAMESFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetMLFramesForAuditRequest) }) _sym_db.RegisterMessage(VodGetMLFramesForAuditRequest) VodGetBetterFramesForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetBetterFramesForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETBETTERFRAMESFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetBetterFramesForAuditRequest) }) _sym_db.RegisterMessage(VodGetBetterFramesForAuditRequest) VodGetAudioInfoForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetAudioInfoForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOINFOFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAudioInfoForAuditRequest) }) _sym_db.RegisterMessage(VodGetAudioInfoForAuditRequest) VodGetAutomaticSpeechRecognitionForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetAutomaticSpeechRecognitionForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAutomaticSpeechRecognitionForAuditRequest) }) _sym_db.RegisterMessage(VodGetAutomaticSpeechRecognitionForAuditRequest) VodGetAudioEventDetectionForAuditRequest = _reflection.GeneratedProtocolMessageType('VodGetAudioEventDetectionForAuditRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOEVENTDETECTIONFORAUDITREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAudioEventDetectionForAuditRequest) }) _sym_db.RegisterMessage(VodGetAudioEventDetectionForAuditRequest) VodCreateVideoClassificationRequest = _reflection.GeneratedProtocolMessageType('VodCreateVideoClassificationRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEVIDEOCLASSIFICATIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateVideoClassificationRequest) }) _sym_db.RegisterMessage(VodCreateVideoClassificationRequest) VodUpdateVideoClassificationRequest = _reflection.GeneratedProtocolMessageType('VodUpdateVideoClassificationRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEVIDEOCLASSIFICATIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateVideoClassificationRequest) }) _sym_db.RegisterMessage(VodUpdateVideoClassificationRequest) VodDeleteVideoClassificationRequest = _reflection.GeneratedProtocolMessageType('VodDeleteVideoClassificationRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEVIDEOCLASSIFICATIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteVideoClassificationRequest) }) _sym_db.RegisterMessage(VodDeleteVideoClassificationRequest) VodListVideoClassificationsRequest = _reflection.GeneratedProtocolMessageType('VodListVideoClassificationsRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTVIDEOCLASSIFICATIONSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListVideoClassificationsRequest) }) _sym_db.RegisterMessage(VodListVideoClassificationsRequest) VodListSnapshotsRequest = _reflection.GeneratedProtocolMessageType('VodListSnapshotsRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTSNAPSHOTSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListSnapshotsRequest) }) _sym_db.RegisterMessage(VodListSnapshotsRequest) VodGetFileListRequest = _reflection.GeneratedProtocolMessageType('VodGetFileListRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILELISTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetFileListRequest) }) _sym_db.RegisterMessage(VodGetFileListRequest) VodGetFileInfosRequest = _reflection.GeneratedProtocolMessageType('VodGetFileInfosRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILEINFOSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetFileInfosRequest) }) _sym_db.RegisterMessage(VodGetFileInfosRequest) VodUpdateFileStorageClassRequest = _reflection.GeneratedProtocolMessageType('VodUpdateFileStorageClassRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEFILESTORAGECLASSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateFileStorageClassRequest) }) _sym_db.RegisterMessage(VodUpdateFileStorageClassRequest) VodGetInnerAuditURLsRequest = _reflection.GeneratedProtocolMessageType('VodGetInnerAuditURLsRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETINNERAUDITURLSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetInnerAuditURLsRequest) }) _sym_db.RegisterMessage(VodGetInnerAuditURLsRequest) VodGetAdAuditResultByVidRequest = _reflection.GeneratedProtocolMessageType('VodGetAdAuditResultByVidRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETADAUDITRESULTBYVIDREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAdAuditResultByVidRequest) }) _sym_db.RegisterMessage(VodGetAdAuditResultByVidRequest) VodExtractMediaMetaTaskRequest = _reflection.GeneratedProtocolMessageType('VodExtractMediaMetaTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODEXTRACTMEDIAMETATASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodExtractMediaMetaTaskRequest) }) _sym_db.RegisterMessage(VodExtractMediaMetaTaskRequest) VodStartWorkflowRequest = _reflection.GeneratedProtocolMessageType('VodStartWorkflowRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTWORKFLOWREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodStartWorkflowRequest) }) _sym_db.RegisterMessage(VodStartWorkflowRequest) VodRetrieveTranscodeResultRequest = _reflection.GeneratedProtocolMessageType('VodRetrieveTranscodeResultRequest', (_message.Message,), { 'DESCRIPTOR' : _VODRETRIEVETRANSCODERESULTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodRetrieveTranscodeResultRequest) }) _sym_db.RegisterMessage(VodRetrieveTranscodeResultRequest) VodListWorkflowExecutionRequest = _reflection.GeneratedProtocolMessageType('VodListWorkflowExecutionRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWEXECUTIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListWorkflowExecutionRequest) }) _sym_db.RegisterMessage(VodListWorkflowExecutionRequest) VodGetWorkflowExecutionDetailRequest = _reflection.GeneratedProtocolMessageType('VodGetWorkflowExecutionDetailRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWEXECUTIONDETAILREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetWorkflowExecutionDetailRequest) }) _sym_db.RegisterMessage(VodGetWorkflowExecutionDetailRequest) VodGetWorkflowResultRequest = _reflection.GeneratedProtocolMessageType('VodGetWorkflowResultRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWRESULTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetWorkflowResultRequest) }) _sym_db.RegisterMessage(VodGetWorkflowResultRequest) VodGetWorkflowExecutionStatusRequest = _reflection.GeneratedProtocolMessageType('VodGetWorkflowExecutionStatusRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWEXECUTIONSTATUSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetWorkflowExecutionStatusRequest) }) _sym_db.RegisterMessage(VodGetWorkflowExecutionStatusRequest) VodCreateTaskTemplateRequest = _reflection.GeneratedProtocolMessageType('VodCreateTaskTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATETASKTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateTaskTemplateRequest) }) _sym_db.RegisterMessage(VodCreateTaskTemplateRequest) VodUpdateTaskTemplateRequest = _reflection.GeneratedProtocolMessageType('VodUpdateTaskTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATETASKTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateTaskTemplateRequest) }) _sym_db.RegisterMessage(VodUpdateTaskTemplateRequest) VodDeleteTaskTemplateRequest = _reflection.GeneratedProtocolMessageType('VodDeleteTaskTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETETASKTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteTaskTemplateRequest) }) _sym_db.RegisterMessage(VodDeleteTaskTemplateRequest) VodGetTaskTemplateRequest = _reflection.GeneratedProtocolMessageType('VodGetTaskTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETTASKTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetTaskTemplateRequest) }) _sym_db.RegisterMessage(VodGetTaskTemplateRequest) VodListTaskTemplateRequest = _reflection.GeneratedProtocolMessageType('VodListTaskTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTTASKTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListTaskTemplateRequest) }) _sym_db.RegisterMessage(VodListTaskTemplateRequest) VodCreateWatermarkRequest = _reflection.GeneratedProtocolMessageType('VodCreateWatermarkRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEWATERMARKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateWatermarkRequest) }) _sym_db.RegisterMessage(VodCreateWatermarkRequest) VodUpdateWatermarkRequest = _reflection.GeneratedProtocolMessageType('VodUpdateWatermarkRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEWATERMARKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateWatermarkRequest) }) _sym_db.RegisterMessage(VodUpdateWatermarkRequest) VodDeleteWatermarkRequest = _reflection.GeneratedProtocolMessageType('VodDeleteWatermarkRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEWATERMARKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteWatermarkRequest) }) _sym_db.RegisterMessage(VodDeleteWatermarkRequest) VodGetWatermarkRequest = _reflection.GeneratedProtocolMessageType('VodGetWatermarkRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETWATERMARKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetWatermarkRequest) }) _sym_db.RegisterMessage(VodGetWatermarkRequest) VodListWatermarkRequest = _reflection.GeneratedProtocolMessageType('VodListWatermarkRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWATERMARKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListWatermarkRequest) }) _sym_db.RegisterMessage(VodListWatermarkRequest) VodCreateWorkflowTemplateRequest = _reflection.GeneratedProtocolMessageType('VodCreateWorkflowTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEWORKFLOWTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateWorkflowTemplateRequest) }) _sym_db.RegisterMessage(VodCreateWorkflowTemplateRequest) VodUpdateWorkflowTemplateRequest = _reflection.GeneratedProtocolMessageType('VodUpdateWorkflowTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEWORKFLOWTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateWorkflowTemplateRequest) }) _sym_db.RegisterMessage(VodUpdateWorkflowTemplateRequest) VodDeleteWorkflowTemplateRequest = _reflection.GeneratedProtocolMessageType('VodDeleteWorkflowTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEWORKFLOWTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteWorkflowTemplateRequest) }) _sym_db.RegisterMessage(VodDeleteWorkflowTemplateRequest) VodGetWorkflowTemplateRequest = _reflection.GeneratedProtocolMessageType('VodGetWorkflowTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetWorkflowTemplateRequest) }) _sym_db.RegisterMessage(VodGetWorkflowTemplateRequest) VodListWorkflowTemplateRequest = _reflection.GeneratedProtocolMessageType('VodListWorkflowTemplateRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWTEMPLATEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListWorkflowTemplateRequest) }) _sym_db.RegisterMessage(VodListWorkflowTemplateRequest) VodSubmitDirectEditTaskAsyncRequest = _reflection.GeneratedProtocolMessageType('VodSubmitDirectEditTaskAsyncRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITDIRECTEDITTASKASYNCREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitDirectEditTaskAsyncRequest) }) _sym_db.RegisterMessage(VodSubmitDirectEditTaskAsyncRequest) VodSubmitDirectEditTaskSyncRequest = _reflection.GeneratedProtocolMessageType('VodSubmitDirectEditTaskSyncRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITDIRECTEDITTASKSYNCREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitDirectEditTaskSyncRequest) }) _sym_db.RegisterMessage(VodSubmitDirectEditTaskSyncRequest) VodGetDirectEditResultRequest = _reflection.GeneratedProtocolMessageType('VodGetDirectEditResultRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETDIRECTEDITRESULTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetDirectEditResultRequest) }) _sym_db.RegisterMessage(VodGetDirectEditResultRequest) VodGetDirectEditProgressRequest = _reflection.GeneratedProtocolMessageType('VodGetDirectEditProgressRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETDIRECTEDITPROGRESSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetDirectEditProgressRequest) }) _sym_db.RegisterMessage(VodGetDirectEditProgressRequest) VodCancelDirectEditTaskRequest = _reflection.GeneratedProtocolMessageType('VodCancelDirectEditTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCANCELDIRECTEDITTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCancelDirectEditTaskRequest) }) _sym_db.RegisterMessage(VodCancelDirectEditTaskRequest) VodAsyncVCreativeTaskRequest = _reflection.GeneratedProtocolMessageType('VodAsyncVCreativeTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODASYNCVCREATIVETASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodAsyncVCreativeTaskRequest) }) _sym_db.RegisterMessage(VodAsyncVCreativeTaskRequest) VodGetVCreativeTaskResultRequest = _reflection.GeneratedProtocolMessageType('VodGetVCreativeTaskResultRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETVCREATIVETASKRESULTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetVCreativeTaskResultRequest) }) _sym_db.RegisterMessage(VodGetVCreativeTaskResultRequest) VodDeleteSpaceRequest = _reflection.GeneratedProtocolMessageType('VodDeleteSpaceRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETESPACEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteSpaceRequest) }) _sym_db.RegisterMessage(VodDeleteSpaceRequest) VodCreateSpaceRequest = _reflection.GeneratedProtocolMessageType('VodCreateSpaceRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATESPACEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateSpaceRequest) }) _sym_db.RegisterMessage(VodCreateSpaceRequest) VodGetSpaceDetailRequest = _reflection.GeneratedProtocolMessageType('VodGetSpaceDetailRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETSPACEDETAILREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetSpaceDetailRequest) }) _sym_db.RegisterMessage(VodGetSpaceDetailRequest) VodListSpaceRequest = _reflection.GeneratedProtocolMessageType('VodListSpaceRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTSPACEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListSpaceRequest) }) _sym_db.RegisterMessage(VodListSpaceRequest) VodUpdateSpaceRequest = _reflection.GeneratedProtocolMessageType('VodUpdateSpaceRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESPACEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateSpaceRequest) }) _sym_db.RegisterMessage(VodUpdateSpaceRequest) VodUpdateSpaceUploadConfigRequest = _reflection.GeneratedProtocolMessageType('VodUpdateSpaceUploadConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESPACEUPLOADCONFIGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateSpaceUploadConfigRequest) }) _sym_db.RegisterMessage(VodUpdateSpaceUploadConfigRequest) VodDescribeUploadSpaceConfigRequest = _reflection.GeneratedProtocolMessageType('VodDescribeUploadSpaceConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEUPLOADSPACECONFIGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeUploadSpaceConfigRequest) }) _sym_db.RegisterMessage(VodDescribeUploadSpaceConfigRequest) VodUpdateUploadSpaceConfigRequest = _reflection.GeneratedProtocolMessageType('VodUpdateUploadSpaceConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEUPLOADSPACECONFIGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateUploadSpaceConfigRequest) }) _sym_db.RegisterMessage(VodUpdateUploadSpaceConfigRequest) VodDescribeVodSpaceStorageDataRequest = _reflection.GeneratedProtocolMessageType('VodDescribeVodSpaceStorageDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODSPACESTORAGEDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeVodSpaceStorageDataRequest) }) _sym_db.RegisterMessage(VodDescribeVodSpaceStorageDataRequest) VodUpdateDomainPlayRuleRequest = _reflection.GeneratedProtocolMessageType('VodUpdateDomainPlayRuleRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINPLAYRULEREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateDomainPlayRuleRequest) }) _sym_db.RegisterMessage(VodUpdateDomainPlayRuleRequest) VodAddDomainToSchedulerRequest = _reflection.GeneratedProtocolMessageType('VodAddDomainToSchedulerRequest', (_message.Message,), { 'DESCRIPTOR' : _VODADDDOMAINTOSCHEDULERREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodAddDomainToSchedulerRequest) }) _sym_db.RegisterMessage(VodAddDomainToSchedulerRequest) VodRemoveDomainFromSchedulerRequest = _reflection.GeneratedProtocolMessageType('VodRemoveDomainFromSchedulerRequest', (_message.Message,), { 'DESCRIPTOR' : _VODREMOVEDOMAINFROMSCHEDULERREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodRemoveDomainFromSchedulerRequest) }) _sym_db.RegisterMessage(VodRemoveDomainFromSchedulerRequest) VodDeleteDomainRequest = _reflection.GeneratedProtocolMessageType('VodDeleteDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteDomainRequest) }) _sym_db.RegisterMessage(VodDeleteDomainRequest) VodStartDomainRequest = _reflection.GeneratedProtocolMessageType('VodStartDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodStartDomainRequest) }) _sym_db.RegisterMessage(VodStartDomainRequest) VodStopDomainRequest = _reflection.GeneratedProtocolMessageType('VodStopDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSTOPDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodStopDomainRequest) }) _sym_db.RegisterMessage(VodStopDomainRequest) VodListDomainRequest = _reflection.GeneratedProtocolMessageType('VodListDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListDomainRequest) }) _sym_db.RegisterMessage(VodListDomainRequest) VodCreateCdnRefreshTaskRequest = _reflection.GeneratedProtocolMessageType('VodCreateCdnRefreshTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATECDNREFRESHTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateCdnRefreshTaskRequest) }) _sym_db.RegisterMessage(VodCreateCdnRefreshTaskRequest) VodCreateCdnPreloadTaskRequest = _reflection.GeneratedProtocolMessageType('VodCreateCdnPreloadTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATECDNPRELOADTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateCdnPreloadTaskRequest) }) _sym_db.RegisterMessage(VodCreateCdnPreloadTaskRequest) VodListCdnTasksRequest = _reflection.GeneratedProtocolMessageType('VodListCdnTasksRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTASKSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnTasksRequest) }) _sym_db.RegisterMessage(VodListCdnTasksRequest) VodListCdnAccessLogRequest = _reflection.GeneratedProtocolMessageType('VodListCdnAccessLogRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNACCESSLOGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnAccessLogRequest) }) _sym_db.RegisterMessage(VodListCdnAccessLogRequest) VodListCdnTopAccessUrlRequest = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessUrlRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSURLREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnTopAccessUrlRequest) }) _sym_db.RegisterMessage(VodListCdnTopAccessUrlRequest) VodListCdnTopAccessRequest = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnTopAccessRequest) }) _sym_db.RegisterMessage(VodListCdnTopAccessRequest) VodDescribeVodDomainBandwidthDataRequest = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainBandwidthDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINBANDWIDTHDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeVodDomainBandwidthDataRequest) }) _sym_db.RegisterMessage(VodDescribeVodDomainBandwidthDataRequest) VodListCdnUsageDataRequest = _reflection.GeneratedProtocolMessageType('VodListCdnUsageDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNUSAGEDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnUsageDataRequest) }) _sym_db.RegisterMessage(VodListCdnUsageDataRequest) VodListCdnStatusDataRequest = _reflection.GeneratedProtocolMessageType('VodListCdnStatusDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNSTATUSDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnStatusDataRequest) }) _sym_db.RegisterMessage(VodListCdnStatusDataRequest) VodDescribeIPInfoRequest = _reflection.GeneratedProtocolMessageType('VodDescribeIPInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEIPINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeIPInfoRequest) }) _sym_db.RegisterMessage(VodDescribeIPInfoRequest) VodListCdnPvDataRequest = _reflection.GeneratedProtocolMessageType('VodListCdnPvDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNPVDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnPvDataRequest) }) _sym_db.RegisterMessage(VodListCdnPvDataRequest) VodListCdnHitrateDataRequest = _reflection.GeneratedProtocolMessageType('VodListCdnHitrateDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNHITRATEDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListCdnHitrateDataRequest) }) _sym_db.RegisterMessage(VodListCdnHitrateDataRequest) VodDescribeVodDomainTrafficDataRequest = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainTrafficDataRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINTRAFFICDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeVodDomainTrafficDataRequest) }) _sym_db.RegisterMessage(VodDescribeVodDomainTrafficDataRequest) VodSubmitBlockTasksRequest = _reflection.GeneratedProtocolMessageType('VodSubmitBlockTasksRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKTASKSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitBlockTasksRequest) }) _sym_db.RegisterMessage(VodSubmitBlockTasksRequest) VodGetContentBlockTasksRequest = _reflection.GeneratedProtocolMessageType('VodGetContentBlockTasksRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETCONTENTBLOCKTASKSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetContentBlockTasksRequest) }) _sym_db.RegisterMessage(VodGetContentBlockTasksRequest) VodCreateDomainV2Request = _reflection.GeneratedProtocolMessageType('VodCreateDomainV2Request', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDOMAINV2REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateDomainV2Request) }) _sym_db.RegisterMessage(VodCreateDomainV2Request) VodCreateDomainV3Request = _reflection.GeneratedProtocolMessageType('VodCreateDomainV3Request', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDOMAINV3REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateDomainV3Request) }) _sym_db.RegisterMessage(VodCreateDomainV3Request) VodUpdateDomainExpireV2Request = _reflection.GeneratedProtocolMessageType('VodUpdateDomainExpireV2Request', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINEXPIREV2REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateDomainExpireV2Request) }) _sym_db.RegisterMessage(VodUpdateDomainExpireV2Request) VodUpdateDomainAuthConfigV2Request = _reflection.GeneratedProtocolMessageType('VodUpdateDomainAuthConfigV2Request', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINAUTHCONFIGV2REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateDomainAuthConfigV2Request) }) _sym_db.RegisterMessage(VodUpdateDomainAuthConfigV2Request) VodUpdateDomainUrlAuthConfigV2Request = _reflection.GeneratedProtocolMessageType('VodUpdateDomainUrlAuthConfigV2Request', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINURLAUTHCONFIGV2REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateDomainUrlAuthConfigV2Request) }) _sym_db.RegisterMessage(VodUpdateDomainUrlAuthConfigV2Request) VodDescribeCdnEdgeIpRequest = _reflection.GeneratedProtocolMessageType('VodDescribeCdnEdgeIpRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNEDGEIPREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeCdnEdgeIpRequest) }) _sym_db.RegisterMessage(VodDescribeCdnEdgeIpRequest) VodDescribeCdnRegionAndIspRequest = _reflection.GeneratedProtocolMessageType('VodDescribeCdnRegionAndIspRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNREGIONANDISPREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeCdnRegionAndIspRequest) }) _sym_db.RegisterMessage(VodDescribeCdnRegionAndIspRequest) VodVerifyDomainOwnerRequest = _reflection.GeneratedProtocolMessageType('VodVerifyDomainOwnerRequest', (_message.Message,), { 'DESCRIPTOR' : _VODVERIFYDOMAINOWNERREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodVerifyDomainOwnerRequest) }) _sym_db.RegisterMessage(VodVerifyDomainOwnerRequest) VodDescribeDomainVerifyContentRequest = _reflection.GeneratedProtocolMessageType('VodDescribeDomainVerifyContentRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINVERIFYCONTENTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeDomainVerifyContentRequest) }) _sym_db.RegisterMessage(VodDescribeDomainVerifyContentRequest) VodListPCDNDomainRequest = _reflection.GeneratedProtocolMessageType('VodListPCDNDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTPCDNDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListPCDNDomainRequest) }) _sym_db.RegisterMessage(VodListPCDNDomainRequest) VodCreatePCDNDomainRequest = _reflection.GeneratedProtocolMessageType('VodCreatePCDNDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEPCDNDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreatePCDNDomainRequest) }) _sym_db.RegisterMessage(VodCreatePCDNDomainRequest) VodStartPCDNDomainRequest = _reflection.GeneratedProtocolMessageType('VodStartPCDNDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTPCDNDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodStartPCDNDomainRequest) }) _sym_db.RegisterMessage(VodStartPCDNDomainRequest) VodStopPCDNDomainRequest = _reflection.GeneratedProtocolMessageType('VodStopPCDNDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSTOPPCDNDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodStopPCDNDomainRequest) }) _sym_db.RegisterMessage(VodStopPCDNDomainRequest) VodDeletePCDNDomainRequest = _reflection.GeneratedProtocolMessageType('VodDeletePCDNDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEPCDNDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeletePCDNDomainRequest) }) _sym_db.RegisterMessage(VodDeletePCDNDomainRequest) VodUpdateDomainConfigRequest = _reflection.GeneratedProtocolMessageType('VodUpdateDomainConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINCONFIGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodUpdateDomainConfigRequest) }) _sym_db.RegisterMessage(VodUpdateDomainConfigRequest) VodDescribeDomainConfigRequest = _reflection.GeneratedProtocolMessageType('VodDescribeDomainConfigRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINCONFIGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDescribeDomainConfigRequest) }) _sym_db.RegisterMessage(VodDescribeDomainConfigRequest) AddOrUpdateCertificateV2Request = _reflection.GeneratedProtocolMessageType('AddOrUpdateCertificateV2Request', (_message.Message,), { 'DESCRIPTOR' : _ADDORUPDATECERTIFICATEV2REQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.AddOrUpdateCertificateV2Request) }) _sym_db.RegisterMessage(AddOrUpdateCertificateV2Request) UpdateDomainAreaRequest = _reflection.GeneratedProtocolMessageType('UpdateDomainAreaRequest', (_message.Message,), { 'DESCRIPTOR' : _UPDATEDOMAINAREAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.UpdateDomainAreaRequest) }) _sym_db.RegisterMessage(UpdateDomainAreaRequest) VodAddCallbackSubscriptionRequest = _reflection.GeneratedProtocolMessageType('VodAddCallbackSubscriptionRequest', (_message.Message,), { 'DESCRIPTOR' : _VODADDCALLBACKSUBSCRIPTIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodAddCallbackSubscriptionRequest) }) _sym_db.RegisterMessage(VodAddCallbackSubscriptionRequest) VodSetCallbackEventRequest = _reflection.GeneratedProtocolMessageType('VodSetCallbackEventRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSETCALLBACKEVENTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSetCallbackEventRequest) }) _sym_db.RegisterMessage(VodSetCallbackEventRequest) GetCallbackRecordRequest = _reflection.GeneratedProtocolMessageType('GetCallbackRecordRequest', (_message.Message,), { 'DESCRIPTOR' : _GETCALLBACKRECORDREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.GetCallbackRecordRequest) }) _sym_db.RegisterMessage(GetCallbackRecordRequest) VodGetSmartStrategyLitePlayInfoRequest = _reflection.GeneratedProtocolMessageType('VodGetSmartStrategyLitePlayInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETSMARTSTRATEGYLITEPLAYINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetSmartStrategyLitePlayInfoRequest) }) _sym_db.RegisterMessage(VodGetSmartStrategyLitePlayInfoRequest) VodGetAppInfoRequest = _reflection.GeneratedProtocolMessageType('VodGetAppInfoRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETAPPINFOREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetAppInfoRequest) }) _sym_db.RegisterMessage(VodGetAppInfoRequest) DescribeVodSpaceTranscodeDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceTranscodeDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeDataRequest) DescribeVodSpaceAIStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceAIStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEAISTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceAIStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceAIStatisDataRequest) DescribeVodSpaceSubtitleStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceSubtitleStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACESUBTITLESTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceSubtitleStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceSubtitleStatisDataRequest) DescribeVodSpaceDetectStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceDetectStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEDETECTSTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceDetectStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceDetectStatisDataRequest) DescribeVodSnapshotDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSnapshotDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSNAPSHOTDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSnapshotDataRequest) }) _sym_db.RegisterMessage(DescribeVodSnapshotDataRequest) DescribeVodSpaceWorkflowDetailDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowDetailDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWDETAILDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceWorkflowDetailDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowDetailDataRequest) DescribeVodSpaceEditDetailDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditDetailDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITDETAILDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceEditDetailDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceEditDetailDataRequest) DescribeVodPlayFileLogByDomainRequest = _reflection.GeneratedProtocolMessageType('DescribeVodPlayFileLogByDomainRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYFILELOGBYDOMAINREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodPlayFileLogByDomainRequest) }) _sym_db.RegisterMessage(DescribeVodPlayFileLogByDomainRequest) DescribeVodEnhanceImageDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodEnhanceImageDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODENHANCEIMAGEDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodEnhanceImageDataRequest) }) _sym_db.RegisterMessage(DescribeVodEnhanceImageDataRequest) DescribeVodSpaceEditStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodSpaceEditStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDataRequest) DescribeVodPlayedStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodPlayedStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYEDSTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodPlayedStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodPlayedStatisDataRequest) DescribeVodMostPlayedStatisDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodMostPlayedStatisDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODMOSTPLAYEDSTATISDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodMostPlayedStatisDataRequest) }) _sym_db.RegisterMessage(DescribeVodMostPlayedStatisDataRequest) DescribeVodRealtimeMediaDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodRealtimeMediaDataRequest) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDataRequest) DescribeVodRealtimeMediaDetailDataRequest = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDetailDataRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADETAILDATAREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodRealtimeMediaDetailDataRequest) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDetailDataRequest) DescribeVodVidTrafficFileLogRequest = _reflection.GeneratedProtocolMessageType('DescribeVodVidTrafficFileLogRequest', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODVIDTRAFFICFILELOGREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.DescribeVodVidTrafficFileLogRequest) }) _sym_db.RegisterMessage(DescribeVodVidTrafficFileLogRequest) VodSubmitBlockMediaTaskRequest = _reflection.GeneratedProtocolMessageType('VodSubmitBlockMediaTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKMEDIATASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitBlockMediaTaskRequest) }) _sym_db.RegisterMessage(VodSubmitBlockMediaTaskRequest) VodSubmitUnblockMediaTaskRequest = _reflection.GeneratedProtocolMessageType('VodSubmitUnblockMediaTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITUNBLOCKMEDIATASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitUnblockMediaTaskRequest) }) _sym_db.RegisterMessage(VodSubmitUnblockMediaTaskRequest) VodQueryMediaBlockStatusRequest = _reflection.GeneratedProtocolMessageType('VodQueryMediaBlockStatusRequest', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMEDIABLOCKSTATUSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodQueryMediaBlockStatusRequest) }) _sym_db.RegisterMessage(VodQueryMediaBlockStatusRequest) VodListProjectsRequest = _reflection.GeneratedProtocolMessageType('VodListProjectsRequest', (_message.Message,), { 'DESCRIPTOR' : _VODLISTPROJECTSREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodListProjectsRequest) }) _sym_db.RegisterMessage(VodListProjectsRequest) VodGetTradeConfigurationRequest = _reflection.GeneratedProtocolMessageType('VodGetTradeConfigurationRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETTRADECONFIGURATIONREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetTradeConfigurationRequest) }) _sym_db.RegisterMessage(VodGetTradeConfigurationRequest) VodReportEventRequest = _reflection.GeneratedProtocolMessageType('VodReportEventRequest', (_message.Message,), { 'DESCRIPTOR' : _VODREPORTEVENTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodReportEventRequest) }) _sym_db.RegisterMessage(VodReportEventRequest) VodSetCloudMigrateJobRequest = _reflection.GeneratedProtocolMessageType('VodSetCloudMigrateJobRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSETCLOUDMIGRATEJOBREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSetCloudMigrateJobRequest) }) _sym_db.RegisterMessage(VodSetCloudMigrateJobRequest) VodSubmitCloudMigrateJobRequest = _reflection.GeneratedProtocolMessageType('VodSubmitCloudMigrateJobRequest', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITCLOUDMIGRATEJOBREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodSubmitCloudMigrateJobRequest) }) _sym_db.RegisterMessage(VodSubmitCloudMigrateJobRequest) VodGetCloudMigrateJobRequest = _reflection.GeneratedProtocolMessageType('VodGetCloudMigrateJobRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETCLOUDMIGRATEJOBREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetCloudMigrateJobRequest) }) _sym_db.RegisterMessage(VodGetCloudMigrateJobRequest) VodCreateDramaRecapTaskRequest = _reflection.GeneratedProtocolMessageType('VodCreateDramaRecapTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMARECAPTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateDramaRecapTaskRequest) }) _sym_db.RegisterMessage(VodCreateDramaRecapTaskRequest) VodCreateDramaScriptTaskRequest = _reflection.GeneratedProtocolMessageType('VodCreateDramaScriptTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMASCRIPTTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodCreateDramaScriptTaskRequest) }) _sym_db.RegisterMessage(VodCreateDramaScriptTaskRequest) VodQueryDramaRecapTaskRequest = _reflection.GeneratedProtocolMessageType('VodQueryDramaRecapTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMARECAPTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodQueryDramaRecapTaskRequest) }) _sym_db.RegisterMessage(VodQueryDramaRecapTaskRequest) VodQueryDramaScriptTaskRequest = _reflection.GeneratedProtocolMessageType('VodQueryDramaScriptTaskRequest', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMASCRIPTTASKREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodQueryDramaScriptTaskRequest) }) _sym_db.RegisterMessage(VodQueryDramaScriptTaskRequest) VodGetMediaEntityListRequest = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityListRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYLISTREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetMediaEntityListRequest) }) _sym_db.RegisterMessage(VodGetMediaEntityListRequest) VodGetMediaEntityRequest = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodGetMediaEntityRequest) }) _sym_db.RegisterMessage(VodGetMediaEntityRequest) VodDeleteMediaEntityRequest = _reflection.GeneratedProtocolMessageType('VodDeleteMediaEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIAENTITYREQUEST, '__module__' : 'volcengine.vod.request.request_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Request.VodDeleteMediaEntityRequest) }) _sym_db.RegisterMessage(VodDeleteMediaEntityRequest) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n(com.volcengine.service.vod.model.requestB\nVodRequestP\001Z@github.com/volcengine/volc-sdk-golang/service/vod/models/request\240\001\001\330\001\001\312\002\037Volc\\Service\\Vod\\Models\\Request\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODGETALLPLAYINFOREQUEST._serialized_start=399 _VODGETALLPLAYINFOREQUEST._serialized_end=787 _VODGETPLAYINFOREQUEST._serialized_start=790 _VODGETPLAYINFOREQUEST._serialized_end=1272 _VODGETPRIVATEDRMPLAYAUTHREQUEST._serialized_start=1274 _VODGETPRIVATEDRMPLAYAUTHREQUEST._serialized_end=1377 _VODGETHLSDECRYPTIONKEYREQUEST._serialized_start=1379 _VODGETHLSDECRYPTIONKEYREQUEST._serialized_end=1460 _VODCREATEHLSDECRYPTIONKEYREQUEST._serialized_start=1462 _VODCREATEHLSDECRYPTIONKEYREQUEST._serialized_end=1515 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENEREQUEST._serialized_start=1518 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENEREQUEST._serialized_end=1670 _VODDESCRIBEDRMDATAKEYREQUEST._serialized_start=1672 _VODDESCRIBEDRMDATAKEYREQUEST._serialized_end=1714 _VODSUBMITMOVEOBJECTTASKREQUEST._serialized_start=1717 _VODSUBMITMOVEOBJECTTASKREQUEST._serialized_end=1889 _VODQUERYMOVEOBJECTTASKINFOREQUEST._serialized_start=1891 _VODQUERYMOVEOBJECTTASKINFOREQUEST._serialized_end=1984 _VODSUBMITBLOCKOBJECTTASKSREQUEST._serialized_start=1986 _VODSUBMITBLOCKOBJECTTASKSREQUEST._serialized_end=2107 _VODLISTBLOCKOBJECTTASKSREQUEST._serialized_start=2109 _VODLISTBLOCKOBJECTTASKSREQUEST._serialized_end=2206 _VODURLUPLOADREQUEST._serialized_start=2208 _VODURLUPLOADREQUEST._serialized_end=2317 _VODQUERYUPLOADTASKINFOREQUEST._serialized_start=2319 _VODQUERYUPLOADTASKINFOREQUEST._serialized_end=2366 _VODAPPLYUPLOADINFOREQUEST._serialized_start=2369 _VODAPPLYUPLOADINFOREQUEST._serialized_end=2632 _VODUPLOADMEDIAREQUEST._serialized_start=2635 _VODUPLOADMEDIAREQUEST._serialized_end=3014 _VODUPLOADMATERIALREQUEST._serialized_start=3017 _VODUPLOADMATERIALREQUEST._serialized_end=3320 _VODUPLOADOBJECTREQUEST._serialized_start=3323 _VODUPLOADOBJECTREQUEST._serialized_end=3606 _VODCOMMITUPLOADINFOREQUEST._serialized_start=3609 _VODCOMMITUPLOADINFOREQUEST._serialized_end=3762 _VODURLUPLOADJSONREQUEST._serialized_start=3764 _VODURLUPLOADJSONREQUEST._serialized_end=3825 _VODPARSEUPLOADMANIFESTREQUEST._serialized_start=3827 _VODPARSEUPLOADMANIFESTREQUEST._serialized_end=3924 _VODLISTFILEMETAINFOSBYFILENAMESREQUEST._serialized_start=3926 _VODLISTFILEMETAINFOSBYFILENAMESREQUEST._serialized_end=4031 _VODGETRECOMMENDEDPOSTERREQUEST._serialized_start=4033 _VODGETRECOMMENDEDPOSTERREQUEST._serialized_end=4079 _VODUPDATEMEDIAPUBLISHSTATUSREQUEST._serialized_start=4081 _VODUPDATEMEDIAPUBLISHSTATUSREQUEST._serialized_end=4146 _VODUPDATEMEDIASTORAGECLASSREQUEST._serialized_start=4148 _VODUPDATEMEDIASTORAGECLASSREQUEST._serialized_end=4258 _VODUPDATEMEDIAINFOREQUEST._serialized_start=4261 _VODUPDATEMEDIAINFOREQUEST._serialized_end=4595 _VODGETMEDIAINFOSREQUEST._serialized_start=4597 _VODGETMEDIAINFOSREQUEST._serialized_end=4636 _VODDELETEMATERIALREQUEST._serialized_start=4638 _VODDELETEMATERIALREQUEST._serialized_end=4696 _VODDELETEMEDIAREQUEST._serialized_start=4698 _VODDELETEMEDIAREQUEST._serialized_end=4757 _VODDELETETRANSCODESREQUEST._serialized_start=4759 _VODDELETETRANSCODESREQUEST._serialized_end=4839 _VODDELETEMEDIATOSFILEREQUEST._serialized_start=4841 _VODDELETEMEDIATOSFILEREQUEST._serialized_end=4909 _VODGETMEDIALISTREQUEST._serialized_start=4912 _VODGETMEDIALISTREQUEST._serialized_end=5178 _VODGETSUBTITLEINFOLISTREQUEST._serialized_start=5181 _VODGETSUBTITLEINFOLISTREQUEST._serialized_end=5411 _VODUPDATESUBTITLESTATUSREQUEST._serialized_start=5413 _VODUPDATESUBTITLESTATUSREQUEST._serialized_end=5527 _VODUPDATESUBTITLEINFOREQUEST._serialized_start=5530 _VODUPDATESUBTITLEINFOREQUEST._serialized_end=5711 _VODGETAUDITFRAMESFORAUDITREQUEST._serialized_start=5713 _VODGETAUDITFRAMESFORAUDITREQUEST._serialized_end=5832 _VODGETMLFRAMESFORAUDITREQUEST._serialized_start=5835 _VODGETMLFRAMESFORAUDITREQUEST._serialized_end=6124 _VODGETBETTERFRAMESFORAUDITREQUEST._serialized_start=6126 _VODGETBETTERFRAMESFORAUDITREQUEST._serialized_end=6211 _VODGETAUDIOINFOFORAUDITREQUEST._serialized_start=6213 _VODGETAUDIOINFOFORAUDITREQUEST._serialized_end=6276 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITREQUEST._serialized_start=6278 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITREQUEST._serialized_end=6358 _VODGETAUDIOEVENTDETECTIONFORAUDITREQUEST._serialized_start=6360 _VODGETAUDIOEVENTDETECTIONFORAUDITREQUEST._serialized_end=6433 _VODCREATEVIDEOCLASSIFICATIONREQUEST._serialized_start=6435 _VODCREATEVIDEOCLASSIFICATIONREQUEST._serialized_end=6548 _VODUPDATEVIDEOCLASSIFICATIONREQUEST._serialized_start=6550 _VODUPDATEVIDEOCLASSIFICATIONREQUEST._serialized_end=6656 _VODDELETEVIDEOCLASSIFICATIONREQUEST._serialized_start=6658 _VODDELETEVIDEOCLASSIFICATIONREQUEST._serialized_end=6740 _VODLISTVIDEOCLASSIFICATIONSREQUEST._serialized_start=6742 _VODLISTVIDEOCLASSIFICATIONSREQUEST._serialized_end=6823 _VODLISTSNAPSHOTSREQUEST._serialized_start=6825 _VODLISTSNAPSHOTSREQUEST._serialized_end=6863 _VODGETFILELISTREQUEST._serialized_start=6865 _VODGETFILELISTREQUEST._serialized_end=6955 _VODGETFILEINFOSREQUEST._serialized_start=6958 _VODGETFILEINFOSREQUEST._serialized_end=7131 _VODUPDATEFILESTORAGECLASSREQUEST._serialized_start=7134 _VODUPDATEFILESTORAGECLASSREQUEST._serialized_end=7283 _VODGETINNERAUDITURLSREQUEST._serialized_start=7285 _VODGETINNERAUDITURLSREQUEST._serialized_end=7365 _VODGETADAUDITRESULTBYVIDREQUEST._serialized_start=7367 _VODGETADAUDITRESULTBYVIDREQUEST._serialized_end=7449 _VODEXTRACTMEDIAMETATASKREQUEST._serialized_start=7451 _VODEXTRACTMEDIAMETATASKREQUEST._serialized_end=7496 _VODSTARTWORKFLOWREQUEST._serialized_start=7499 _VODSTARTWORKFLOWREQUEST._serialized_end=7790 _VODRETRIEVETRANSCODERESULTREQUEST._serialized_start=7792 _VODRETRIEVETRANSCODERESULTREQUEST._serialized_end=7860 _VODLISTWORKFLOWEXECUTIONREQUEST._serialized_start=7863 _VODLISTWORKFLOWEXECUTIONREQUEST._serialized_end=8150 _VODGETWORKFLOWEXECUTIONDETAILREQUEST._serialized_start=8152 _VODGETWORKFLOWEXECUTIONDETAILREQUEST._serialized_end=8205 _VODGETWORKFLOWRESULTREQUEST._serialized_start=8207 _VODGETWORKFLOWRESULTREQUEST._serialized_end=8251 _VODGETWORKFLOWEXECUTIONSTATUSREQUEST._serialized_start=8253 _VODGETWORKFLOWEXECUTIONSTATUSREQUEST._serialized_end=8331 _VODCREATETASKTEMPLATEREQUEST._serialized_start=8334 _VODCREATETASKTEMPLATEREQUEST._serialized_end=8776 _VODUPDATETASKTEMPLATEREQUEST._serialized_start=8779 _VODUPDATETASKTEMPLATEREQUEST._serialized_end=9222 _VODDELETETASKTEMPLATEREQUEST._serialized_start=9224 _VODDELETETASKTEMPLATEREQUEST._serialized_end=9274 _VODGETTASKTEMPLATEREQUEST._serialized_start=9276 _VODGETTASKTEMPLATEREQUEST._serialized_end=9323 _VODLISTTASKTEMPLATEREQUEST._serialized_start=9326 _VODLISTTASKTEMPLATEREQUEST._serialized_end=9505 _VODCREATEWATERMARKREQUEST._serialized_start=9508 _VODCREATEWATERMARKREQUEST._serialized_end=9804 _VODUPDATEWATERMARKREQUEST._serialized_start=9807 _VODUPDATEWATERMARKREQUEST._serialized_end=10104 _VODDELETEWATERMARKREQUEST._serialized_start=10106 _VODDELETEWATERMARKREQUEST._serialized_end=10153 _VODGETWATERMARKREQUEST._serialized_start=10155 _VODGETWATERMARKREQUEST._serialized_end=10199 _VODLISTWATERMARKREQUEST._serialized_start=10202 _VODLISTWATERMARKREQUEST._serialized_end=10360 _VODCREATEWORKFLOWTEMPLATEREQUEST._serialized_start=10363 _VODCREATEWORKFLOWTEMPLATEREQUEST._serialized_end=10513 _VODUPDATEWORKFLOWTEMPLATEREQUEST._serialized_start=10516 _VODUPDATEWORKFLOWTEMPLATEREQUEST._serialized_end=10667 _VODDELETEWORKFLOWTEMPLATEREQUEST._serialized_start=10669 _VODDELETEWORKFLOWTEMPLATEREQUEST._serialized_end=10723 _VODGETWORKFLOWTEMPLATEREQUEST._serialized_start=10725 _VODGETWORKFLOWTEMPLATEREQUEST._serialized_end=10776 _VODLISTWORKFLOWTEMPLATEREQUEST._serialized_start=10779 _VODLISTWORKFLOWTEMPLATEREQUEST._serialized_end=10944 _VODSUBMITDIRECTEDITTASKASYNCREQUEST._serialized_start=10947 _VODSUBMITDIRECTEDITTASKASYNCREQUEST._serialized_end=11103 _VODSUBMITDIRECTEDITTASKSYNCREQUEST._serialized_start=11105 _VODSUBMITDIRECTEDITTASKSYNCREQUEST._serialized_end=11199 _VODGETDIRECTEDITRESULTREQUEST._serialized_start=11201 _VODGETDIRECTEDITRESULTREQUEST._serialized_end=11248 _VODGETDIRECTEDITPROGRESSREQUEST._serialized_start=11250 _VODGETDIRECTEDITPROGRESSREQUEST._serialized_end=11298 _VODCANCELDIRECTEDITTASKREQUEST._serialized_start=11300 _VODCANCELDIRECTEDITTASKREQUEST._serialized_end=11347 _VODASYNCVCREATIVETASKREQUEST._serialized_start=11349 _VODASYNCVCREATIVETASKREQUEST._serialized_end=11452 _VODGETVCREATIVETASKRESULTREQUEST._serialized_start=11454 _VODGETVCREATIVETASKRESULTREQUEST._serialized_end=11509 _VODDELETESPACEREQUEST._serialized_start=11511 _VODDELETESPACEREQUEST._serialized_end=11553 _VODCREATESPACEREQUEST._serialized_start=11555 _VODCREATESPACEREQUEST._serialized_end=11673 _VODGETSPACEDETAILREQUEST._serialized_start=11675 _VODGETSPACEDETAILREQUEST._serialized_end=11720 _VODLISTSPACEREQUEST._serialized_start=11722 _VODLISTSPACEREQUEST._serialized_end=11774 _VODUPDATESPACEREQUEST._serialized_start=11776 _VODUPDATESPACEREQUEST._serialized_end=11893 _VODUPDATESPACEUPLOADCONFIGREQUEST._serialized_start=11895 _VODUPDATESPACEUPLOADCONFIGREQUEST._serialized_end=11989 _VODDESCRIBEUPLOADSPACECONFIGREQUEST._serialized_start=11991 _VODDESCRIBEUPLOADSPACECONFIGREQUEST._serialized_end=12047 _VODUPDATEUPLOADSPACECONFIGREQUEST._serialized_start=12050 _VODUPDATEUPLOADSPACECONFIGREQUEST._serialized_end=12568 _VODDESCRIBEVODSPACESTORAGEDATAREQUEST._serialized_start=12571 _VODDESCRIBEVODSPACESTORAGEDATAREQUEST._serialized_end=12720 _VODUPDATEDOMAINPLAYRULEREQUEST._serialized_start=12722 _VODUPDATEDOMAINPLAYRULEREQUEST._serialized_end=12814 _VODADDDOMAINTOSCHEDULERREQUEST._serialized_start=12816 _VODADDDOMAINTOSCHEDULERREQUEST._serialized_end=12930 _VODREMOVEDOMAINFROMSCHEDULERREQUEST._serialized_start=12932 _VODREMOVEDOMAINFROMSCHEDULERREQUEST._serialized_end=13051 _VODDELETEDOMAINREQUEST._serialized_start=13053 _VODDELETEDOMAINREQUEST._serialized_end=13132 _VODSTARTDOMAINREQUEST._serialized_start=13134 _VODSTARTDOMAINREQUEST._serialized_end=13239 _VODSTOPDOMAINREQUEST._serialized_start=13241 _VODSTOPDOMAINREQUEST._serialized_end=13345 _VODLISTDOMAINREQUEST._serialized_start=13347 _VODLISTDOMAINREQUEST._serialized_end=13466 _VODCREATECDNREFRESHTASKREQUEST._serialized_start=13468 _VODCREATECDNREFRESHTASKREQUEST._serialized_end=13547 _VODCREATECDNPRELOADTASKREQUEST._serialized_start=13549 _VODCREATECDNPRELOADTASKREQUEST._serialized_end=13614 _VODLISTCDNTASKSREQUEST._serialized_start=13617 _VODLISTCDNTASKSREQUEST._serialized_end=13811 _VODLISTCDNACCESSLOGREQUEST._serialized_start=13814 _VODLISTCDNACCESSLOGREQUEST._serialized_end=13994 _VODLISTCDNTOPACCESSURLREQUEST._serialized_start=13996 _VODLISTCDNTOPACCESSURLREQUEST._serialized_end=14108 _VODLISTCDNTOPACCESSREQUEST._serialized_start=14110 _VODLISTCDNTOPACCESSREQUEST._serialized_end=14233 _VODDESCRIBEVODDOMAINBANDWIDTHDATAREQUEST._serialized_start=14236 _VODDESCRIBEVODDOMAINBANDWIDTHDATAREQUEST._serialized_end=14439 _VODLISTCDNUSAGEDATAREQUEST._serialized_start=14442 _VODLISTCDNUSAGEDATAREQUEST._serialized_end=14708 _VODLISTCDNSTATUSDATAREQUEST._serialized_start=14711 _VODLISTCDNSTATUSDATAREQUEST._serialized_end=14875 _VODDESCRIBEIPINFOREQUEST._serialized_start=14877 _VODDESCRIBEIPINFOREQUEST._serialized_end=14916 _VODLISTCDNPVDATAREQUEST._serialized_start=14919 _VODLISTCDNPVDATAREQUEST._serialized_end=15081 _VODLISTCDNHITRATEDATAREQUEST._serialized_start=15084 _VODLISTCDNHITRATEDATAREQUEST._serialized_end=15231 _VODDESCRIBEVODDOMAINTRAFFICDATAREQUEST._serialized_start=15234 _VODDESCRIBEVODDOMAINTRAFFICDATAREQUEST._serialized_end=15433 _VODSUBMITBLOCKTASKSREQUEST._serialized_start=15435 _VODSUBMITBLOCKTASKSREQUEST._serialized_end=15519 _VODGETCONTENTBLOCKTASKSREQUEST._serialized_start=15522 _VODGETCONTENTBLOCKTASKSREQUEST._serialized_end=15704 _VODCREATEDOMAINV2REQUEST._serialized_start=15707 _VODCREATEDOMAINV2REQUEST._serialized_end=16202 _VODCREATEDOMAINV3REQUEST._serialized_start=16205 _VODCREATEDOMAINV3REQUEST._serialized_end=16462 _VODUPDATEDOMAINEXPIREV2REQUEST._serialized_start=16464 _VODUPDATEDOMAINEXPIREV2REQUEST._serialized_end=16567 _VODUPDATEDOMAINAUTHCONFIGV2REQUEST._serialized_start=16570 _VODUPDATEDOMAINAUTHCONFIGV2REQUEST._serialized_end=16713 _VODUPDATEDOMAINURLAUTHCONFIGV2REQUEST._serialized_start=16716 _VODUPDATEDOMAINURLAUTHCONFIGV2REQUEST._serialized_end=16862 _VODDESCRIBECDNEDGEIPREQUEST._serialized_start=16865 _VODDESCRIBECDNEDGEIPREQUEST._serialized_end=17077 _VODDESCRIBECDNREGIONANDISPREQUEST._serialized_start=17079 _VODDESCRIBECDNREGIONANDISPREQUEST._serialized_end=17142 _VODVERIFYDOMAINOWNERREQUEST._serialized_start=17144 _VODVERIFYDOMAINOWNERREQUEST._serialized_end=17209 _VODDESCRIBEDOMAINVERIFYCONTENTREQUEST._serialized_start=17211 _VODDESCRIBEDOMAINVERIFYCONTENTREQUEST._serialized_end=17266 _VODLISTPCDNDOMAINREQUEST._serialized_start=17268 _VODLISTPCDNDOMAINREQUEST._serialized_end=17344 _VODCREATEPCDNDOMAINREQUEST._serialized_start=17346 _VODCREATEPCDNDOMAINREQUEST._serialized_end=17409 _VODSTARTPCDNDOMAINREQUEST._serialized_start=17411 _VODSTARTPCDNDOMAINREQUEST._serialized_end=17473 _VODSTOPPCDNDOMAINREQUEST._serialized_start=17475 _VODSTOPPCDNDOMAINREQUEST._serialized_end=17536 _VODDELETEPCDNDOMAINREQUEST._serialized_start=17538 _VODDELETEPCDNDOMAINREQUEST._serialized_end=17601 _VODUPDATEDOMAINCONFIGREQUEST._serialized_start=17604 _VODUPDATEDOMAINCONFIGREQUEST._serialized_end=17754 _VODDESCRIBEDOMAINCONFIGREQUEST._serialized_start=17756 _VODDESCRIBEDOMAINCONFIGREQUEST._serialized_end=17843 _ADDORUPDATECERTIFICATEV2REQUEST._serialized_start=17846 _ADDORUPDATECERTIFICATEV2REQUEST._serialized_end=17978 _UPDATEDOMAINAREAREQUEST._serialized_start=17980 _UPDATEDOMAINAREAREQUEST._serialized_end=18074 _VODADDCALLBACKSUBSCRIPTIONREQUEST._serialized_start=18076 _VODADDCALLBACKSUBSCRIPTIONREQUEST._serialized_end=18164 _VODSETCALLBACKEVENTREQUEST._serialized_start=18166 _VODSETCALLBACKEVENTREQUEST._serialized_end=18270 _GETCALLBACKRECORDREQUEST._serialized_start=18273 _GETCALLBACKRECORDREQUEST._serialized_end=18444 _VODGETSMARTSTRATEGYLITEPLAYINFOREQUEST._serialized_start=18447 _VODGETSMARTSTRATEGYLITEPLAYINFOREQUEST._serialized_end=18691 _VODGETAPPINFOREQUEST._serialized_start=18693 _VODGETAPPINFOREQUEST._serialized_end=18730 _DESCRIBEVODSPACETRANSCODEDATAREQUEST._serialized_start=18733 _DESCRIBEVODSPACETRANSCODEDATAREQUEST._serialized_end=18961 _DESCRIBEVODSPACEAISTATISDATAREQUEST._serialized_start=18964 _DESCRIBEVODSPACEAISTATISDATAREQUEST._serialized_end=19166 _DESCRIBEVODSPACESUBTITLESTATISDATAREQUEST._serialized_start=19169 _DESCRIBEVODSPACESUBTITLESTATISDATAREQUEST._serialized_end=19378 _DESCRIBEVODSPACEDETECTSTATISDATAREQUEST._serialized_start=19381 _DESCRIBEVODSPACEDETECTSTATISDATAREQUEST._serialized_end=19586 _DESCRIBEVODSNAPSHOTDATAREQUEST._serialized_start=19589 _DESCRIBEVODSNAPSHOTDATAREQUEST._serialized_end=19787 _DESCRIBEVODSPACEWORKFLOWDETAILDATAREQUEST._serialized_start=19790 _DESCRIBEVODSPACEWORKFLOWDETAILDATAREQUEST._serialized_end=19935 _DESCRIBEVODSPACEEDITDETAILDATAREQUEST._serialized_start=19938 _DESCRIBEVODSPACEEDITDETAILDATAREQUEST._serialized_end=20079 _DESCRIBEVODPLAYFILELOGBYDOMAINREQUEST._serialized_start=20081 _DESCRIBEVODPLAYFILELOGBYDOMAINREQUEST._serialized_end=20176 _DESCRIBEVODENHANCEIMAGEDATAREQUEST._serialized_start=20179 _DESCRIBEVODENHANCEIMAGEDATAREQUEST._serialized_end=20356 _DESCRIBEVODSPACEEDITSTATISDATAREQUEST._serialized_start=20359 _DESCRIBEVODSPACEEDITSTATISDATAREQUEST._serialized_end=20542 _DESCRIBEVODPLAYEDSTATISDATAREQUEST._serialized_start=20544 _DESCRIBEVODPLAYEDSTATISDATAREQUEST._serialized_end=20667 _DESCRIBEVODMOSTPLAYEDSTATISDATAREQUEST._serialized_start=20669 _DESCRIBEVODMOSTPLAYEDSTATISDATAREQUEST._serialized_end=20793 _DESCRIBEVODREALTIMEMEDIADATAREQUEST._serialized_start=20796 _DESCRIBEVODREALTIMEMEDIADATAREQUEST._serialized_end=20955 _DESCRIBEVODREALTIMEMEDIADETAILDATAREQUEST._serialized_start=20958 _DESCRIBEVODREALTIMEMEDIADETAILDATAREQUEST._serialized_end=21103 _DESCRIBEVODVIDTRAFFICFILELOGREQUEST._serialized_start=21105 _DESCRIBEVODVIDTRAFFICFILELOGREQUEST._serialized_end=21197 _VODSUBMITBLOCKMEDIATASKREQUEST._serialized_start=21199 _VODSUBMITBLOCKMEDIATASKREQUEST._serialized_end=21264 _VODSUBMITUNBLOCKMEDIATASKREQUEST._serialized_start=21266 _VODSUBMITUNBLOCKMEDIATASKREQUEST._serialized_end=21333 _VODQUERYMEDIABLOCKSTATUSREQUEST._serialized_start=21335 _VODQUERYMEDIABLOCKSTATUSREQUEST._serialized_end=21401 _VODLISTPROJECTSREQUEST._serialized_start=21403 _VODLISTPROJECTSREQUEST._serialized_end=21427 _VODGETTRADECONFIGURATIONREQUEST._serialized_start=21429 _VODGETTRADECONFIGURATIONREQUEST._serialized_end=21462 _VODREPORTEVENTREQUEST._serialized_start=21464 _VODREPORTEVENTREQUEST._serialized_end=21516 _VODSETCLOUDMIGRATEJOBREQUEST._serialized_start=21519 _VODSETCLOUDMIGRATEJOBREQUEST._serialized_end=21693 _VODSUBMITCLOUDMIGRATEJOBREQUEST._serialized_start=21696 _VODSUBMITCLOUDMIGRATEJOBREQUEST._serialized_end=21841 _VODGETCLOUDMIGRATEJOBREQUEST._serialized_start=21843 _VODGETCLOUDMIGRATEJOBREQUEST._serialized_end=21907 _VODCREATEDRAMARECAPTASKREQUEST._serialized_start=21910 _VODCREATEDRAMARECAPTASKREQUEST._serialized_end=22436 _VODCREATEDRAMASCRIPTTASKREQUEST._serialized_start=22439 _VODCREATEDRAMASCRIPTTASKREQUEST._serialized_end=22640 _VODQUERYDRAMARECAPTASKREQUEST._serialized_start=22642 _VODQUERYDRAMARECAPTASKREQUEST._serialized_end=22708 _VODQUERYDRAMASCRIPTTASKREQUEST._serialized_start=22710 _VODQUERYDRAMASCRIPTTASKREQUEST._serialized_end=22777 _VODGETMEDIAENTITYLISTREQUEST._serialized_start=22780 _VODGETMEDIAENTITYLISTREQUEST._serialized_end=22923 _VODGETMEDIAENTITYREQUEST._serialized_start=22925 _VODGETMEDIAENTITYREQUEST._serialized_end=23030 _VODDELETEMEDIAENTITYREQUEST._serialized_start=23032 _VODDELETEMEDIAENTITYREQUEST._serialized_end=23117 # @@protoc_insertion_point(module_scope) ================================================ FILE: volcengine/vod/models/response/__init__.py ================================================ ================================================ FILE: volcengine/vod/models/response/response_vod_pb2.py ================================================ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: volcengine/vod/response/response_vod.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from volcengine.base.models.base import base_pb2 as volcengine_dot_base_dot_base__pb2 from volcengine.vod.models.business import vod_play_pb2 as volcengine_dot_vod_dot_business_dot_vod__play__pb2 from volcengine.vod.models.business import vod_media_pb2 as volcengine_dot_vod_dot_business_dot_vod__media__pb2 from volcengine.vod.models.business import vod_upload_pb2 as volcengine_dot_vod_dot_business_dot_vod__upload__pb2 from volcengine.vod.models.business import vod_workflow_pb2 as volcengine_dot_vod_dot_business_dot_vod__workflow__pb2 from volcengine.vod.models.business import vod_edit_pb2 as volcengine_dot_vod_dot_business_dot_vod__edit__pb2 from volcengine.vod.models.business import vod_space_pb2 as volcengine_dot_vod_dot_business_dot_vod__space__pb2 from volcengine.vod.models.business import vod_cdn_pb2 as volcengine_dot_vod_dot_business_dot_vod__cdn__pb2 from volcengine.vod.models.business import vod_common_pb2 as volcengine_dot_vod_dot_business_dot_vod__common__pb2 from volcengine.vod.models.business import vod_smart_strategy_pb2 as volcengine_dot_vod_dot_business_dot_vod__smart__strategy__pb2 from volcengine.vod.models.business import vod_apps_manage_pb2 as volcengine_dot_vod_dot_business_dot_vod__apps__manage__pb2 from volcengine.vod.models.business import vod_measure_pb2 as volcengine_dot_vod_dot_business_dot_vod__measure__pb2 from volcengine.vod.models.business import vod_project_pb2 as volcengine_dot_vod_dot_business_dot_vod__project__pb2 from volcengine.vod.models.business import vod_trade_pb2 as volcengine_dot_vod_dot_business_dot_vod__trade__pb2 from volcengine.vod.models.business import vod_object_pb2 as volcengine_dot_vod_dot_business_dot_vod__object__pb2 from volcengine.vod.models.business import vod_migrate_pb2 as volcengine_dot_vod_dot_business_dot_vod__migrate__pb2 from volcengine.vod.models.business import vod_callback_pb2 as volcengine_dot_vod_dot_business_dot_vod__callback__pb2 from volcengine.vod.models.business import vod_reporter_pb2 as volcengine_dot_vod_dot_business_dot_vod__reporter__pb2 from volcengine.vod.models.business import vod_drama_pb2 as volcengine_dot_vod_dot_business_dot_vod__drama__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*volcengine/vod/response/response_vod.proto\x12\x1eVolcengine.Vod.Models.Response\x1a\x1avolcengine/base/base.proto\x1a&volcengine/vod/business/vod_play.proto\x1a\'volcengine/vod/business/vod_media.proto\x1a(volcengine/vod/business/vod_upload.proto\x1a*volcengine/vod/business/vod_workflow.proto\x1a&volcengine/vod/business/vod_edit.proto\x1a\'volcengine/vod/business/vod_space.proto\x1a%volcengine/vod/business/vod_cdn.proto\x1a(volcengine/vod/business/vod_common.proto\x1a\x30volcengine/vod/business/vod_smart_strategy.proto\x1a-volcengine/vod/business/vod_apps_manage.proto\x1a)volcengine/vod/business/vod_measure.proto\x1a)volcengine/vod/business/vod_project.proto\x1a\'volcengine/vod/business/vod_trade.proto\x1a(volcengine/vod/business/vod_object.proto\x1a)volcengine/vod/business/vod_migrate.proto\x1a*volcengine/vod/business/vod_callback.proto\x1a*volcengine/vod/business/vod_reporter.proto\x1a\'volcengine/vod/business/vod_drama.proto\"\xaa\x01\n\x19VodGetAllPlayInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodAllPlayInfoResult\"\xa3\x01\n\x16VodGetPlayInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12@\n\x06Result\x18\x02 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodPlayInfoModel\"\xb7\x01\n\x1eVodGetOriginalPlayInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodGetOriginalPlayInfoResult\"\xbb\x01\n VodGetPrivateDrmPlayAuthResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodGetPrivateDrmPlayAuthResult\"\xb7\x01\n\x1eVodGetHlsDecryptionKeyResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodGetHlsDecryptionKeyResult\"\xbd\x01\n!VodCreateHlsDecryptionKeyResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12O\n\x06Result\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.VodCreateHlsDecryptionKeyResult\"\xd3\x01\n,VodGetPlayInfoWithLiveTimeShiftSceneResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12Z\n\x06Result\x18\x02 \x01(\x0b\x32J.Volcengine.Vod.Models.Business.VodGetPlayInfoWithLiveTimeShiftSceneResult\"\xb5\x01\n\x1dVodDescribeDrmDataKeyResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodDescribeDrmDataKeyResult\"\xbb\x01\n\x1fVodSubmitMoveObjectTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12O\n\x06Result\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.VodSubmitMoveObjectTaskRespData\"\xc0\x01\n\"VodQueryMoveObjectTaskInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12Q\n\x06Result\x18\x02 \x01(\x0b\x32\x41.Volcengine.Vod.Models.Business.VodQueryMoveObjectTaskInfoResData\"\xbd\x01\n!VodSubmitBlockObjectTasksResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12O\n\x06Result\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.VodSubmitBlockObjectTasksResult\"\xb9\x01\n\x1fVodListBlockObjectTasksResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodListBlockObjectTasksResult\"\xa0\x01\n\x16VodUploadMediaResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12=\n\x06Result\x18\x02 \x01(\x0b\x32-.Volcengine.Vod.Models.Business.VodCommitData\"\xa7\x01\n\x1eVodQueryUploadTaskInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.VodQueryData\"\xa3\x01\n\x14VodUrlUploadResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x42\n\x06Result\x18\x02 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodUrlResponseData\"\xaf\x01\n\x1aVodApplyUploadInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12H\n\x06Result\x18\x02 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.VodApplyUploadInfoResult\"\xb1\x01\n\x1bVodCommitUploadInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodCommitUploadInfoResult\"\xb7\x01\n\x1eVodParseUploadManifestResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodParseUploadManifestResult\"\xc9\x01\n\'VodListFileMetaInfosByFileNamesResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12U\n\x06Result\x18\x02 \x01(\x0b\x32\x45.Volcengine.Vod.Models.Business.VodListFileMetaInfosByFileNamesResult\"\xa9\x01\n\x18VodGetMediaInfosResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodGetMediaInfosData\"e\n\x1aVodUpdateMediaInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xaf\x01\n\x1fVodGetRecommendedPosterResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodGetRecPosterData\"n\n#VodUpdateMediaPublishStatusResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xbd\x01\n\"VodUpdateMediaStorageClassResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodUpdateMediaStorageClassData\"\xa5\x01\n\x16VodDeleteMediaResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x42\n\x06Result\x18\x02 \x01(\x0b\x32\x32.Volcengine.Vod.Models.Business.VodDeleteMediaData\"d\n\x19VodDeleteMaterialResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xaf\x01\n\x1bVodDeleteTranscodesResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12G\n\x06Result\x18\x02 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodDeleteTranscodesData\"\xb3\x01\n\x1dVodDeleteMediaTosFileResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodDeleteMediaTosFileData\"\xa7\x01\n\x17VodGetMediaListResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodGetMediaListData\"\xb5\x01\n\x1eVodGetSubtitleInfoListResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12J\n\x06Result\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodGetSubtitleInfoListData\"\xb7\x01\n\x1fVodUpdateSubtitleStatusResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodUpdateSubtitleStatusData\"h\n\x1dVodUpdateSubtitleInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb8\x01\n!VodGetAuditFramesForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12J\n\x06Result\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodGetFramesForAuditResult\"\xb5\x01\n\x1eVodGetMLFramesForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12J\n\x06Result\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodGetFramesForAuditResult\"\xbf\x01\n\"VodGetBetterFramesForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12P\n\x06Result\x18\x02 \x01(\x0b\x32@.Volcengine.Vod.Models.Business.VodGetBetterFramesForAuditResult\"\xb9\x01\n\x1fVodGetAudioInfoForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodGetAudioInfoForAuditResult\"\xdb\x01\n0VodGetAutomaticSpeechRecognitionForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12^\n\x06Result\x18\x02 \x01(\x0b\x32N.Volcengine.Vod.Models.Business.VodGetAutomaticSpeechRecognitionForAuditResult\"\xcd\x01\n)VodGetAudioEventDetectionForAuditResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12W\n\x06Result\x18\x02 \x01(\x0b\x32G.Volcengine.Vod.Models.Business.VodGetAudioEventDetectionForAuditResult\"\xc1\x01\n$VodCreateVideoClassificationResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12P\n\x06Result\x18\x02 \x01(\x0b\x32@.Volcengine.Vod.Models.Business.VodCreateVideoClassificationData\"o\n$VodUpdateVideoClassificationResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"o\n$VodDeleteVideoClassificationResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xbb\x01\n#VodListVideoClassificationsResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodVideoClassificationsData\"\xa4\x01\n\x18VodListSnapshotsResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.VodSnapshotData\"\xa7\x01\n\x16VodGetFileListResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodGetMediaInfosData\"\xa7\x01\n\x17VodGetFileInfosResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodGetFileInfosData\"\xbb\x01\n!VodUpdateFileStorageClassResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodUpdateFileStorageClassData\"\xb1\x01\n\x1cVodGetInnerAuditURLsResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12H\n\x06Result\x18\x02 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.VodGetInnerAuditURLsData\"\xb9\x01\n VodGetAdAuditResultByVidResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodGetAdAuditResultByVidData\"j\n\x1fVodExtractMediaMetaTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xab\x01\n\x18VodStartWorkflowResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodStartWorkflowResult\"\xae\x01\n\"VodRetrieveTranscodeResultResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.TranscodeResult\"\xbb\x01\n VodListWorkflowExecutionResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodListWorkflowExecutionResult\"\xc5\x01\n%VodGetWorkflowExecutionDetailResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12S\n\x06Result\x18\x02 \x01(\x0b\x32\x43.Volcengine.Vod.Models.Business.VodGetWorkflowExecutionDetailResult\"\xb3\x01\n%VodGetWorkflowExecutionStatusResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x41\n\x06Result\x18\x02 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.WorkflowExecution\"\xaa\x01\n\x1cVodGetWorkflowResultResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x41\n\x06Result\x18\x02 \x01(\x0b\x32\x31.Volcengine.Vod.Models.Business.VodWorkflowResult\"\xaf\x01\n\x1dVodCreateTaskTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodTaskTemplateResult\"\xaf\x01\n\x1dVodUpdateTaskTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodTaskTemplateResult\"\xaf\x01\n\x1dVodDeleteTaskTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodTaskTemplateResult\"\xac\x01\n\x1aVodGetTaskTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodTaskTemplateResult\"\xb1\x01\n\x1bVodListTaskTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodListTaskTemplateResult\"\xb7\x01\n!VodCreateWorkflowTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodWorkflowTemplateResult\"l\n!VodUpdateWorkflowTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"l\n!VodDeleteWorkflowTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb4\x01\n\x1eVodGetWorkflowTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodWorkflowTemplateResult\"\xb9\x01\n\x1fVodListWorkflowTemplateResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodListWorkflowTemplateResult\"\xa3\x01\n\x1aVodCreateWatermarkResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.LogoTemplate\"e\n\x1aVodUpdateWatermarkResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"e\n\x1aVodDeleteWatermarkResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xa0\x01\n\x17VodGetWatermarkResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.LogoTemplate\"\xb3\x01\n\x18VodListWatermarkResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodListWatermarkResponseResult\"\xc0\x01\n$VodSubmitDirectEditTaskAsyncResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12O\n\x06Result\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.SubmitDirectEditTaskAsyncResult\"\xbe\x01\n#VodSubmitDirectEditTaskSyncResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.SubmitDirectEditTaskSyncResult\"\xb2\x01\n VodGetDirectEditProgressResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.GetDirectEditProgress\"\xae\x01\n\x1eVodGetDirectEditResultResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x03(\x0b\x32\x33.Volcengine.Vod.Models.Business.GetDirectEditResult\"\xb0\x01\n\x1fVodCancelDirectEditTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.CancelDirectEditTask\"\xb2\x01\n\x1dVodAsyncVCreativeTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12H\n\x06Result\x18\x02 \x01(\x0b\x32\x38.Volcengine.Vod.Models.Business.AsyncVCreativeTaskResult\"\xb4\x01\n!VodGetVCreativeTaskResultResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.GetVCreativeTaskResult\"a\n\x16VodCreateSpaceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"a\n\x16VodDeleteSpaceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\x9d\x01\n\x14VodListSpaceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodSpaceInfo\"\xa2\x01\n\x19VodGetSpaceDetailResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x01(\x0b\x32,.Volcengine.Vod.Models.Business.VodSpaceInfo\"a\n\x16VodUpdateSpaceResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"m\n\"VodUpdateSpaceUploadConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb5\x01\n$VodDescribeUploadSpaceConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodUploadSpaceConfig\"m\n\"VodUpdateUploadSpaceConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xc7\x01\n&VodDescribeVodSpaceStorageDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12T\n\x06Result\x18\x02 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.VodDescribeVodSpaceStorageDataResult\"j\n\x1fVodUpdateDomainPlayRuleResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"j\n\x1fVodAddDomainToSchedulerResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"o\n$VodRemoveDomainFromSchedulerResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"b\n\x17VodDeleteDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"a\n\x16VodStartDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"`\n\x15VodStopDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xa5\x01\n\x15VodListDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodDomainConfigInfo\"\xb2\x01\n\x1fVodCreateCdnRefreshTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodCreateCdnTaskResult\"\xb2\x01\n\x1fVodCreateCdnPreloadTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x46\n\x06Result\x18\x02 \x01(\x0b\x32\x36.Volcengine.Vod.Models.Business.VodCreateCdnTaskResult\"\xa4\x01\n\x17VodListCdnTasksResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12@\n\x06Result\x18\x02 \x01(\x0b\x32\x30.Volcengine.Vod.Models.Business.VodCdnTaskResult\"\xb1\x01\n\x1bVodListCdnAccessLogResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodListCdnAccessLogResult\"\xb7\x01\n\x1eVodListCdnTopAccessUrlResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodListCdnTopAccessUrlResult\"\xb1\x01\n\x1bVodListCdnTopAccessResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodListCdnTopAccessResult\"\xcd\x01\n)VodDescribeVodDomainBandwidthDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12W\n\x06Result\x18\x02 \x01(\x0b\x32G.Volcengine.Vod.Models.Business.VodDescribeVodDomainBandwidthDataResult\"\xb7\x01\n\x1eVodCdnStatisticsCommonResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodCdnStatisticsCommonResult\"\xa2\x01\n\x19VodDescribeIPInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12<\n\x06Result\x18\x02 \x03(\x0b\x32,.Volcengine.Vod.Models.Business.VodCdnIpInfo\"\xc9\x01\n\'VodDescribeVodDomainTrafficDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12U\n\x06Result\x18\x02 \x01(\x0b\x32\x45.Volcengine.Vod.Models.Business.VodDescribeVodDomainTrafficDataResult\"\xb1\x01\n\x1bVodSubmitBlockTasksResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12I\n\x06Result\x18\x02 \x01(\x0b\x32\x39.Volcengine.Vod.Models.Business.VodSubmitBlockTasksResult\"\xb9\x01\n\x1fVodGetContentBlockTasksResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodGetContentBlockTasksResult\"d\n\x19VodCreateDomainV2Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"d\n\x19VodCreateDomainV3Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"j\n\x1fVodUpdateDomainExpireV2Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"n\n#VodUpdateDomainAuthConfigV2Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"q\n&VodUpdateDomainUrlAuthConfigV2Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb3\x01\n\x1cVodVerifyDomainOwnerResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12J\n\x06Result\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodVerifyDomainOwnerResult\"\xc7\x01\n&VodDescribeDomainVerifyContentResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12T\n\x06Result\x18\x02 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.VodDescribeDomainVerifyContentResult\"\xad\x01\n\x19VodListPCDNDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12G\n\x06Result\x18\x02 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodPCDNDomainConfigInfo\"f\n\x1bVodCreatePCDNDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"e\n\x1aVodStartPCDNDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"d\n\x19VodStopPCDNDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"f\n\x1bVodDeletePCDNDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"h\n\x1dVodUpdateDomainConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb9\x01\n\x1fVodDescribeDomainConfigResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodDescribeDomainConfigResult\"\xb3\x01\n\x1cVodDescribeCdnEdgeIpResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12J\n\x06Result\x18\x02 \x01(\x0b\x32:.Volcengine.Vod.Models.Business.VodDescribeCdnEdgeIpResult\"\xbf\x01\n\"VodDescribeCdnRegionAndIspResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12P\n\x06Result\x18\x02 \x01(\x0b\x32@.Volcengine.Vod.Models.Business.VodDescribeCdnRegionAndIspResult\"k\n AddOrUpdateCertificateV2Response\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"c\n\x18UpdateDomainAreaResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"m\n\"VodAddCallbackSubscriptionResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"f\n\x1bVodSetCallbackEventResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xa5\x01\n\x19GetCallbackRecordResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12?\n\x06Result\x18\x02 \x01(\x0b\x32/.Volcengine.Vod.Models.Business.CallbackRecords\"\xc9\x01\n\'VodGetSmartStrategyLitePlayInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12U\n\x06Result\x18\x02 \x01(\x0b\x32\x45.Volcengine.Vod.Models.Business.VodGetSmartStrategyLitePlayInfoResult\"\xa5\x01\n\x15VodGetAppInfoResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x43\n\x06Result\x18\x02 \x01(\x0b\x32\x33.Volcengine.Vod.Models.Business.VodGetAppInfoResult\"\xc5\x01\n%DescribeVodSpaceTranscodeDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12S\n\x06Result\x18\x02 \x01(\x0b\x32\x43.Volcengine.Vod.Models.Business.DescribeVodSpaceTranscodeDataResult\"\xc3\x01\n$DescribeVodSpaceAIStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12R\n\x06Result\x18\x02 \x01(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodSpaceAIStatisDataResult\"\xcf\x01\n*DescribeVodSpaceSubtitleStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12X\n\x06Result\x18\x02 \x01(\x0b\x32H.Volcengine.Vod.Models.Business.DescribeVodSpaceSubtitleStatisDataResult\"\xcb\x01\n(DescribeVodSpaceDetectStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12V\n\x06Result\x18\x02 \x01(\x0b\x32\x46.Volcengine.Vod.Models.Business.DescribeVodSpaceDetectStatisDataResult\"\xb9\x01\n\x1f\x44\x65scribeVodSnapshotDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.DescribeVodSnapshotDataResult\"\xcf\x01\n*DescribeVodSpaceWorkflowDetailDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12X\n\x06Result\x18\x02 \x01(\x0b\x32H.Volcengine.Vod.Models.Business.DescribeVodSpaceWorkflowDetailDataResult\"\xc7\x01\n&DescribeVodSpaceEditDetailDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12T\n\x06Result\x18\x02 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceEditDetailDataResult\"\xc3\x01\n$DescribeVodRealtimeMediaDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12R\n\x06Result\x18\x02 \x01(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDataResult\"\xcf\x01\n*DescribeVodRealtimeMediaDetailDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12X\n\x06Result\x18\x02 \x01(\x0b\x32H.Volcengine.Vod.Models.Business.DescribeVodRealtimeMediaDetailDataResult\"\xc7\x01\n&DescribeVodPlayFileLogByDomainResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12T\n\x06Result\x18\x02 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodPlayFileLogByDomainResult\"\xc1\x01\n#DescribeVodEnhanceImageDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12Q\n\x06Result\x18\x02 \x01(\x0b\x32\x41.Volcengine.Vod.Models.Business.DescribeVodEnhanceImageDataResult\"\xc7\x01\n&DescribeVodSpaceEditStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12T\n\x06Result\x18\x02 \x01(\x0b\x32\x44.Volcengine.Vod.Models.Business.DescribeVodSpaceEditStatisDataResult\"\xc1\x01\n#DescribeVodPlayedStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12Q\n\x06Result\x18\x02 \x01(\x0b\x32\x41.Volcengine.Vod.Models.Business.DescribeVodPlayedStatisDataResult\"\xc9\x01\n\'DescribeVodMostPlayedStatisDataResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12U\n\x06Result\x18\x02 \x01(\x0b\x32\x45.Volcengine.Vod.Models.Business.DescribeVodMostPlayedStatisDataResult\"\xc3\x01\n$DescribeVodVidTrafficFileLogResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12R\n\x06Result\x18\x02 \x01(\x0b\x32\x42.Volcengine.Vod.Models.Business.DescribeVodVidTrafficFileLogResult\"\xb9\x01\n\x1fVodSubmitBlockMediaTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodSubmitBlockMediaTaskResult\"\xbd\x01\n!VodSubmitUnblockMediaTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12O\n\x06Result\x18\x02 \x01(\x0b\x32?.Volcengine.Vod.Models.Business.VodSubmitUnblockMediaTaskResult\"\xbb\x01\n VodQueryMediaBlockStatusResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodQueryMediaBlockStatusResult\"\xa9\x01\n\x17VodListProjectsResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x45\n\x06Result\x18\x02 \x01(\x0b\x32\x35.Volcengine.Vod.Models.Business.VodListProjectsResult\"\xb9\x01\n VodGetTradeConfigurationResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.TradeConfigurationInfoResult\"\xb5\x01\n\x1dVodSetCloudMigrateJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodSetCloudMigrateJobResult\"k\n VodSubmitCloudMigrateJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb5\x01\n\x1dVodGetCloudMigrateJobResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodGetCloudMigrateJobResult\"\xa7\x01\n\x16VodReportEventResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x01(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodReportEventResult\"\xb9\x01\n\x1fVodCreateDramaRecapTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodCreateDramaRecapTaskResult\"\xbb\x01\n VodCreateDramaScriptTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12N\n\x06Result\x18\x02 \x01(\x0b\x32>.Volcengine.Vod.Models.Business.VodCreateDramaScriptTaskResult\"\xb7\x01\n\x1eVodQueryDramaRecapTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12L\n\x06Result\x18\x02 \x01(\x0b\x32<.Volcengine.Vod.Models.Business.VodQueryDramaRecapTaskResult\"\xb9\x01\n\x1fVodQueryDramaScriptTaskResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12M\n\x06Result\x18\x02 \x01(\x0b\x32=.Volcengine.Vod.Models.Business.VodQueryDramaScriptTaskResult\"\xb5\x01\n\x1dVodGetMediaEntityListResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12K\n\x06Result\x18\x02 \x01(\x0b\x32;.Volcengine.Vod.Models.Business.VodGetMediaEntityListResult\"\xad\x01\n\x19VodGetMediaEntityResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12G\n\x06Result\x18\x02 \x01(\x0b\x32\x37.Volcengine.Vod.Models.Business.VodGetMediaEntityResult\"g\n\x1cVodDeleteMediaEntityResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\"\xb4\x01\n#VodGetMediaEntityConfigListResponse\x12G\n\x10ResponseMetadata\x18\x01 \x01(\x0b\x32-.Volcengine.Base.Models.Base.ResponseMetadata\x12\x44\n\x06Result\x18\x02 \x03(\x0b\x32\x34.Volcengine.Vod.Models.Business.VodMediaEntityConfigB\xcc\x01\n)com.volcengine.service.vod.model.responseB\x0bVodResponseP\x01ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/response\xa0\x01\x01\xd8\x01\x01\xca\x02 Volc\\Service\\Vod\\Models\\Response\xe2\x02#Volc\\Service\\Vod\\Models\\GPBMetadatab\x06proto3') _VODGETALLPLAYINFORESPONSE = DESCRIPTOR.message_types_by_name['VodGetAllPlayInfoResponse'] _VODGETPLAYINFORESPONSE = DESCRIPTOR.message_types_by_name['VodGetPlayInfoResponse'] _VODGETORIGINALPLAYINFORESPONSE = DESCRIPTOR.message_types_by_name['VodGetOriginalPlayInfoResponse'] _VODGETPRIVATEDRMPLAYAUTHRESPONSE = DESCRIPTOR.message_types_by_name['VodGetPrivateDrmPlayAuthResponse'] _VODGETHLSDECRYPTIONKEYRESPONSE = DESCRIPTOR.message_types_by_name['VodGetHlsDecryptionKeyResponse'] _VODCREATEHLSDECRYPTIONKEYRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateHlsDecryptionKeyResponse'] _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESPONSE = DESCRIPTOR.message_types_by_name['VodGetPlayInfoWithLiveTimeShiftSceneResponse'] _VODDESCRIBEDRMDATAKEYRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeDrmDataKeyResponse'] _VODSUBMITMOVEOBJECTTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitMoveObjectTaskResponse'] _VODQUERYMOVEOBJECTTASKINFORESPONSE = DESCRIPTOR.message_types_by_name['VodQueryMoveObjectTaskInfoResponse'] _VODSUBMITBLOCKOBJECTTASKSRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitBlockObjectTasksResponse'] _VODLISTBLOCKOBJECTTASKSRESPONSE = DESCRIPTOR.message_types_by_name['VodListBlockObjectTasksResponse'] _VODUPLOADMEDIARESPONSE = DESCRIPTOR.message_types_by_name['VodUploadMediaResponse'] _VODQUERYUPLOADTASKINFORESPONSE = DESCRIPTOR.message_types_by_name['VodQueryUploadTaskInfoResponse'] _VODURLUPLOADRESPONSE = DESCRIPTOR.message_types_by_name['VodUrlUploadResponse'] _VODAPPLYUPLOADINFORESPONSE = DESCRIPTOR.message_types_by_name['VodApplyUploadInfoResponse'] _VODCOMMITUPLOADINFORESPONSE = DESCRIPTOR.message_types_by_name['VodCommitUploadInfoResponse'] _VODPARSEUPLOADMANIFESTRESPONSE = DESCRIPTOR.message_types_by_name['VodParseUploadManifestResponse'] _VODLISTFILEMETAINFOSBYFILENAMESRESPONSE = DESCRIPTOR.message_types_by_name['VodListFileMetaInfosByFileNamesResponse'] _VODGETMEDIAINFOSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMediaInfosResponse'] _VODUPDATEMEDIAINFORESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateMediaInfoResponse'] _VODGETRECOMMENDEDPOSTERRESPONSE = DESCRIPTOR.message_types_by_name['VodGetRecommendedPosterResponse'] _VODUPDATEMEDIAPUBLISHSTATUSRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateMediaPublishStatusResponse'] _VODUPDATEMEDIASTORAGECLASSRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateMediaStorageClassResponse'] _VODDELETEMEDIARESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteMediaResponse'] _VODDELETEMATERIALRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteMaterialResponse'] _VODDELETETRANSCODESRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteTranscodesResponse'] _VODDELETEMEDIATOSFILERESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteMediaTosFileResponse'] _VODGETMEDIALISTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMediaListResponse'] _VODGETSUBTITLEINFOLISTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetSubtitleInfoListResponse'] _VODUPDATESUBTITLESTATUSRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateSubtitleStatusResponse'] _VODUPDATESUBTITLEINFORESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateSubtitleInfoResponse'] _VODGETAUDITFRAMESFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetAuditFramesForAuditResponse'] _VODGETMLFRAMESFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMLFramesForAuditResponse'] _VODGETBETTERFRAMESFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetBetterFramesForAuditResponse'] _VODGETAUDIOINFOFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetAudioInfoForAuditResponse'] _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetAutomaticSpeechRecognitionForAuditResponse'] _VODGETAUDIOEVENTDETECTIONFORAUDITRESPONSE = DESCRIPTOR.message_types_by_name['VodGetAudioEventDetectionForAuditResponse'] _VODCREATEVIDEOCLASSIFICATIONRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateVideoClassificationResponse'] _VODUPDATEVIDEOCLASSIFICATIONRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateVideoClassificationResponse'] _VODDELETEVIDEOCLASSIFICATIONRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteVideoClassificationResponse'] _VODLISTVIDEOCLASSIFICATIONSRESPONSE = DESCRIPTOR.message_types_by_name['VodListVideoClassificationsResponse'] _VODLISTSNAPSHOTSRESPONSE = DESCRIPTOR.message_types_by_name['VodListSnapshotsResponse'] _VODGETFILELISTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetFileListResponse'] _VODGETFILEINFOSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetFileInfosResponse'] _VODUPDATEFILESTORAGECLASSRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateFileStorageClassResponse'] _VODGETINNERAUDITURLSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetInnerAuditURLsResponse'] _VODGETADAUDITRESULTBYVIDRESPONSE = DESCRIPTOR.message_types_by_name['VodGetAdAuditResultByVidResponse'] _VODEXTRACTMEDIAMETATASKRESPONSE = DESCRIPTOR.message_types_by_name['VodExtractMediaMetaTaskResponse'] _VODSTARTWORKFLOWRESPONSE = DESCRIPTOR.message_types_by_name['VodStartWorkflowResponse'] _VODRETRIEVETRANSCODERESULTRESPONSE = DESCRIPTOR.message_types_by_name['VodRetrieveTranscodeResultResponse'] _VODLISTWORKFLOWEXECUTIONRESPONSE = DESCRIPTOR.message_types_by_name['VodListWorkflowExecutionResponse'] _VODGETWORKFLOWEXECUTIONDETAILRESPONSE = DESCRIPTOR.message_types_by_name['VodGetWorkflowExecutionDetailResponse'] _VODGETWORKFLOWEXECUTIONSTATUSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetWorkflowExecutionStatusResponse'] _VODGETWORKFLOWRESULTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetWorkflowResultResponse'] _VODCREATETASKTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodCreateTaskTemplateResponse'] _VODUPDATETASKTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateTaskTemplateResponse'] _VODDELETETASKTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteTaskTemplateResponse'] _VODGETTASKTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodGetTaskTemplateResponse'] _VODLISTTASKTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodListTaskTemplateResponse'] _VODCREATEWORKFLOWTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodCreateWorkflowTemplateResponse'] _VODUPDATEWORKFLOWTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateWorkflowTemplateResponse'] _VODDELETEWORKFLOWTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteWorkflowTemplateResponse'] _VODGETWORKFLOWTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodGetWorkflowTemplateResponse'] _VODLISTWORKFLOWTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['VodListWorkflowTemplateResponse'] _VODCREATEWATERMARKRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateWatermarkResponse'] _VODUPDATEWATERMARKRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateWatermarkResponse'] _VODDELETEWATERMARKRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteWatermarkResponse'] _VODGETWATERMARKRESPONSE = DESCRIPTOR.message_types_by_name['VodGetWatermarkResponse'] _VODLISTWATERMARKRESPONSE = DESCRIPTOR.message_types_by_name['VodListWatermarkResponse'] _VODSUBMITDIRECTEDITTASKASYNCRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitDirectEditTaskAsyncResponse'] _VODSUBMITDIRECTEDITTASKSYNCRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitDirectEditTaskSyncResponse'] _VODGETDIRECTEDITPROGRESSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetDirectEditProgressResponse'] _VODGETDIRECTEDITRESULTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetDirectEditResultResponse'] _VODCANCELDIRECTEDITTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodCancelDirectEditTaskResponse'] _VODASYNCVCREATIVETASKRESPONSE = DESCRIPTOR.message_types_by_name['VodAsyncVCreativeTaskResponse'] _VODGETVCREATIVETASKRESULTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetVCreativeTaskResultResponse'] _VODCREATESPACERESPONSE = DESCRIPTOR.message_types_by_name['VodCreateSpaceResponse'] _VODDELETESPACERESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteSpaceResponse'] _VODLISTSPACERESPONSE = DESCRIPTOR.message_types_by_name['VodListSpaceResponse'] _VODGETSPACEDETAILRESPONSE = DESCRIPTOR.message_types_by_name['VodGetSpaceDetailResponse'] _VODUPDATESPACERESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateSpaceResponse'] _VODUPDATESPACEUPLOADCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateSpaceUploadConfigResponse'] _VODDESCRIBEUPLOADSPACECONFIGRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeUploadSpaceConfigResponse'] _VODUPDATEUPLOADSPACECONFIGRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateUploadSpaceConfigResponse'] _VODDESCRIBEVODSPACESTORAGEDATARESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeVodSpaceStorageDataResponse'] _VODUPDATEDOMAINPLAYRULERESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateDomainPlayRuleResponse'] _VODADDDOMAINTOSCHEDULERRESPONSE = DESCRIPTOR.message_types_by_name['VodAddDomainToSchedulerResponse'] _VODREMOVEDOMAINFROMSCHEDULERRESPONSE = DESCRIPTOR.message_types_by_name['VodRemoveDomainFromSchedulerResponse'] _VODDELETEDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteDomainResponse'] _VODSTARTDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodStartDomainResponse'] _VODSTOPDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodStopDomainResponse'] _VODLISTDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodListDomainResponse'] _VODCREATECDNREFRESHTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateCdnRefreshTaskResponse'] _VODCREATECDNPRELOADTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateCdnPreloadTaskResponse'] _VODLISTCDNTASKSRESPONSE = DESCRIPTOR.message_types_by_name['VodListCdnTasksResponse'] _VODLISTCDNACCESSLOGRESPONSE = DESCRIPTOR.message_types_by_name['VodListCdnAccessLogResponse'] _VODLISTCDNTOPACCESSURLRESPONSE = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessUrlResponse'] _VODLISTCDNTOPACCESSRESPONSE = DESCRIPTOR.message_types_by_name['VodListCdnTopAccessResponse'] _VODDESCRIBEVODDOMAINBANDWIDTHDATARESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainBandwidthDataResponse'] _VODCDNSTATISTICSCOMMONRESPONSE = DESCRIPTOR.message_types_by_name['VodCdnStatisticsCommonResponse'] _VODDESCRIBEIPINFORESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeIPInfoResponse'] _VODDESCRIBEVODDOMAINTRAFFICDATARESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeVodDomainTrafficDataResponse'] _VODSUBMITBLOCKTASKSRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitBlockTasksResponse'] _VODGETCONTENTBLOCKTASKSRESPONSE = DESCRIPTOR.message_types_by_name['VodGetContentBlockTasksResponse'] _VODCREATEDOMAINV2RESPONSE = DESCRIPTOR.message_types_by_name['VodCreateDomainV2Response'] _VODCREATEDOMAINV3RESPONSE = DESCRIPTOR.message_types_by_name['VodCreateDomainV3Response'] _VODUPDATEDOMAINEXPIREV2RESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateDomainExpireV2Response'] _VODUPDATEDOMAINAUTHCONFIGV2RESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateDomainAuthConfigV2Response'] _VODUPDATEDOMAINURLAUTHCONFIGV2RESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateDomainUrlAuthConfigV2Response'] _VODVERIFYDOMAINOWNERRESPONSE = DESCRIPTOR.message_types_by_name['VodVerifyDomainOwnerResponse'] _VODDESCRIBEDOMAINVERIFYCONTENTRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeDomainVerifyContentResponse'] _VODLISTPCDNDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodListPCDNDomainResponse'] _VODCREATEPCDNDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodCreatePCDNDomainResponse'] _VODSTARTPCDNDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodStartPCDNDomainResponse'] _VODSTOPPCDNDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodStopPCDNDomainResponse'] _VODDELETEPCDNDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['VodDeletePCDNDomainResponse'] _VODUPDATEDOMAINCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['VodUpdateDomainConfigResponse'] _VODDESCRIBEDOMAINCONFIGRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeDomainConfigResponse'] _VODDESCRIBECDNEDGEIPRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeCdnEdgeIpResponse'] _VODDESCRIBECDNREGIONANDISPRESPONSE = DESCRIPTOR.message_types_by_name['VodDescribeCdnRegionAndIspResponse'] _ADDORUPDATECERTIFICATEV2RESPONSE = DESCRIPTOR.message_types_by_name['AddOrUpdateCertificateV2Response'] _UPDATEDOMAINAREARESPONSE = DESCRIPTOR.message_types_by_name['UpdateDomainAreaResponse'] _VODADDCALLBACKSUBSCRIPTIONRESPONSE = DESCRIPTOR.message_types_by_name['VodAddCallbackSubscriptionResponse'] _VODSETCALLBACKEVENTRESPONSE = DESCRIPTOR.message_types_by_name['VodSetCallbackEventResponse'] _GETCALLBACKRECORDRESPONSE = DESCRIPTOR.message_types_by_name['GetCallbackRecordResponse'] _VODGETSMARTSTRATEGYLITEPLAYINFORESPONSE = DESCRIPTOR.message_types_by_name['VodGetSmartStrategyLitePlayInfoResponse'] _VODGETAPPINFORESPONSE = DESCRIPTOR.message_types_by_name['VodGetAppInfoResponse'] _DESCRIBEVODSPACETRANSCODEDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceTranscodeDataResponse'] _DESCRIBEVODSPACEAISTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceAIStatisDataResponse'] _DESCRIBEVODSPACESUBTITLESTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceSubtitleStatisDataResponse'] _DESCRIBEVODSPACEDETECTSTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceDetectStatisDataResponse'] _DESCRIBEVODSNAPSHOTDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSnapshotDataResponse'] _DESCRIBEVODSPACEWORKFLOWDETAILDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceWorkflowDetailDataResponse'] _DESCRIBEVODSPACEEDITDETAILDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditDetailDataResponse'] _DESCRIBEVODREALTIMEMEDIADATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDataResponse'] _DESCRIBEVODREALTIMEMEDIADETAILDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodRealtimeMediaDetailDataResponse'] _DESCRIBEVODPLAYFILELOGBYDOMAINRESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodPlayFileLogByDomainResponse'] _DESCRIBEVODENHANCEIMAGEDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodEnhanceImageDataResponse'] _DESCRIBEVODSPACEEDITSTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodSpaceEditStatisDataResponse'] _DESCRIBEVODPLAYEDSTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodPlayedStatisDataResponse'] _DESCRIBEVODMOSTPLAYEDSTATISDATARESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodMostPlayedStatisDataResponse'] _DESCRIBEVODVIDTRAFFICFILELOGRESPONSE = DESCRIPTOR.message_types_by_name['DescribeVodVidTrafficFileLogResponse'] _VODSUBMITBLOCKMEDIATASKRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitBlockMediaTaskResponse'] _VODSUBMITUNBLOCKMEDIATASKRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitUnblockMediaTaskResponse'] _VODQUERYMEDIABLOCKSTATUSRESPONSE = DESCRIPTOR.message_types_by_name['VodQueryMediaBlockStatusResponse'] _VODLISTPROJECTSRESPONSE = DESCRIPTOR.message_types_by_name['VodListProjectsResponse'] _VODGETTRADECONFIGURATIONRESPONSE = DESCRIPTOR.message_types_by_name['VodGetTradeConfigurationResponse'] _VODSETCLOUDMIGRATEJOBRESPONSE = DESCRIPTOR.message_types_by_name['VodSetCloudMigrateJobResponse'] _VODSUBMITCLOUDMIGRATEJOBRESPONSE = DESCRIPTOR.message_types_by_name['VodSubmitCloudMigrateJobResponse'] _VODGETCLOUDMIGRATEJOBRESPONSE = DESCRIPTOR.message_types_by_name['VodGetCloudMigrateJobResponse'] _VODREPORTEVENTRESPONSE = DESCRIPTOR.message_types_by_name['VodReportEventResponse'] _VODCREATEDRAMARECAPTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateDramaRecapTaskResponse'] _VODCREATEDRAMASCRIPTTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodCreateDramaScriptTaskResponse'] _VODQUERYDRAMARECAPTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodQueryDramaRecapTaskResponse'] _VODQUERYDRAMASCRIPTTASKRESPONSE = DESCRIPTOR.message_types_by_name['VodQueryDramaScriptTaskResponse'] _VODGETMEDIAENTITYLISTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMediaEntityListResponse'] _VODGETMEDIAENTITYRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMediaEntityResponse'] _VODDELETEMEDIAENTITYRESPONSE = DESCRIPTOR.message_types_by_name['VodDeleteMediaEntityResponse'] _VODGETMEDIAENTITYCONFIGLISTRESPONSE = DESCRIPTOR.message_types_by_name['VodGetMediaEntityConfigListResponse'] VodGetAllPlayInfoResponse = _reflection.GeneratedProtocolMessageType('VodGetAllPlayInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETALLPLAYINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAllPlayInfoResponse) }) _sym_db.RegisterMessage(VodGetAllPlayInfoResponse) VodGetPlayInfoResponse = _reflection.GeneratedProtocolMessageType('VodGetPlayInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETPLAYINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetPlayInfoResponse) }) _sym_db.RegisterMessage(VodGetPlayInfoResponse) VodGetOriginalPlayInfoResponse = _reflection.GeneratedProtocolMessageType('VodGetOriginalPlayInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETORIGINALPLAYINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetOriginalPlayInfoResponse) }) _sym_db.RegisterMessage(VodGetOriginalPlayInfoResponse) VodGetPrivateDrmPlayAuthResponse = _reflection.GeneratedProtocolMessageType('VodGetPrivateDrmPlayAuthResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETPRIVATEDRMPLAYAUTHRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetPrivateDrmPlayAuthResponse) }) _sym_db.RegisterMessage(VodGetPrivateDrmPlayAuthResponse) VodGetHlsDecryptionKeyResponse = _reflection.GeneratedProtocolMessageType('VodGetHlsDecryptionKeyResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETHLSDECRYPTIONKEYRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetHlsDecryptionKeyResponse) }) _sym_db.RegisterMessage(VodGetHlsDecryptionKeyResponse) VodCreateHlsDecryptionKeyResponse = _reflection.GeneratedProtocolMessageType('VodCreateHlsDecryptionKeyResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEHLSDECRYPTIONKEYRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateHlsDecryptionKeyResponse) }) _sym_db.RegisterMessage(VodCreateHlsDecryptionKeyResponse) VodGetPlayInfoWithLiveTimeShiftSceneResponse = _reflection.GeneratedProtocolMessageType('VodGetPlayInfoWithLiveTimeShiftSceneResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetPlayInfoWithLiveTimeShiftSceneResponse) }) _sym_db.RegisterMessage(VodGetPlayInfoWithLiveTimeShiftSceneResponse) VodDescribeDrmDataKeyResponse = _reflection.GeneratedProtocolMessageType('VodDescribeDrmDataKeyResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDRMDATAKEYRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeDrmDataKeyResponse) }) _sym_db.RegisterMessage(VodDescribeDrmDataKeyResponse) VodSubmitMoveObjectTaskResponse = _reflection.GeneratedProtocolMessageType('VodSubmitMoveObjectTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITMOVEOBJECTTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitMoveObjectTaskResponse) }) _sym_db.RegisterMessage(VodSubmitMoveObjectTaskResponse) VodQueryMoveObjectTaskInfoResponse = _reflection.GeneratedProtocolMessageType('VodQueryMoveObjectTaskInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMOVEOBJECTTASKINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodQueryMoveObjectTaskInfoResponse) }) _sym_db.RegisterMessage(VodQueryMoveObjectTaskInfoResponse) VodSubmitBlockObjectTasksResponse = _reflection.GeneratedProtocolMessageType('VodSubmitBlockObjectTasksResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKOBJECTTASKSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitBlockObjectTasksResponse) }) _sym_db.RegisterMessage(VodSubmitBlockObjectTasksResponse) VodListBlockObjectTasksResponse = _reflection.GeneratedProtocolMessageType('VodListBlockObjectTasksResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTBLOCKOBJECTTASKSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListBlockObjectTasksResponse) }) _sym_db.RegisterMessage(VodListBlockObjectTasksResponse) VodUploadMediaResponse = _reflection.GeneratedProtocolMessageType('VodUploadMediaResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPLOADMEDIARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUploadMediaResponse) }) _sym_db.RegisterMessage(VodUploadMediaResponse) VodQueryUploadTaskInfoResponse = _reflection.GeneratedProtocolMessageType('VodQueryUploadTaskInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYUPLOADTASKINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodQueryUploadTaskInfoResponse) }) _sym_db.RegisterMessage(VodQueryUploadTaskInfoResponse) VodUrlUploadResponse = _reflection.GeneratedProtocolMessageType('VodUrlUploadResponse', (_message.Message,), { 'DESCRIPTOR' : _VODURLUPLOADRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUrlUploadResponse) }) _sym_db.RegisterMessage(VodUrlUploadResponse) VodApplyUploadInfoResponse = _reflection.GeneratedProtocolMessageType('VodApplyUploadInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODAPPLYUPLOADINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodApplyUploadInfoResponse) }) _sym_db.RegisterMessage(VodApplyUploadInfoResponse) VodCommitUploadInfoResponse = _reflection.GeneratedProtocolMessageType('VodCommitUploadInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCOMMITUPLOADINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCommitUploadInfoResponse) }) _sym_db.RegisterMessage(VodCommitUploadInfoResponse) VodParseUploadManifestResponse = _reflection.GeneratedProtocolMessageType('VodParseUploadManifestResponse', (_message.Message,), { 'DESCRIPTOR' : _VODPARSEUPLOADMANIFESTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodParseUploadManifestResponse) }) _sym_db.RegisterMessage(VodParseUploadManifestResponse) VodListFileMetaInfosByFileNamesResponse = _reflection.GeneratedProtocolMessageType('VodListFileMetaInfosByFileNamesResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTFILEMETAINFOSBYFILENAMESRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListFileMetaInfosByFileNamesResponse) }) _sym_db.RegisterMessage(VodListFileMetaInfosByFileNamesResponse) VodGetMediaInfosResponse = _reflection.GeneratedProtocolMessageType('VodGetMediaInfosResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAINFOSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMediaInfosResponse) }) _sym_db.RegisterMessage(VodGetMediaInfosResponse) VodUpdateMediaInfoResponse = _reflection.GeneratedProtocolMessageType('VodUpdateMediaInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIAINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateMediaInfoResponse) }) _sym_db.RegisterMessage(VodUpdateMediaInfoResponse) VodGetRecommendedPosterResponse = _reflection.GeneratedProtocolMessageType('VodGetRecommendedPosterResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETRECOMMENDEDPOSTERRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetRecommendedPosterResponse) }) _sym_db.RegisterMessage(VodGetRecommendedPosterResponse) VodUpdateMediaPublishStatusResponse = _reflection.GeneratedProtocolMessageType('VodUpdateMediaPublishStatusResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIAPUBLISHSTATUSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateMediaPublishStatusResponse) }) _sym_db.RegisterMessage(VodUpdateMediaPublishStatusResponse) VodUpdateMediaStorageClassResponse = _reflection.GeneratedProtocolMessageType('VodUpdateMediaStorageClassResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEMEDIASTORAGECLASSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateMediaStorageClassResponse) }) _sym_db.RegisterMessage(VodUpdateMediaStorageClassResponse) VodDeleteMediaResponse = _reflection.GeneratedProtocolMessageType('VodDeleteMediaResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteMediaResponse) }) _sym_db.RegisterMessage(VodDeleteMediaResponse) VodDeleteMaterialResponse = _reflection.GeneratedProtocolMessageType('VodDeleteMaterialResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMATERIALRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteMaterialResponse) }) _sym_db.RegisterMessage(VodDeleteMaterialResponse) VodDeleteTranscodesResponse = _reflection.GeneratedProtocolMessageType('VodDeleteTranscodesResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETETRANSCODESRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteTranscodesResponse) }) _sym_db.RegisterMessage(VodDeleteTranscodesResponse) VodDeleteMediaTosFileResponse = _reflection.GeneratedProtocolMessageType('VodDeleteMediaTosFileResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIATOSFILERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteMediaTosFileResponse) }) _sym_db.RegisterMessage(VodDeleteMediaTosFileResponse) VodGetMediaListResponse = _reflection.GeneratedProtocolMessageType('VodGetMediaListResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIALISTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMediaListResponse) }) _sym_db.RegisterMessage(VodGetMediaListResponse) VodGetSubtitleInfoListResponse = _reflection.GeneratedProtocolMessageType('VodGetSubtitleInfoListResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETSUBTITLEINFOLISTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetSubtitleInfoListResponse) }) _sym_db.RegisterMessage(VodGetSubtitleInfoListResponse) VodUpdateSubtitleStatusResponse = _reflection.GeneratedProtocolMessageType('VodUpdateSubtitleStatusResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESUBTITLESTATUSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateSubtitleStatusResponse) }) _sym_db.RegisterMessage(VodUpdateSubtitleStatusResponse) VodUpdateSubtitleInfoResponse = _reflection.GeneratedProtocolMessageType('VodUpdateSubtitleInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESUBTITLEINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateSubtitleInfoResponse) }) _sym_db.RegisterMessage(VodUpdateSubtitleInfoResponse) VodGetAuditFramesForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetAuditFramesForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDITFRAMESFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAuditFramesForAuditResponse) }) _sym_db.RegisterMessage(VodGetAuditFramesForAuditResponse) VodGetMLFramesForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetMLFramesForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMLFRAMESFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMLFramesForAuditResponse) }) _sym_db.RegisterMessage(VodGetMLFramesForAuditResponse) VodGetBetterFramesForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetBetterFramesForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETBETTERFRAMESFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetBetterFramesForAuditResponse) }) _sym_db.RegisterMessage(VodGetBetterFramesForAuditResponse) VodGetAudioInfoForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetAudioInfoForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOINFOFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAudioInfoForAuditResponse) }) _sym_db.RegisterMessage(VodGetAudioInfoForAuditResponse) VodGetAutomaticSpeechRecognitionForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetAutomaticSpeechRecognitionForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAutomaticSpeechRecognitionForAuditResponse) }) _sym_db.RegisterMessage(VodGetAutomaticSpeechRecognitionForAuditResponse) VodGetAudioEventDetectionForAuditResponse = _reflection.GeneratedProtocolMessageType('VodGetAudioEventDetectionForAuditResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETAUDIOEVENTDETECTIONFORAUDITRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAudioEventDetectionForAuditResponse) }) _sym_db.RegisterMessage(VodGetAudioEventDetectionForAuditResponse) VodCreateVideoClassificationResponse = _reflection.GeneratedProtocolMessageType('VodCreateVideoClassificationResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEVIDEOCLASSIFICATIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateVideoClassificationResponse) }) _sym_db.RegisterMessage(VodCreateVideoClassificationResponse) VodUpdateVideoClassificationResponse = _reflection.GeneratedProtocolMessageType('VodUpdateVideoClassificationResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEVIDEOCLASSIFICATIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateVideoClassificationResponse) }) _sym_db.RegisterMessage(VodUpdateVideoClassificationResponse) VodDeleteVideoClassificationResponse = _reflection.GeneratedProtocolMessageType('VodDeleteVideoClassificationResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEVIDEOCLASSIFICATIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteVideoClassificationResponse) }) _sym_db.RegisterMessage(VodDeleteVideoClassificationResponse) VodListVideoClassificationsResponse = _reflection.GeneratedProtocolMessageType('VodListVideoClassificationsResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTVIDEOCLASSIFICATIONSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListVideoClassificationsResponse) }) _sym_db.RegisterMessage(VodListVideoClassificationsResponse) VodListSnapshotsResponse = _reflection.GeneratedProtocolMessageType('VodListSnapshotsResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTSNAPSHOTSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListSnapshotsResponse) }) _sym_db.RegisterMessage(VodListSnapshotsResponse) VodGetFileListResponse = _reflection.GeneratedProtocolMessageType('VodGetFileListResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILELISTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetFileListResponse) }) _sym_db.RegisterMessage(VodGetFileListResponse) VodGetFileInfosResponse = _reflection.GeneratedProtocolMessageType('VodGetFileInfosResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETFILEINFOSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetFileInfosResponse) }) _sym_db.RegisterMessage(VodGetFileInfosResponse) VodUpdateFileStorageClassResponse = _reflection.GeneratedProtocolMessageType('VodUpdateFileStorageClassResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEFILESTORAGECLASSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateFileStorageClassResponse) }) _sym_db.RegisterMessage(VodUpdateFileStorageClassResponse) VodGetInnerAuditURLsResponse = _reflection.GeneratedProtocolMessageType('VodGetInnerAuditURLsResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETINNERAUDITURLSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetInnerAuditURLsResponse) }) _sym_db.RegisterMessage(VodGetInnerAuditURLsResponse) VodGetAdAuditResultByVidResponse = _reflection.GeneratedProtocolMessageType('VodGetAdAuditResultByVidResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETADAUDITRESULTBYVIDRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAdAuditResultByVidResponse) }) _sym_db.RegisterMessage(VodGetAdAuditResultByVidResponse) VodExtractMediaMetaTaskResponse = _reflection.GeneratedProtocolMessageType('VodExtractMediaMetaTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODEXTRACTMEDIAMETATASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodExtractMediaMetaTaskResponse) }) _sym_db.RegisterMessage(VodExtractMediaMetaTaskResponse) VodStartWorkflowResponse = _reflection.GeneratedProtocolMessageType('VodStartWorkflowResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTWORKFLOWRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodStartWorkflowResponse) }) _sym_db.RegisterMessage(VodStartWorkflowResponse) VodRetrieveTranscodeResultResponse = _reflection.GeneratedProtocolMessageType('VodRetrieveTranscodeResultResponse', (_message.Message,), { 'DESCRIPTOR' : _VODRETRIEVETRANSCODERESULTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodRetrieveTranscodeResultResponse) }) _sym_db.RegisterMessage(VodRetrieveTranscodeResultResponse) VodListWorkflowExecutionResponse = _reflection.GeneratedProtocolMessageType('VodListWorkflowExecutionResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWEXECUTIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListWorkflowExecutionResponse) }) _sym_db.RegisterMessage(VodListWorkflowExecutionResponse) VodGetWorkflowExecutionDetailResponse = _reflection.GeneratedProtocolMessageType('VodGetWorkflowExecutionDetailResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWEXECUTIONDETAILRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetWorkflowExecutionDetailResponse) }) _sym_db.RegisterMessage(VodGetWorkflowExecutionDetailResponse) VodGetWorkflowExecutionStatusResponse = _reflection.GeneratedProtocolMessageType('VodGetWorkflowExecutionStatusResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWEXECUTIONSTATUSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetWorkflowExecutionStatusResponse) }) _sym_db.RegisterMessage(VodGetWorkflowExecutionStatusResponse) VodGetWorkflowResultResponse = _reflection.GeneratedProtocolMessageType('VodGetWorkflowResultResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWRESULTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetWorkflowResultResponse) }) _sym_db.RegisterMessage(VodGetWorkflowResultResponse) VodCreateTaskTemplateResponse = _reflection.GeneratedProtocolMessageType('VodCreateTaskTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATETASKTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateTaskTemplateResponse) }) _sym_db.RegisterMessage(VodCreateTaskTemplateResponse) VodUpdateTaskTemplateResponse = _reflection.GeneratedProtocolMessageType('VodUpdateTaskTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATETASKTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateTaskTemplateResponse) }) _sym_db.RegisterMessage(VodUpdateTaskTemplateResponse) VodDeleteTaskTemplateResponse = _reflection.GeneratedProtocolMessageType('VodDeleteTaskTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETETASKTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteTaskTemplateResponse) }) _sym_db.RegisterMessage(VodDeleteTaskTemplateResponse) VodGetTaskTemplateResponse = _reflection.GeneratedProtocolMessageType('VodGetTaskTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETTASKTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetTaskTemplateResponse) }) _sym_db.RegisterMessage(VodGetTaskTemplateResponse) VodListTaskTemplateResponse = _reflection.GeneratedProtocolMessageType('VodListTaskTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTTASKTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListTaskTemplateResponse) }) _sym_db.RegisterMessage(VodListTaskTemplateResponse) VodCreateWorkflowTemplateResponse = _reflection.GeneratedProtocolMessageType('VodCreateWorkflowTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEWORKFLOWTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateWorkflowTemplateResponse) }) _sym_db.RegisterMessage(VodCreateWorkflowTemplateResponse) VodUpdateWorkflowTemplateResponse = _reflection.GeneratedProtocolMessageType('VodUpdateWorkflowTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEWORKFLOWTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateWorkflowTemplateResponse) }) _sym_db.RegisterMessage(VodUpdateWorkflowTemplateResponse) VodDeleteWorkflowTemplateResponse = _reflection.GeneratedProtocolMessageType('VodDeleteWorkflowTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEWORKFLOWTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteWorkflowTemplateResponse) }) _sym_db.RegisterMessage(VodDeleteWorkflowTemplateResponse) VodGetWorkflowTemplateResponse = _reflection.GeneratedProtocolMessageType('VodGetWorkflowTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETWORKFLOWTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetWorkflowTemplateResponse) }) _sym_db.RegisterMessage(VodGetWorkflowTemplateResponse) VodListWorkflowTemplateResponse = _reflection.GeneratedProtocolMessageType('VodListWorkflowTemplateResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWORKFLOWTEMPLATERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListWorkflowTemplateResponse) }) _sym_db.RegisterMessage(VodListWorkflowTemplateResponse) VodCreateWatermarkResponse = _reflection.GeneratedProtocolMessageType('VodCreateWatermarkResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEWATERMARKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateWatermarkResponse) }) _sym_db.RegisterMessage(VodCreateWatermarkResponse) VodUpdateWatermarkResponse = _reflection.GeneratedProtocolMessageType('VodUpdateWatermarkResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEWATERMARKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateWatermarkResponse) }) _sym_db.RegisterMessage(VodUpdateWatermarkResponse) VodDeleteWatermarkResponse = _reflection.GeneratedProtocolMessageType('VodDeleteWatermarkResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEWATERMARKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteWatermarkResponse) }) _sym_db.RegisterMessage(VodDeleteWatermarkResponse) VodGetWatermarkResponse = _reflection.GeneratedProtocolMessageType('VodGetWatermarkResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETWATERMARKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetWatermarkResponse) }) _sym_db.RegisterMessage(VodGetWatermarkResponse) VodListWatermarkResponse = _reflection.GeneratedProtocolMessageType('VodListWatermarkResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTWATERMARKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListWatermarkResponse) }) _sym_db.RegisterMessage(VodListWatermarkResponse) VodSubmitDirectEditTaskAsyncResponse = _reflection.GeneratedProtocolMessageType('VodSubmitDirectEditTaskAsyncResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITDIRECTEDITTASKASYNCRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitDirectEditTaskAsyncResponse) }) _sym_db.RegisterMessage(VodSubmitDirectEditTaskAsyncResponse) VodSubmitDirectEditTaskSyncResponse = _reflection.GeneratedProtocolMessageType('VodSubmitDirectEditTaskSyncResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITDIRECTEDITTASKSYNCRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitDirectEditTaskSyncResponse) }) _sym_db.RegisterMessage(VodSubmitDirectEditTaskSyncResponse) VodGetDirectEditProgressResponse = _reflection.GeneratedProtocolMessageType('VodGetDirectEditProgressResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETDIRECTEDITPROGRESSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetDirectEditProgressResponse) }) _sym_db.RegisterMessage(VodGetDirectEditProgressResponse) VodGetDirectEditResultResponse = _reflection.GeneratedProtocolMessageType('VodGetDirectEditResultResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETDIRECTEDITRESULTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetDirectEditResultResponse) }) _sym_db.RegisterMessage(VodGetDirectEditResultResponse) VodCancelDirectEditTaskResponse = _reflection.GeneratedProtocolMessageType('VodCancelDirectEditTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCANCELDIRECTEDITTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCancelDirectEditTaskResponse) }) _sym_db.RegisterMessage(VodCancelDirectEditTaskResponse) VodAsyncVCreativeTaskResponse = _reflection.GeneratedProtocolMessageType('VodAsyncVCreativeTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODASYNCVCREATIVETASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodAsyncVCreativeTaskResponse) }) _sym_db.RegisterMessage(VodAsyncVCreativeTaskResponse) VodGetVCreativeTaskResultResponse = _reflection.GeneratedProtocolMessageType('VodGetVCreativeTaskResultResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETVCREATIVETASKRESULTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetVCreativeTaskResultResponse) }) _sym_db.RegisterMessage(VodGetVCreativeTaskResultResponse) VodCreateSpaceResponse = _reflection.GeneratedProtocolMessageType('VodCreateSpaceResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATESPACERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateSpaceResponse) }) _sym_db.RegisterMessage(VodCreateSpaceResponse) VodDeleteSpaceResponse = _reflection.GeneratedProtocolMessageType('VodDeleteSpaceResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETESPACERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteSpaceResponse) }) _sym_db.RegisterMessage(VodDeleteSpaceResponse) VodListSpaceResponse = _reflection.GeneratedProtocolMessageType('VodListSpaceResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTSPACERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListSpaceResponse) }) _sym_db.RegisterMessage(VodListSpaceResponse) VodGetSpaceDetailResponse = _reflection.GeneratedProtocolMessageType('VodGetSpaceDetailResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETSPACEDETAILRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetSpaceDetailResponse) }) _sym_db.RegisterMessage(VodGetSpaceDetailResponse) VodUpdateSpaceResponse = _reflection.GeneratedProtocolMessageType('VodUpdateSpaceResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESPACERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateSpaceResponse) }) _sym_db.RegisterMessage(VodUpdateSpaceResponse) VodUpdateSpaceUploadConfigResponse = _reflection.GeneratedProtocolMessageType('VodUpdateSpaceUploadConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATESPACEUPLOADCONFIGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateSpaceUploadConfigResponse) }) _sym_db.RegisterMessage(VodUpdateSpaceUploadConfigResponse) VodDescribeUploadSpaceConfigResponse = _reflection.GeneratedProtocolMessageType('VodDescribeUploadSpaceConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEUPLOADSPACECONFIGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeUploadSpaceConfigResponse) }) _sym_db.RegisterMessage(VodDescribeUploadSpaceConfigResponse) VodUpdateUploadSpaceConfigResponse = _reflection.GeneratedProtocolMessageType('VodUpdateUploadSpaceConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEUPLOADSPACECONFIGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateUploadSpaceConfigResponse) }) _sym_db.RegisterMessage(VodUpdateUploadSpaceConfigResponse) VodDescribeVodSpaceStorageDataResponse = _reflection.GeneratedProtocolMessageType('VodDescribeVodSpaceStorageDataResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODSPACESTORAGEDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeVodSpaceStorageDataResponse) }) _sym_db.RegisterMessage(VodDescribeVodSpaceStorageDataResponse) VodUpdateDomainPlayRuleResponse = _reflection.GeneratedProtocolMessageType('VodUpdateDomainPlayRuleResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINPLAYRULERESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateDomainPlayRuleResponse) }) _sym_db.RegisterMessage(VodUpdateDomainPlayRuleResponse) VodAddDomainToSchedulerResponse = _reflection.GeneratedProtocolMessageType('VodAddDomainToSchedulerResponse', (_message.Message,), { 'DESCRIPTOR' : _VODADDDOMAINTOSCHEDULERRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodAddDomainToSchedulerResponse) }) _sym_db.RegisterMessage(VodAddDomainToSchedulerResponse) VodRemoveDomainFromSchedulerResponse = _reflection.GeneratedProtocolMessageType('VodRemoveDomainFromSchedulerResponse', (_message.Message,), { 'DESCRIPTOR' : _VODREMOVEDOMAINFROMSCHEDULERRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodRemoveDomainFromSchedulerResponse) }) _sym_db.RegisterMessage(VodRemoveDomainFromSchedulerResponse) VodDeleteDomainResponse = _reflection.GeneratedProtocolMessageType('VodDeleteDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteDomainResponse) }) _sym_db.RegisterMessage(VodDeleteDomainResponse) VodStartDomainResponse = _reflection.GeneratedProtocolMessageType('VodStartDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodStartDomainResponse) }) _sym_db.RegisterMessage(VodStartDomainResponse) VodStopDomainResponse = _reflection.GeneratedProtocolMessageType('VodStopDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSTOPDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodStopDomainResponse) }) _sym_db.RegisterMessage(VodStopDomainResponse) VodListDomainResponse = _reflection.GeneratedProtocolMessageType('VodListDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListDomainResponse) }) _sym_db.RegisterMessage(VodListDomainResponse) VodCreateCdnRefreshTaskResponse = _reflection.GeneratedProtocolMessageType('VodCreateCdnRefreshTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATECDNREFRESHTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateCdnRefreshTaskResponse) }) _sym_db.RegisterMessage(VodCreateCdnRefreshTaskResponse) VodCreateCdnPreloadTaskResponse = _reflection.GeneratedProtocolMessageType('VodCreateCdnPreloadTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATECDNPRELOADTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateCdnPreloadTaskResponse) }) _sym_db.RegisterMessage(VodCreateCdnPreloadTaskResponse) VodListCdnTasksResponse = _reflection.GeneratedProtocolMessageType('VodListCdnTasksResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTASKSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListCdnTasksResponse) }) _sym_db.RegisterMessage(VodListCdnTasksResponse) VodListCdnAccessLogResponse = _reflection.GeneratedProtocolMessageType('VodListCdnAccessLogResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNACCESSLOGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListCdnAccessLogResponse) }) _sym_db.RegisterMessage(VodListCdnAccessLogResponse) VodListCdnTopAccessUrlResponse = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessUrlResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSURLRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListCdnTopAccessUrlResponse) }) _sym_db.RegisterMessage(VodListCdnTopAccessUrlResponse) VodListCdnTopAccessResponse = _reflection.GeneratedProtocolMessageType('VodListCdnTopAccessResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTCDNTOPACCESSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListCdnTopAccessResponse) }) _sym_db.RegisterMessage(VodListCdnTopAccessResponse) VodDescribeVodDomainBandwidthDataResponse = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainBandwidthDataResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINBANDWIDTHDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeVodDomainBandwidthDataResponse) }) _sym_db.RegisterMessage(VodDescribeVodDomainBandwidthDataResponse) VodCdnStatisticsCommonResponse = _reflection.GeneratedProtocolMessageType('VodCdnStatisticsCommonResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCDNSTATISTICSCOMMONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCdnStatisticsCommonResponse) }) _sym_db.RegisterMessage(VodCdnStatisticsCommonResponse) VodDescribeIPInfoResponse = _reflection.GeneratedProtocolMessageType('VodDescribeIPInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEIPINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeIPInfoResponse) }) _sym_db.RegisterMessage(VodDescribeIPInfoResponse) VodDescribeVodDomainTrafficDataResponse = _reflection.GeneratedProtocolMessageType('VodDescribeVodDomainTrafficDataResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEVODDOMAINTRAFFICDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeVodDomainTrafficDataResponse) }) _sym_db.RegisterMessage(VodDescribeVodDomainTrafficDataResponse) VodSubmitBlockTasksResponse = _reflection.GeneratedProtocolMessageType('VodSubmitBlockTasksResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKTASKSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitBlockTasksResponse) }) _sym_db.RegisterMessage(VodSubmitBlockTasksResponse) VodGetContentBlockTasksResponse = _reflection.GeneratedProtocolMessageType('VodGetContentBlockTasksResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETCONTENTBLOCKTASKSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetContentBlockTasksResponse) }) _sym_db.RegisterMessage(VodGetContentBlockTasksResponse) VodCreateDomainV2Response = _reflection.GeneratedProtocolMessageType('VodCreateDomainV2Response', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDOMAINV2RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateDomainV2Response) }) _sym_db.RegisterMessage(VodCreateDomainV2Response) VodCreateDomainV3Response = _reflection.GeneratedProtocolMessageType('VodCreateDomainV3Response', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDOMAINV3RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateDomainV3Response) }) _sym_db.RegisterMessage(VodCreateDomainV3Response) VodUpdateDomainExpireV2Response = _reflection.GeneratedProtocolMessageType('VodUpdateDomainExpireV2Response', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINEXPIREV2RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateDomainExpireV2Response) }) _sym_db.RegisterMessage(VodUpdateDomainExpireV2Response) VodUpdateDomainAuthConfigV2Response = _reflection.GeneratedProtocolMessageType('VodUpdateDomainAuthConfigV2Response', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINAUTHCONFIGV2RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateDomainAuthConfigV2Response) }) _sym_db.RegisterMessage(VodUpdateDomainAuthConfigV2Response) VodUpdateDomainUrlAuthConfigV2Response = _reflection.GeneratedProtocolMessageType('VodUpdateDomainUrlAuthConfigV2Response', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINURLAUTHCONFIGV2RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateDomainUrlAuthConfigV2Response) }) _sym_db.RegisterMessage(VodUpdateDomainUrlAuthConfigV2Response) VodVerifyDomainOwnerResponse = _reflection.GeneratedProtocolMessageType('VodVerifyDomainOwnerResponse', (_message.Message,), { 'DESCRIPTOR' : _VODVERIFYDOMAINOWNERRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodVerifyDomainOwnerResponse) }) _sym_db.RegisterMessage(VodVerifyDomainOwnerResponse) VodDescribeDomainVerifyContentResponse = _reflection.GeneratedProtocolMessageType('VodDescribeDomainVerifyContentResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINVERIFYCONTENTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeDomainVerifyContentResponse) }) _sym_db.RegisterMessage(VodDescribeDomainVerifyContentResponse) VodListPCDNDomainResponse = _reflection.GeneratedProtocolMessageType('VodListPCDNDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTPCDNDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListPCDNDomainResponse) }) _sym_db.RegisterMessage(VodListPCDNDomainResponse) VodCreatePCDNDomainResponse = _reflection.GeneratedProtocolMessageType('VodCreatePCDNDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEPCDNDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreatePCDNDomainResponse) }) _sym_db.RegisterMessage(VodCreatePCDNDomainResponse) VodStartPCDNDomainResponse = _reflection.GeneratedProtocolMessageType('VodStartPCDNDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSTARTPCDNDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodStartPCDNDomainResponse) }) _sym_db.RegisterMessage(VodStartPCDNDomainResponse) VodStopPCDNDomainResponse = _reflection.GeneratedProtocolMessageType('VodStopPCDNDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSTOPPCDNDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodStopPCDNDomainResponse) }) _sym_db.RegisterMessage(VodStopPCDNDomainResponse) VodDeletePCDNDomainResponse = _reflection.GeneratedProtocolMessageType('VodDeletePCDNDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEPCDNDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeletePCDNDomainResponse) }) _sym_db.RegisterMessage(VodDeletePCDNDomainResponse) VodUpdateDomainConfigResponse = _reflection.GeneratedProtocolMessageType('VodUpdateDomainConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _VODUPDATEDOMAINCONFIGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodUpdateDomainConfigResponse) }) _sym_db.RegisterMessage(VodUpdateDomainConfigResponse) VodDescribeDomainConfigResponse = _reflection.GeneratedProtocolMessageType('VodDescribeDomainConfigResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBEDOMAINCONFIGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeDomainConfigResponse) }) _sym_db.RegisterMessage(VodDescribeDomainConfigResponse) VodDescribeCdnEdgeIpResponse = _reflection.GeneratedProtocolMessageType('VodDescribeCdnEdgeIpResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNEDGEIPRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeCdnEdgeIpResponse) }) _sym_db.RegisterMessage(VodDescribeCdnEdgeIpResponse) VodDescribeCdnRegionAndIspResponse = _reflection.GeneratedProtocolMessageType('VodDescribeCdnRegionAndIspResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDESCRIBECDNREGIONANDISPRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDescribeCdnRegionAndIspResponse) }) _sym_db.RegisterMessage(VodDescribeCdnRegionAndIspResponse) AddOrUpdateCertificateV2Response = _reflection.GeneratedProtocolMessageType('AddOrUpdateCertificateV2Response', (_message.Message,), { 'DESCRIPTOR' : _ADDORUPDATECERTIFICATEV2RESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.AddOrUpdateCertificateV2Response) }) _sym_db.RegisterMessage(AddOrUpdateCertificateV2Response) UpdateDomainAreaResponse = _reflection.GeneratedProtocolMessageType('UpdateDomainAreaResponse', (_message.Message,), { 'DESCRIPTOR' : _UPDATEDOMAINAREARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.UpdateDomainAreaResponse) }) _sym_db.RegisterMessage(UpdateDomainAreaResponse) VodAddCallbackSubscriptionResponse = _reflection.GeneratedProtocolMessageType('VodAddCallbackSubscriptionResponse', (_message.Message,), { 'DESCRIPTOR' : _VODADDCALLBACKSUBSCRIPTIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodAddCallbackSubscriptionResponse) }) _sym_db.RegisterMessage(VodAddCallbackSubscriptionResponse) VodSetCallbackEventResponse = _reflection.GeneratedProtocolMessageType('VodSetCallbackEventResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSETCALLBACKEVENTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSetCallbackEventResponse) }) _sym_db.RegisterMessage(VodSetCallbackEventResponse) GetCallbackRecordResponse = _reflection.GeneratedProtocolMessageType('GetCallbackRecordResponse', (_message.Message,), { 'DESCRIPTOR' : _GETCALLBACKRECORDRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.GetCallbackRecordResponse) }) _sym_db.RegisterMessage(GetCallbackRecordResponse) VodGetSmartStrategyLitePlayInfoResponse = _reflection.GeneratedProtocolMessageType('VodGetSmartStrategyLitePlayInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETSMARTSTRATEGYLITEPLAYINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetSmartStrategyLitePlayInfoResponse) }) _sym_db.RegisterMessage(VodGetSmartStrategyLitePlayInfoResponse) VodGetAppInfoResponse = _reflection.GeneratedProtocolMessageType('VodGetAppInfoResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETAPPINFORESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetAppInfoResponse) }) _sym_db.RegisterMessage(VodGetAppInfoResponse) DescribeVodSpaceTranscodeDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceTranscodeDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACETRANSCODEDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceTranscodeDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceTranscodeDataResponse) DescribeVodSpaceAIStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceAIStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEAISTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceAIStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceAIStatisDataResponse) DescribeVodSpaceSubtitleStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceSubtitleStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACESUBTITLESTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceSubtitleStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceSubtitleStatisDataResponse) DescribeVodSpaceDetectStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceDetectStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEDETECTSTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceDetectStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceDetectStatisDataResponse) DescribeVodSnapshotDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSnapshotDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSNAPSHOTDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSnapshotDataResponse) }) _sym_db.RegisterMessage(DescribeVodSnapshotDataResponse) DescribeVodSpaceWorkflowDetailDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceWorkflowDetailDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEWORKFLOWDETAILDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceWorkflowDetailDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceWorkflowDetailDataResponse) DescribeVodSpaceEditDetailDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditDetailDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITDETAILDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceEditDetailDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceEditDetailDataResponse) DescribeVodRealtimeMediaDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodRealtimeMediaDataResponse) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDataResponse) DescribeVodRealtimeMediaDetailDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodRealtimeMediaDetailDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODREALTIMEMEDIADETAILDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodRealtimeMediaDetailDataResponse) }) _sym_db.RegisterMessage(DescribeVodRealtimeMediaDetailDataResponse) DescribeVodPlayFileLogByDomainResponse = _reflection.GeneratedProtocolMessageType('DescribeVodPlayFileLogByDomainResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYFILELOGBYDOMAINRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodPlayFileLogByDomainResponse) }) _sym_db.RegisterMessage(DescribeVodPlayFileLogByDomainResponse) DescribeVodEnhanceImageDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodEnhanceImageDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODENHANCEIMAGEDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodEnhanceImageDataResponse) }) _sym_db.RegisterMessage(DescribeVodEnhanceImageDataResponse) DescribeVodSpaceEditStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodSpaceEditStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODSPACEEDITSTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodSpaceEditStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodSpaceEditStatisDataResponse) DescribeVodPlayedStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodPlayedStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODPLAYEDSTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodPlayedStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodPlayedStatisDataResponse) DescribeVodMostPlayedStatisDataResponse = _reflection.GeneratedProtocolMessageType('DescribeVodMostPlayedStatisDataResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODMOSTPLAYEDSTATISDATARESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodMostPlayedStatisDataResponse) }) _sym_db.RegisterMessage(DescribeVodMostPlayedStatisDataResponse) DescribeVodVidTrafficFileLogResponse = _reflection.GeneratedProtocolMessageType('DescribeVodVidTrafficFileLogResponse', (_message.Message,), { 'DESCRIPTOR' : _DESCRIBEVODVIDTRAFFICFILELOGRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.DescribeVodVidTrafficFileLogResponse) }) _sym_db.RegisterMessage(DescribeVodVidTrafficFileLogResponse) VodSubmitBlockMediaTaskResponse = _reflection.GeneratedProtocolMessageType('VodSubmitBlockMediaTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITBLOCKMEDIATASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitBlockMediaTaskResponse) }) _sym_db.RegisterMessage(VodSubmitBlockMediaTaskResponse) VodSubmitUnblockMediaTaskResponse = _reflection.GeneratedProtocolMessageType('VodSubmitUnblockMediaTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITUNBLOCKMEDIATASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitUnblockMediaTaskResponse) }) _sym_db.RegisterMessage(VodSubmitUnblockMediaTaskResponse) VodQueryMediaBlockStatusResponse = _reflection.GeneratedProtocolMessageType('VodQueryMediaBlockStatusResponse', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYMEDIABLOCKSTATUSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodQueryMediaBlockStatusResponse) }) _sym_db.RegisterMessage(VodQueryMediaBlockStatusResponse) VodListProjectsResponse = _reflection.GeneratedProtocolMessageType('VodListProjectsResponse', (_message.Message,), { 'DESCRIPTOR' : _VODLISTPROJECTSRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodListProjectsResponse) }) _sym_db.RegisterMessage(VodListProjectsResponse) VodGetTradeConfigurationResponse = _reflection.GeneratedProtocolMessageType('VodGetTradeConfigurationResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETTRADECONFIGURATIONRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetTradeConfigurationResponse) }) _sym_db.RegisterMessage(VodGetTradeConfigurationResponse) VodSetCloudMigrateJobResponse = _reflection.GeneratedProtocolMessageType('VodSetCloudMigrateJobResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSETCLOUDMIGRATEJOBRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSetCloudMigrateJobResponse) }) _sym_db.RegisterMessage(VodSetCloudMigrateJobResponse) VodSubmitCloudMigrateJobResponse = _reflection.GeneratedProtocolMessageType('VodSubmitCloudMigrateJobResponse', (_message.Message,), { 'DESCRIPTOR' : _VODSUBMITCLOUDMIGRATEJOBRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodSubmitCloudMigrateJobResponse) }) _sym_db.RegisterMessage(VodSubmitCloudMigrateJobResponse) VodGetCloudMigrateJobResponse = _reflection.GeneratedProtocolMessageType('VodGetCloudMigrateJobResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETCLOUDMIGRATEJOBRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetCloudMigrateJobResponse) }) _sym_db.RegisterMessage(VodGetCloudMigrateJobResponse) VodReportEventResponse = _reflection.GeneratedProtocolMessageType('VodReportEventResponse', (_message.Message,), { 'DESCRIPTOR' : _VODREPORTEVENTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodReportEventResponse) }) _sym_db.RegisterMessage(VodReportEventResponse) VodCreateDramaRecapTaskResponse = _reflection.GeneratedProtocolMessageType('VodCreateDramaRecapTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMARECAPTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateDramaRecapTaskResponse) }) _sym_db.RegisterMessage(VodCreateDramaRecapTaskResponse) VodCreateDramaScriptTaskResponse = _reflection.GeneratedProtocolMessageType('VodCreateDramaScriptTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODCREATEDRAMASCRIPTTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodCreateDramaScriptTaskResponse) }) _sym_db.RegisterMessage(VodCreateDramaScriptTaskResponse) VodQueryDramaRecapTaskResponse = _reflection.GeneratedProtocolMessageType('VodQueryDramaRecapTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMARECAPTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodQueryDramaRecapTaskResponse) }) _sym_db.RegisterMessage(VodQueryDramaRecapTaskResponse) VodQueryDramaScriptTaskResponse = _reflection.GeneratedProtocolMessageType('VodQueryDramaScriptTaskResponse', (_message.Message,), { 'DESCRIPTOR' : _VODQUERYDRAMASCRIPTTASKRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodQueryDramaScriptTaskResponse) }) _sym_db.RegisterMessage(VodQueryDramaScriptTaskResponse) VodGetMediaEntityListResponse = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityListResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYLISTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMediaEntityListResponse) }) _sym_db.RegisterMessage(VodGetMediaEntityListResponse) VodGetMediaEntityResponse = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMediaEntityResponse) }) _sym_db.RegisterMessage(VodGetMediaEntityResponse) VodDeleteMediaEntityResponse = _reflection.GeneratedProtocolMessageType('VodDeleteMediaEntityResponse', (_message.Message,), { 'DESCRIPTOR' : _VODDELETEMEDIAENTITYRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodDeleteMediaEntityResponse) }) _sym_db.RegisterMessage(VodDeleteMediaEntityResponse) VodGetMediaEntityConfigListResponse = _reflection.GeneratedProtocolMessageType('VodGetMediaEntityConfigListResponse', (_message.Message,), { 'DESCRIPTOR' : _VODGETMEDIAENTITYCONFIGLISTRESPONSE, '__module__' : 'volcengine.vod.response.response_vod_pb2' # @@protoc_insertion_point(class_scope:Volcengine.Vod.Models.Response.VodGetMediaEntityConfigListResponse) }) _sym_db.RegisterMessage(VodGetMediaEntityConfigListResponse) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n)com.volcengine.service.vod.model.responseB\013VodResponseP\001ZAgithub.com/volcengine/volc-sdk-golang/service/vod/models/response\240\001\001\330\001\001\312\002 Volc\\Service\\Vod\\Models\\Response\342\002#Volc\\Service\\Vod\\Models\\GPBMetadata' _VODGETALLPLAYINFORESPONSE._serialized_start=874 _VODGETALLPLAYINFORESPONSE._serialized_end=1044 _VODGETPLAYINFORESPONSE._serialized_start=1047 _VODGETPLAYINFORESPONSE._serialized_end=1210 _VODGETORIGINALPLAYINFORESPONSE._serialized_start=1213 _VODGETORIGINALPLAYINFORESPONSE._serialized_end=1396 _VODGETPRIVATEDRMPLAYAUTHRESPONSE._serialized_start=1399 _VODGETPRIVATEDRMPLAYAUTHRESPONSE._serialized_end=1586 _VODGETHLSDECRYPTIONKEYRESPONSE._serialized_start=1589 _VODGETHLSDECRYPTIONKEYRESPONSE._serialized_end=1772 _VODCREATEHLSDECRYPTIONKEYRESPONSE._serialized_start=1775 _VODCREATEHLSDECRYPTIONKEYRESPONSE._serialized_end=1964 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESPONSE._serialized_start=1967 _VODGETPLAYINFOWITHLIVETIMESHIFTSCENERESPONSE._serialized_end=2178 _VODDESCRIBEDRMDATAKEYRESPONSE._serialized_start=2181 _VODDESCRIBEDRMDATAKEYRESPONSE._serialized_end=2362 _VODSUBMITMOVEOBJECTTASKRESPONSE._serialized_start=2365 _VODSUBMITMOVEOBJECTTASKRESPONSE._serialized_end=2552 _VODQUERYMOVEOBJECTTASKINFORESPONSE._serialized_start=2555 _VODQUERYMOVEOBJECTTASKINFORESPONSE._serialized_end=2747 _VODSUBMITBLOCKOBJECTTASKSRESPONSE._serialized_start=2750 _VODSUBMITBLOCKOBJECTTASKSRESPONSE._serialized_end=2939 _VODLISTBLOCKOBJECTTASKSRESPONSE._serialized_start=2942 _VODLISTBLOCKOBJECTTASKSRESPONSE._serialized_end=3127 _VODUPLOADMEDIARESPONSE._serialized_start=3130 _VODUPLOADMEDIARESPONSE._serialized_end=3290 _VODQUERYUPLOADTASKINFORESPONSE._serialized_start=3293 _VODQUERYUPLOADTASKINFORESPONSE._serialized_end=3460 _VODURLUPLOADRESPONSE._serialized_start=3463 _VODURLUPLOADRESPONSE._serialized_end=3626 _VODAPPLYUPLOADINFORESPONSE._serialized_start=3629 _VODAPPLYUPLOADINFORESPONSE._serialized_end=3804 _VODCOMMITUPLOADINFORESPONSE._serialized_start=3807 _VODCOMMITUPLOADINFORESPONSE._serialized_end=3984 _VODPARSEUPLOADMANIFESTRESPONSE._serialized_start=3987 _VODPARSEUPLOADMANIFESTRESPONSE._serialized_end=4170 _VODLISTFILEMETAINFOSBYFILENAMESRESPONSE._serialized_start=4173 _VODLISTFILEMETAINFOSBYFILENAMESRESPONSE._serialized_end=4374 _VODGETMEDIAINFOSRESPONSE._serialized_start=4377 _VODGETMEDIAINFOSRESPONSE._serialized_end=4546 _VODUPDATEMEDIAINFORESPONSE._serialized_start=4548 _VODUPDATEMEDIAINFORESPONSE._serialized_end=4649 _VODGETRECOMMENDEDPOSTERRESPONSE._serialized_start=4652 _VODGETRECOMMENDEDPOSTERRESPONSE._serialized_end=4827 _VODUPDATEMEDIAPUBLISHSTATUSRESPONSE._serialized_start=4829 _VODUPDATEMEDIAPUBLISHSTATUSRESPONSE._serialized_end=4939 _VODUPDATEMEDIASTORAGECLASSRESPONSE._serialized_start=4942 _VODUPDATEMEDIASTORAGECLASSRESPONSE._serialized_end=5131 _VODDELETEMEDIARESPONSE._serialized_start=5134 _VODDELETEMEDIARESPONSE._serialized_end=5299 _VODDELETEMATERIALRESPONSE._serialized_start=5301 _VODDELETEMATERIALRESPONSE._serialized_end=5401 _VODDELETETRANSCODESRESPONSE._serialized_start=5404 _VODDELETETRANSCODESRESPONSE._serialized_end=5579 _VODDELETEMEDIATOSFILERESPONSE._serialized_start=5582 _VODDELETEMEDIATOSFILERESPONSE._serialized_end=5761 _VODGETMEDIALISTRESPONSE._serialized_start=5764 _VODGETMEDIALISTRESPONSE._serialized_end=5931 _VODGETSUBTITLEINFOLISTRESPONSE._serialized_start=5934 _VODGETSUBTITLEINFOLISTRESPONSE._serialized_end=6115 _VODUPDATESUBTITLESTATUSRESPONSE._serialized_start=6118 _VODUPDATESUBTITLESTATUSRESPONSE._serialized_end=6301 _VODUPDATESUBTITLEINFORESPONSE._serialized_start=6303 _VODUPDATESUBTITLEINFORESPONSE._serialized_end=6407 _VODGETAUDITFRAMESFORAUDITRESPONSE._serialized_start=6410 _VODGETAUDITFRAMESFORAUDITRESPONSE._serialized_end=6594 _VODGETMLFRAMESFORAUDITRESPONSE._serialized_start=6597 _VODGETMLFRAMESFORAUDITRESPONSE._serialized_end=6778 _VODGETBETTERFRAMESFORAUDITRESPONSE._serialized_start=6781 _VODGETBETTERFRAMESFORAUDITRESPONSE._serialized_end=6972 _VODGETAUDIOINFOFORAUDITRESPONSE._serialized_start=6975 _VODGETAUDIOINFOFORAUDITRESPONSE._serialized_end=7160 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESPONSE._serialized_start=7163 _VODGETAUTOMATICSPEECHRECOGNITIONFORAUDITRESPONSE._serialized_end=7382 _VODGETAUDIOEVENTDETECTIONFORAUDITRESPONSE._serialized_start=7385 _VODGETAUDIOEVENTDETECTIONFORAUDITRESPONSE._serialized_end=7590 _VODCREATEVIDEOCLASSIFICATIONRESPONSE._serialized_start=7593 _VODCREATEVIDEOCLASSIFICATIONRESPONSE._serialized_end=7786 _VODUPDATEVIDEOCLASSIFICATIONRESPONSE._serialized_start=7788 _VODUPDATEVIDEOCLASSIFICATIONRESPONSE._serialized_end=7899 _VODDELETEVIDEOCLASSIFICATIONRESPONSE._serialized_start=7901 _VODDELETEVIDEOCLASSIFICATIONRESPONSE._serialized_end=8012 _VODLISTVIDEOCLASSIFICATIONSRESPONSE._serialized_start=8015 _VODLISTVIDEOCLASSIFICATIONSRESPONSE._serialized_end=8202 _VODLISTSNAPSHOTSRESPONSE._serialized_start=8205 _VODLISTSNAPSHOTSRESPONSE._serialized_end=8369 _VODGETFILELISTRESPONSE._serialized_start=8372 _VODGETFILELISTRESPONSE._serialized_end=8539 _VODGETFILEINFOSRESPONSE._serialized_start=8542 _VODGETFILEINFOSRESPONSE._serialized_end=8709 _VODUPDATEFILESTORAGECLASSRESPONSE._serialized_start=8712 _VODUPDATEFILESTORAGECLASSRESPONSE._serialized_end=8899 _VODGETINNERAUDITURLSRESPONSE._serialized_start=8902 _VODGETINNERAUDITURLSRESPONSE._serialized_end=9079 _VODGETADAUDITRESULTBYVIDRESPONSE._serialized_start=9082 _VODGETADAUDITRESULTBYVIDRESPONSE._serialized_end=9267 _VODEXTRACTMEDIAMETATASKRESPONSE._serialized_start=9269 _VODEXTRACTMEDIAMETATASKRESPONSE._serialized_end=9375 _VODSTARTWORKFLOWRESPONSE._serialized_start=9378 _VODSTARTWORKFLOWRESPONSE._serialized_end=9549 _VODRETRIEVETRANSCODERESULTRESPONSE._serialized_start=9552 _VODRETRIEVETRANSCODERESULTRESPONSE._serialized_end=9726 _VODLISTWORKFLOWEXECUTIONRESPONSE._serialized_start=9729 _VODLISTWORKFLOWEXECUTIONRESPONSE._serialized_end=9916 _VODGETWORKFLOWEXECUTIONDETAILRESPONSE._serialized_start=9919 _VODGETWORKFLOWEXECUTIONDETAILRESPONSE._serialized_end=10116 _VODGETWORKFLOWEXECUTIONSTATUSRESPONSE._serialized_start=10119 _VODGETWORKFLOWEXECUTIONSTATUSRESPONSE._serialized_end=10298 _VODGETWORKFLOWRESULTRESPONSE._serialized_start=10301 _VODGETWORKFLOWRESULTRESPONSE._serialized_end=10471 _VODCREATETASKTEMPLATERESPONSE._serialized_start=10474 _VODCREATETASKTEMPLATERESPONSE._serialized_end=10649 _VODUPDATETASKTEMPLATERESPONSE._serialized_start=10652 _VODUPDATETASKTEMPLATERESPONSE._serialized_end=10827 _VODDELETETASKTEMPLATERESPONSE._serialized_start=10830 _VODDELETETASKTEMPLATERESPONSE._serialized_end=11005 _VODGETTASKTEMPLATERESPONSE._serialized_start=11008 _VODGETTASKTEMPLATERESPONSE._serialized_end=11180 _VODLISTTASKTEMPLATERESPONSE._serialized_start=11183 _VODLISTTASKTEMPLATERESPONSE._serialized_end=11360 _VODCREATEWORKFLOWTEMPLATERESPONSE._serialized_start=11363 _VODCREATEWORKFLOWTEMPLATERESPONSE._serialized_end=11546 _VODUPDATEWORKFLOWTEMPLATERESPONSE._serialized_start=11548 _VODUPDATEWORKFLOWTEMPLATERESPONSE._serialized_end=11656 _VODDELETEWORKFLOWTEMPLATERESPONSE._serialized_start=11658 _VODDELETEWORKFLOWTEMPLATERESPONSE._serialized_end=11766 _VODGETWORKFLOWTEMPLATERESPONSE._serialized_start=11769 _VODGETWORKFLOWTEMPLATERESPONSE._serialized_end=11949 _VODLISTWORKFLOWTEMPLATERESPONSE._serialized_start=11952 _VODLISTWORKFLOWTEMPLATERESPONSE._serialized_end=12137 _VODCREATEWATERMARKRESPONSE._serialized_start=12140 _VODCREATEWATERMARKRESPONSE._serialized_end=12303 _VODUPDATEWATERMARKRESPONSE._serialized_start=12305 _VODUPDATEWATERMARKRESPONSE._serialized_end=12406 _VODDELETEWATERMARKRESPONSE._serialized_start=12408 _VODDELETEWATERMARKRESPONSE._serialized_end=12509 _VODGETWATERMARKRESPONSE._serialized_start=12512 _VODGETWATERMARKRESPONSE._serialized_end=12672 _VODLISTWATERMARKRESPONSE._serialized_start=12675 _VODLISTWATERMARKRESPONSE._serialized_end=12854 _VODSUBMITDIRECTEDITTASKASYNCRESPONSE._serialized_start=12857 _VODSUBMITDIRECTEDITTASKASYNCRESPONSE._serialized_end=13049 _VODSUBMITDIRECTEDITTASKSYNCRESPONSE._serialized_start=13052 _VODSUBMITDIRECTEDITTASKSYNCRESPONSE._serialized_end=13242 _VODGETDIRECTEDITPROGRESSRESPONSE._serialized_start=13245 _VODGETDIRECTEDITPROGRESSRESPONSE._serialized_end=13423 _VODGETDIRECTEDITRESULTRESPONSE._serialized_start=13426 _VODGETDIRECTEDITRESULTRESPONSE._serialized_end=13600 _VODCANCELDIRECTEDITTASKRESPONSE._serialized_start=13603 _VODCANCELDIRECTEDITTASKRESPONSE._serialized_end=13779 _VODASYNCVCREATIVETASKRESPONSE._serialized_start=13782 _VODASYNCVCREATIVETASKRESPONSE._serialized_end=13960 _VODGETVCREATIVETASKRESULTRESPONSE._serialized_start=13963 _VODGETVCREATIVETASKRESULTRESPONSE._serialized_end=14143 _VODCREATESPACERESPONSE._serialized_start=14145 _VODCREATESPACERESPONSE._serialized_end=14242 _VODDELETESPACERESPONSE._serialized_start=14244 _VODDELETESPACERESPONSE._serialized_end=14341 _VODLISTSPACERESPONSE._serialized_start=14344 _VODLISTSPACERESPONSE._serialized_end=14501 _VODGETSPACEDETAILRESPONSE._serialized_start=14504 _VODGETSPACEDETAILRESPONSE._serialized_end=14666 _VODUPDATESPACERESPONSE._serialized_start=14668 _VODUPDATESPACERESPONSE._serialized_end=14765 _VODUPDATESPACEUPLOADCONFIGRESPONSE._serialized_start=14767 _VODUPDATESPACEUPLOADCONFIGRESPONSE._serialized_end=14876 _VODDESCRIBEUPLOADSPACECONFIGRESPONSE._serialized_start=14879 _VODDESCRIBEUPLOADSPACECONFIGRESPONSE._serialized_end=15060 _VODUPDATEUPLOADSPACECONFIGRESPONSE._serialized_start=15062 _VODUPDATEUPLOADSPACECONFIGRESPONSE._serialized_end=15171 _VODDESCRIBEVODSPACESTORAGEDATARESPONSE._serialized_start=15174 _VODDESCRIBEVODSPACESTORAGEDATARESPONSE._serialized_end=15373 _VODUPDATEDOMAINPLAYRULERESPONSE._serialized_start=15375 _VODUPDATEDOMAINPLAYRULERESPONSE._serialized_end=15481 _VODADDDOMAINTOSCHEDULERRESPONSE._serialized_start=15483 _VODADDDOMAINTOSCHEDULERRESPONSE._serialized_end=15589 _VODREMOVEDOMAINFROMSCHEDULERRESPONSE._serialized_start=15591 _VODREMOVEDOMAINFROMSCHEDULERRESPONSE._serialized_end=15702 _VODDELETEDOMAINRESPONSE._serialized_start=15704 _VODDELETEDOMAINRESPONSE._serialized_end=15802 _VODSTARTDOMAINRESPONSE._serialized_start=15804 _VODSTARTDOMAINRESPONSE._serialized_end=15901 _VODSTOPDOMAINRESPONSE._serialized_start=15903 _VODSTOPDOMAINRESPONSE._serialized_end=15999 _VODLISTDOMAINRESPONSE._serialized_start=16002 _VODLISTDOMAINRESPONSE._serialized_end=16167 _VODCREATECDNREFRESHTASKRESPONSE._serialized_start=16170 _VODCREATECDNREFRESHTASKRESPONSE._serialized_end=16348 _VODCREATECDNPRELOADTASKRESPONSE._serialized_start=16351 _VODCREATECDNPRELOADTASKRESPONSE._serialized_end=16529 _VODLISTCDNTASKSRESPONSE._serialized_start=16532 _VODLISTCDNTASKSRESPONSE._serialized_end=16696 _VODLISTCDNACCESSLOGRESPONSE._serialized_start=16699 _VODLISTCDNACCESSLOGRESPONSE._serialized_end=16876 _VODLISTCDNTOPACCESSURLRESPONSE._serialized_start=16879 _VODLISTCDNTOPACCESSURLRESPONSE._serialized_end=17062 _VODLISTCDNTOPACCESSRESPONSE._serialized_start=17065 _VODLISTCDNTOPACCESSRESPONSE._serialized_end=17242 _VODDESCRIBEVODDOMAINBANDWIDTHDATARESPONSE._serialized_start=17245 _VODDESCRIBEVODDOMAINBANDWIDTHDATARESPONSE._serialized_end=17450 _VODCDNSTATISTICSCOMMONRESPONSE._serialized_start=17453 _VODCDNSTATISTICSCOMMONRESPONSE._serialized_end=17636 _VODDESCRIBEIPINFORESPONSE._serialized_start=17639 _VODDESCRIBEIPINFORESPONSE._serialized_end=17801 _VODDESCRIBEVODDOMAINTRAFFICDATARESPONSE._serialized_start=17804 _VODDESCRIBEVODDOMAINTRAFFICDATARESPONSE._serialized_end=18005 _VODSUBMITBLOCKTASKSRESPONSE._serialized_start=18008 _VODSUBMITBLOCKTASKSRESPONSE._serialized_end=18185 _VODGETCONTENTBLOCKTASKSRESPONSE._serialized_start=18188 _VODGETCONTENTBLOCKTASKSRESPONSE._serialized_end=18373 _VODCREATEDOMAINV2RESPONSE._serialized_start=18375 _VODCREATEDOMAINV2RESPONSE._serialized_end=18475 _VODCREATEDOMAINV3RESPONSE._serialized_start=18477 _VODCREATEDOMAINV3RESPONSE._serialized_end=18577 _VODUPDATEDOMAINEXPIREV2RESPONSE._serialized_start=18579 _VODUPDATEDOMAINEXPIREV2RESPONSE._serialized_end=18685 _VODUPDATEDOMAINAUTHCONFIGV2RESPONSE._serialized_start=18687 _VODUPDATEDOMAINAUTHCONFIGV2RESPONSE._serialized_end=18797 _VODUPDATEDOMAINURLAUTHCONFIGV2RESPONSE._serialized_start=18799 _VODUPDATEDOMAINURLAUTHCONFIGV2RESPONSE._serialized_end=18912 _VODVERIFYDOMAINOWNERRESPONSE._serialized_start=18915 _VODVERIFYDOMAINOWNERRESPONSE._serialized_end=19094 _VODDESCRIBEDOMAINVERIFYCONTENTRESPONSE._serialized_start=19097 _VODDESCRIBEDOMAINVERIFYCONTENTRESPONSE._serialized_end=19296 _VODLISTPCDNDOMAINRESPONSE._serialized_start=19299 _VODLISTPCDNDOMAINRESPONSE._serialized_end=19472 _VODCREATEPCDNDOMAINRESPONSE._serialized_start=19474 _VODCREATEPCDNDOMAINRESPONSE._serialized_end=19576 _VODSTARTPCDNDOMAINRESPONSE._serialized_start=19578 _VODSTARTPCDNDOMAINRESPONSE._serialized_end=19679 _VODSTOPPCDNDOMAINRESPONSE._serialized_start=19681 _VODSTOPPCDNDOMAINRESPONSE._serialized_end=19781 _VODDELETEPCDNDOMAINRESPONSE._serialized_start=19783 _VODDELETEPCDNDOMAINRESPONSE._serialized_end=19885 _VODUPDATEDOMAINCONFIGRESPONSE._serialized_start=19887 _VODUPDATEDOMAINCONFIGRESPONSE._serialized_end=19991 _VODDESCRIBEDOMAINCONFIGRESPONSE._serialized_start=19994 _VODDESCRIBEDOMAINCONFIGRESPONSE._serialized_end=20179 _VODDESCRIBECDNEDGEIPRESPONSE._serialized_start=20182 _VODDESCRIBECDNEDGEIPRESPONSE._serialized_end=20361 _VODDESCRIBECDNREGIONANDISPRESPONSE._serialized_start=20364 _VODDESCRIBECDNREGIONANDISPRESPONSE._serialized_end=20555 _ADDORUPDATECERTIFICATEV2RESPONSE._serialized_start=20557 _ADDORUPDATECERTIFICATEV2RESPONSE._serialized_end=20664 _UPDATEDOMAINAREARESPONSE._serialized_start=20666 _UPDATEDOMAINAREARESPONSE._serialized_end=20765 _VODADDCALLBACKSUBSCRIPTIONRESPONSE._serialized_start=20767 _VODADDCALLBACKSUBSCRIPTIONRESPONSE._serialized_end=20876 _VODSETCALLBACKEVENTRESPONSE._serialized_start=20878 _VODSETCALLBACKEVENTRESPONSE._serialized_end=20980 _GETCALLBACKRECORDRESPONSE._serialized_start=20983 _GETCALLBACKRECORDRESPONSE._serialized_end=21148 _VODGETSMARTSTRATEGYLITEPLAYINFORESPONSE._serialized_start=21151 _VODGETSMARTSTRATEGYLITEPLAYINFORESPONSE._serialized_end=21352 _VODGETAPPINFORESPONSE._serialized_start=21355 _VODGETAPPINFORESPONSE._serialized_end=21520 _DESCRIBEVODSPACETRANSCODEDATARESPONSE._serialized_start=21523 _DESCRIBEVODSPACETRANSCODEDATARESPONSE._serialized_end=21720 _DESCRIBEVODSPACEAISTATISDATARESPONSE._serialized_start=21723 _DESCRIBEVODSPACEAISTATISDATARESPONSE._serialized_end=21918 _DESCRIBEVODSPACESUBTITLESTATISDATARESPONSE._serialized_start=21921 _DESCRIBEVODSPACESUBTITLESTATISDATARESPONSE._serialized_end=22128 _DESCRIBEVODSPACEDETECTSTATISDATARESPONSE._serialized_start=22131 _DESCRIBEVODSPACEDETECTSTATISDATARESPONSE._serialized_end=22334 _DESCRIBEVODSNAPSHOTDATARESPONSE._serialized_start=22337 _DESCRIBEVODSNAPSHOTDATARESPONSE._serialized_end=22522 _DESCRIBEVODSPACEWORKFLOWDETAILDATARESPONSE._serialized_start=22525 _DESCRIBEVODSPACEWORKFLOWDETAILDATARESPONSE._serialized_end=22732 _DESCRIBEVODSPACEEDITDETAILDATARESPONSE._serialized_start=22735 _DESCRIBEVODSPACEEDITDETAILDATARESPONSE._serialized_end=22934 _DESCRIBEVODREALTIMEMEDIADATARESPONSE._serialized_start=22937 _DESCRIBEVODREALTIMEMEDIADATARESPONSE._serialized_end=23132 _DESCRIBEVODREALTIMEMEDIADETAILDATARESPONSE._serialized_start=23135 _DESCRIBEVODREALTIMEMEDIADETAILDATARESPONSE._serialized_end=23342 _DESCRIBEVODPLAYFILELOGBYDOMAINRESPONSE._serialized_start=23345 _DESCRIBEVODPLAYFILELOGBYDOMAINRESPONSE._serialized_end=23544 _DESCRIBEVODENHANCEIMAGEDATARESPONSE._serialized_start=23547 _DESCRIBEVODENHANCEIMAGEDATARESPONSE._serialized_end=23740 _DESCRIBEVODSPACEEDITSTATISDATARESPONSE._serialized_start=23743 _DESCRIBEVODSPACEEDITSTATISDATARESPONSE._serialized_end=23942 _DESCRIBEVODPLAYEDSTATISDATARESPONSE._serialized_start=23945 _DESCRIBEVODPLAYEDSTATISDATARESPONSE._serialized_end=24138 _DESCRIBEVODMOSTPLAYEDSTATISDATARESPONSE._serialized_start=24141 _DESCRIBEVODMOSTPLAYEDSTATISDATARESPONSE._serialized_end=24342 _DESCRIBEVODVIDTRAFFICFILELOGRESPONSE._serialized_start=24345 _DESCRIBEVODVIDTRAFFICFILELOGRESPONSE._serialized_end=24540 _VODSUBMITBLOCKMEDIATASKRESPONSE._serialized_start=24543 _VODSUBMITBLOCKMEDIATASKRESPONSE._serialized_end=24728 _VODSUBMITUNBLOCKMEDIATASKRESPONSE._serialized_start=24731 _VODSUBMITUNBLOCKMEDIATASKRESPONSE._serialized_end=24920 _VODQUERYMEDIABLOCKSTATUSRESPONSE._serialized_start=24923 _VODQUERYMEDIABLOCKSTATUSRESPONSE._serialized_end=25110 _VODLISTPROJECTSRESPONSE._serialized_start=25113 _VODLISTPROJECTSRESPONSE._serialized_end=25282 _VODGETTRADECONFIGURATIONRESPONSE._serialized_start=25285 _VODGETTRADECONFIGURATIONRESPONSE._serialized_end=25470 _VODSETCLOUDMIGRATEJOBRESPONSE._serialized_start=25473 _VODSETCLOUDMIGRATEJOBRESPONSE._serialized_end=25654 _VODSUBMITCLOUDMIGRATEJOBRESPONSE._serialized_start=25656 _VODSUBMITCLOUDMIGRATEJOBRESPONSE._serialized_end=25763 _VODGETCLOUDMIGRATEJOBRESPONSE._serialized_start=25766 _VODGETCLOUDMIGRATEJOBRESPONSE._serialized_end=25947 _VODREPORTEVENTRESPONSE._serialized_start=25950 _VODREPORTEVENTRESPONSE._serialized_end=26117 _VODCREATEDRAMARECAPTASKRESPONSE._serialized_start=26120 _VODCREATEDRAMARECAPTASKRESPONSE._serialized_end=26305 _VODCREATEDRAMASCRIPTTASKRESPONSE._serialized_start=26308 _VODCREATEDRAMASCRIPTTASKRESPONSE._serialized_end=26495 _VODQUERYDRAMARECAPTASKRESPONSE._serialized_start=26498 _VODQUERYDRAMARECAPTASKRESPONSE._serialized_end=26681 _VODQUERYDRAMASCRIPTTASKRESPONSE._serialized_start=26684 _VODQUERYDRAMASCRIPTTASKRESPONSE._serialized_end=26869 _VODGETMEDIAENTITYLISTRESPONSE._serialized_start=26872 _VODGETMEDIAENTITYLISTRESPONSE._serialized_end=27053 _VODGETMEDIAENTITYRESPONSE._serialized_start=27056 _VODGETMEDIAENTITYRESPONSE._serialized_end=27229 _VODDELETEMEDIAENTITYRESPONSE._serialized_start=27231 _VODDELETEMEDIAENTITYRESPONSE._serialized_end=27334 _VODGETMEDIAENTITYCONFIGLISTRESPONSE._serialized_start=27337 _VODGETMEDIAENTITYCONFIGLISTRESPONSE._serialized_end=27517 # @@protoc_insertion_point(module_scope)