byteplus-sdk 1.0.39__tar.gz → 1.0.42__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/PKG-INFO +1 -1
- byteplus-sdk-1.0.42/byteplus_sdk/__init__.py +2 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/cdn/service.py +52 -0
- byteplus-sdk-1.0.42/byteplus_sdk/example/cdn/create_rule_engine_template.py +160 -0
- byteplus-sdk-1.0.42/byteplus_sdk/example/cdn/describe_rule_engine_template.py +23 -0
- byteplus-sdk-1.0.42/byteplus_sdk/example/cdn/release_template.py +23 -0
- byteplus-sdk-1.0.42/byteplus_sdk/example/cdn/update_rule_engine_template.py +61 -0
- byteplus-sdk-1.0.42/byteplus_sdk/vod/VodServiceConfig.py +219 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk.egg-info/PKG-INFO +1 -1
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk.egg-info/SOURCES.txt +4 -0
- byteplus-sdk-1.0.39/byteplus_sdk/__init__.py +0 -2
- byteplus-sdk-1.0.39/byteplus_sdk/vod/VodServiceConfig.py +0 -118
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/LICENSE +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/README.md +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/ApiInfo.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/Credentials.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/Policy.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/ServiceInfo.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/ServiceInfoHttps.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/auth/MetaData.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/auth/SignerV4.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/auth/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/Request.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/Service.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/models/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/models/base/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/base/models/base/base_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/cdn/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/const/Const.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/const/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/add_cdn_certificate.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/add_cdn_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/add_template_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/create_cipher_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/create_service_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/delete_cdn_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/delete_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_accounting_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_access_log.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_config.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_data_detail.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_detail.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_origin_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_region_and_isp.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_service.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cdn_upper_ip.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_cipher_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_content_block_tasks.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_content_quota.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_content_tasks.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_edge_nrt_data_summary.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_edge_statistical_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_edge_top_nrt_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_edge_top_statistical_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_edge_top_status_code.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_ip_info.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_ip_list_info.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_origin_nrt_data_summary.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_origin_top_nrt_data.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_origin_top_status_code.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_service_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_template_domains.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/describe_templates.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/duplicate_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/list_cdn_cert_info.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/list_cdn_domains.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/list_cert_info.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/lock_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/start_cdn_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/stop_cdn_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/submit_block_task.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/submit_preload_task.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/submit_refresh_task.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/submit_unblock_task.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/update_cdn_config.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/update_cipher_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/update_service_template.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/cdn/update_template_domain.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/live/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/rtc/RtcService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/rtc/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/rtc/example_get_record_task.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/rtc/example_start_record.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/visual/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/example/visual/example_common.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/iam/IamService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/iam/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/LiveService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20200801/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20200801/live_config.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20200801/live_service.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20200801/live_trait.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20230101/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20230101/live_config.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20230101/live_service.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/live/v20230101/live_trait.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/sms/SmsService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/sms/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/util/Functions.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/util/Util.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/util/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/visual/VisualService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/visual/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/VodService.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_apps_manage_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_callback_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_cdn_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_common_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_edit_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_measure_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_media_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_play_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_smart_strategy_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_space_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_upload_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/business/vod_workflow_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/request/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/request/request_vod_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/response/__init__.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk/vod/models/response/response_vod_pb2.py +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk.egg-info/dependency_links.txt +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk.egg-info/requires.txt +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/byteplus_sdk.egg-info/top_level.txt +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/setup.cfg +0 -0
- {byteplus-sdk-1.0.39 → byteplus-sdk-1.0.42}/setup.py +0 -0
|
@@ -174,6 +174,18 @@ api_info = {
|
|
|
174
174
|
"CreateServiceTemplate": ApiInfo("POST", "/", {
|
|
175
175
|
"Action": "CreateServiceTemplate", "Version": SERVICE_VERSION}, {}, {}),
|
|
176
176
|
|
|
177
|
+
"CreateRuleEngineTemplate": ApiInfo("POST", "/", {
|
|
178
|
+
"Action": "CreateRuleEngineTemplate", "Version": SERVICE_VERSION}, {}, {}),
|
|
179
|
+
|
|
180
|
+
"UpdateRuleEngineTemplate": ApiInfo("POST", "/", {
|
|
181
|
+
"Action": "UpdateRuleEngineTemplate", "Version": SERVICE_VERSION}, {}, {}),
|
|
182
|
+
|
|
183
|
+
"DescribeRuleEngineTemplate": ApiInfo("POST", "/", {
|
|
184
|
+
"Action": "DescribeRuleEngineTemplate", "Version": SERVICE_VERSION}, {}, {}),
|
|
185
|
+
|
|
186
|
+
"ReleaseTemplate": ApiInfo("POST", "/", {
|
|
187
|
+
"Action": "ReleaseTemplate", "Version": SERVICE_VERSION}, {}, {}),
|
|
188
|
+
|
|
177
189
|
"DescribeDistrictData": ApiInfo("POST", "/", {
|
|
178
190
|
"Action": "DescribeDistrictData", "Version": SERVICE_VERSION}, {}, {}),
|
|
179
191
|
|
|
@@ -1049,3 +1061,43 @@ class CDNService(Service):
|
|
|
1049
1061
|
raise Exception("%s: empty response" % action)
|
|
1050
1062
|
res_json = json.loads(res)
|
|
1051
1063
|
return res_json
|
|
1064
|
+
|
|
1065
|
+
def create_rule_engine_template(self, params=None):
|
|
1066
|
+
if params is None:
|
|
1067
|
+
params = {}
|
|
1068
|
+
action = "CreateRuleEngineTemplate"
|
|
1069
|
+
res = self.json(action, [], params)
|
|
1070
|
+
if res == '':
|
|
1071
|
+
raise Exception("%s: empty response" % action)
|
|
1072
|
+
res_json = json.loads(res)
|
|
1073
|
+
return res_json
|
|
1074
|
+
|
|
1075
|
+
def update_rule_engine_template(self, params=None):
|
|
1076
|
+
if params is None:
|
|
1077
|
+
params = {}
|
|
1078
|
+
action = "UpdateRuleEngineTemplate"
|
|
1079
|
+
res = self.json(action, [], params)
|
|
1080
|
+
if res == '':
|
|
1081
|
+
raise Exception("%s: empty response" % action)
|
|
1082
|
+
res_json = json.loads(res)
|
|
1083
|
+
return res_json
|
|
1084
|
+
|
|
1085
|
+
def describe_rule_engine_template(self, params=None):
|
|
1086
|
+
if params is None:
|
|
1087
|
+
params = {}
|
|
1088
|
+
action = "DescribeRuleEngineTemplate"
|
|
1089
|
+
res = self.json(action, [], params)
|
|
1090
|
+
if res == '':
|
|
1091
|
+
raise Exception("%s: empty response" % action)
|
|
1092
|
+
res_json = json.loads(res)
|
|
1093
|
+
return res_json
|
|
1094
|
+
|
|
1095
|
+
def release_template(self, params=None):
|
|
1096
|
+
if params is None:
|
|
1097
|
+
params = {}
|
|
1098
|
+
action = "ReleaseTemplate"
|
|
1099
|
+
res = self.json(action, [], params)
|
|
1100
|
+
if res == '':
|
|
1101
|
+
raise Exception("%s: empty response" % action)
|
|
1102
|
+
res_json = json.loads(res)
|
|
1103
|
+
return res_json
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
|
|
6
|
+
|
|
7
|
+
from byteplus_sdk.example.cdn import ak, sk
|
|
8
|
+
from byteplus_sdk.cdn.service import CDNService
|
|
9
|
+
|
|
10
|
+
from rule_engine.Rule import Condition, Action, Rule
|
|
11
|
+
from rule_engine.Const import Const
|
|
12
|
+
|
|
13
|
+
def example():
|
|
14
|
+
cdn_service = CDNService()
|
|
15
|
+
cdn_service.set_ak(ak)
|
|
16
|
+
cdn_service.set_sk(sk)
|
|
17
|
+
|
|
18
|
+
# Create a rule engine policy that sets the cache time to 0 seconds under any conditions.
|
|
19
|
+
rule = Rule()
|
|
20
|
+
rule.desc = "example"
|
|
21
|
+
rule.if_block.condition = Condition({
|
|
22
|
+
"IsGroup": False,
|
|
23
|
+
"Connective": Const.ConnectiveAnd,
|
|
24
|
+
"Condition": {
|
|
25
|
+
"Object": Const.ConditionAlways,
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
rule.if_block.actions.append(Action({
|
|
29
|
+
"Action": Const.ActionCacheTime,
|
|
30
|
+
"Groups": [{
|
|
31
|
+
"Dimension": Const.ActionCacheTime,
|
|
32
|
+
"GroupParameters": [{
|
|
33
|
+
"Parameters": [
|
|
34
|
+
{
|
|
35
|
+
"Name": "ttl",
|
|
36
|
+
"Values": ["0"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"Name": "ttl_unit",
|
|
40
|
+
"Values": ["sec"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"Name": "cache_policy",
|
|
44
|
+
"Values": [Const.CacheDefault]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"Name": "force_cache",
|
|
48
|
+
"Values": ["true"]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}]
|
|
52
|
+
}]
|
|
53
|
+
}))
|
|
54
|
+
|
|
55
|
+
rsp = cdn_service.create_rule_engine_template({
|
|
56
|
+
"Project": "default",
|
|
57
|
+
"Title": "example",
|
|
58
|
+
"Message": "Under any conditions, set the cache time to 0 seconds",
|
|
59
|
+
"Rule": rule.encode_to_string()
|
|
60
|
+
})
|
|
61
|
+
print(rsp)
|
|
62
|
+
|
|
63
|
+
def example2():
|
|
64
|
+
cdn_service = CDNService()
|
|
65
|
+
cdn_service.set_ak(ak)
|
|
66
|
+
cdn_service.set_sk(sk)
|
|
67
|
+
|
|
68
|
+
# When the Referer request header is equal to 'example', set the HTTP response header 'test' with a value of abc123.
|
|
69
|
+
rule = Rule()
|
|
70
|
+
rule.desc = "example"
|
|
71
|
+
rule.if_block.condition = Condition({
|
|
72
|
+
"IsGroup": False,
|
|
73
|
+
"Connective": Const.ConnectiveAnd,
|
|
74
|
+
"Condition": {
|
|
75
|
+
"Object": Const.ConditionHTTPReferer,
|
|
76
|
+
"Operator": Const.OperatorEqual,
|
|
77
|
+
"Value": ["example"],
|
|
78
|
+
"IgnoreCase": True
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
rule.if_block.actions.append(Action({
|
|
82
|
+
"Action": Const.ConditionResponseHeader,
|
|
83
|
+
"Groups": [{
|
|
84
|
+
"Dimension": Const.ActionResponseHeader,
|
|
85
|
+
"GroupParameters": [{
|
|
86
|
+
"Parameters": [
|
|
87
|
+
{
|
|
88
|
+
"Name": "action",
|
|
89
|
+
"Values": ["set"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"Name": "header_name",
|
|
93
|
+
"Values": ["test"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"Name": "header_value",
|
|
97
|
+
"Values": ["abc123"]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}]
|
|
101
|
+
}]
|
|
102
|
+
}))
|
|
103
|
+
|
|
104
|
+
rsp = cdn_service.create_rule_engine_template({
|
|
105
|
+
"Project": "default",
|
|
106
|
+
"Title": "example2",
|
|
107
|
+
"Message": "When the Referer request header is equal to 'example', set the HTTP response header 'test' with a value of abc123.",
|
|
108
|
+
"Rule": rule.encode_to_string()
|
|
109
|
+
})
|
|
110
|
+
print(rsp)
|
|
111
|
+
|
|
112
|
+
def example3():
|
|
113
|
+
cdn_service = CDNService()
|
|
114
|
+
cdn_service.set_ak(ak)
|
|
115
|
+
cdn_service.set_sk(sk)
|
|
116
|
+
|
|
117
|
+
# URL matching, equal to http://www.example.com/path1?a=1 When case is ignored, the protocol forces a redirect, with a redirect status code of 301 and a redirect protocol of HTTPS
|
|
118
|
+
rule = Rule()
|
|
119
|
+
rule.desc = "example"
|
|
120
|
+
rule.if_block.condition = Condition({
|
|
121
|
+
"IsGroup": False,
|
|
122
|
+
"Connective": Const.ConnectiveAnd,
|
|
123
|
+
"Condition": {
|
|
124
|
+
"Object": Const.ConditionHTTPUrl,
|
|
125
|
+
"Operator": Const.OperatorEqual,
|
|
126
|
+
"Value": ["http://www.test.com/path1?a=1"],
|
|
127
|
+
"IgnoreCase": True
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
rule.if_block.actions.append(Action({
|
|
131
|
+
"Action": Const.ActionRedirectProtocol,
|
|
132
|
+
"Groups": [{
|
|
133
|
+
"Dimension": Const.ActionRedirectProtocol,
|
|
134
|
+
"GroupParameters": [{
|
|
135
|
+
"Parameters": [
|
|
136
|
+
{
|
|
137
|
+
"Name": "status_code",
|
|
138
|
+
"Values": ["301"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"Name": "protocol",
|
|
142
|
+
"Values": ["https"]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}]
|
|
146
|
+
}]
|
|
147
|
+
}))
|
|
148
|
+
|
|
149
|
+
rsp = cdn_service.create_rule_engine_template({
|
|
150
|
+
"Project": "default",
|
|
151
|
+
"Title": "example3",
|
|
152
|
+
"Message": "",
|
|
153
|
+
"Rule": rule.encode_to_string()
|
|
154
|
+
})
|
|
155
|
+
print(rsp)
|
|
156
|
+
|
|
157
|
+
if __name__ == '__main__':
|
|
158
|
+
example1()
|
|
159
|
+
example2()
|
|
160
|
+
example3()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
|
|
6
|
+
|
|
7
|
+
from byteplus_sdk.example.cdn import ak, sk
|
|
8
|
+
from byteplus_sdk.cdn.service import CDNService
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def example():
|
|
12
|
+
cdn_service = CDNService()
|
|
13
|
+
cdn_service.set_ak(ak)
|
|
14
|
+
cdn_service.set_sk(sk)
|
|
15
|
+
|
|
16
|
+
rsp = cdn_service.describe_rule_engine_template({
|
|
17
|
+
"TemplateId": "tpl-example",
|
|
18
|
+
})
|
|
19
|
+
print(rsp)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == '__main__':
|
|
23
|
+
example()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
|
|
6
|
+
|
|
7
|
+
from byteplus_sdk.example.cdn import ak, sk
|
|
8
|
+
from byteplus_sdk.cdn.service import CDNService
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def example():
|
|
12
|
+
cdn_service = CDNService()
|
|
13
|
+
cdn_service.set_ak(ak)
|
|
14
|
+
cdn_service.set_sk(sk)
|
|
15
|
+
|
|
16
|
+
rsp = cdn_service.release_template({
|
|
17
|
+
"TemplateId": "tpl-example",
|
|
18
|
+
})
|
|
19
|
+
print(rsp)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == '__main__':
|
|
23
|
+
example()
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
|
|
6
|
+
|
|
7
|
+
from byteplus_sdk.example.cdn import ak, sk
|
|
8
|
+
from byteplus_sdk.cdn.service import CDNService
|
|
9
|
+
|
|
10
|
+
from rule_engine.Rule import Condition, Action, Rule
|
|
11
|
+
from rule_engine.Const import Const
|
|
12
|
+
|
|
13
|
+
def example():
|
|
14
|
+
cdn_service = CDNService()
|
|
15
|
+
cdn_service.set_ak(ak)
|
|
16
|
+
cdn_service.set_sk(sk)
|
|
17
|
+
|
|
18
|
+
rule = Rule()
|
|
19
|
+
rule.desc = "example"
|
|
20
|
+
rule.if_block.condition = Condition({
|
|
21
|
+
"IsGroup": False,
|
|
22
|
+
"Connective": Const.ConnectiveAnd,
|
|
23
|
+
"Condition": {
|
|
24
|
+
"Object": Const.ConditionAlways,
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
rule.if_block.actions.append(Action({
|
|
28
|
+
"Action": Const.ActionCacheTime,
|
|
29
|
+
"Groups": [{
|
|
30
|
+
"Dimension": Const.ActionCacheTime,
|
|
31
|
+
"GroupParameters": [{
|
|
32
|
+
"Parameters": [
|
|
33
|
+
{
|
|
34
|
+
"Name": "ttl",
|
|
35
|
+
"Values": ["0"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"Name": "ttl_unit",
|
|
39
|
+
"Values": ["sec"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"Name": "cache_policy",
|
|
43
|
+
"Values": [Const.CacheDefault]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"Name": "force_cache",
|
|
47
|
+
"Values": ["true"]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}]
|
|
51
|
+
}]
|
|
52
|
+
}))
|
|
53
|
+
rsp = cdn_service.update_rule_engine_template({
|
|
54
|
+
"TemplateId": "tpl-example",
|
|
55
|
+
"TemplateVersion": "draft",
|
|
56
|
+
"Rule": rule.encode_to_string()
|
|
57
|
+
})
|
|
58
|
+
print(rsp)
|
|
59
|
+
|
|
60
|
+
if __name__ == '__main__':
|
|
61
|
+
example()
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# coding:utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import print_function
|
|
4
|
+
|
|
5
|
+
import threading
|
|
6
|
+
from zlib import crc32
|
|
7
|
+
|
|
8
|
+
from byteplus_sdk.ApiInfo import ApiInfo
|
|
9
|
+
from byteplus_sdk.Credentials import Credentials
|
|
10
|
+
from byteplus_sdk.ServiceInfo import ServiceInfo
|
|
11
|
+
from byteplus_sdk.base.Service import Service
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class VodServiceConfig(Service):
|
|
15
|
+
_instance_lock = threading.Lock()
|
|
16
|
+
|
|
17
|
+
def __new__(cls, *args, **kwargs):
|
|
18
|
+
if not hasattr(cls, "_instance"):
|
|
19
|
+
with cls._instance_lock:
|
|
20
|
+
if not hasattr(cls, "_instance"):
|
|
21
|
+
cls._instance = object.__new__(cls)
|
|
22
|
+
return cls._instance
|
|
23
|
+
|
|
24
|
+
def __init__(self, region='ap-singapore-1'):
|
|
25
|
+
self.service_info = VodServiceConfig.get_service_info(region)
|
|
26
|
+
self.api_info = VodServiceConfig.get_api_info(region)
|
|
27
|
+
self.domain_cache = {}
|
|
28
|
+
self.fallback_domain_weights = {}
|
|
29
|
+
self.update_interval = 10
|
|
30
|
+
self.lock = threading.Lock()
|
|
31
|
+
super(VodServiceConfig, self).__init__(self.service_info, self.api_info)
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def get_service_info(region):
|
|
35
|
+
service_info_map = {
|
|
36
|
+
'ap-singapore-1': ServiceInfo("vod.byteplusapi.com", {'Accept': 'application/json'},
|
|
37
|
+
Credentials('', '', 'vod', 'ap-singapore-1'), 60, 60,"https"),
|
|
38
|
+
'ap-southeast-1': ServiceInfo("vod.byteplusapi.com", {'Accept': 'application/json'},
|
|
39
|
+
Credentials('', '', 'vod', 'ap-southeast-1'), 60, 60, "https"),
|
|
40
|
+
}
|
|
41
|
+
service_info = service_info_map.get(region, None)
|
|
42
|
+
if not service_info:
|
|
43
|
+
raise Exception('Cant find the region, please check it carefully')
|
|
44
|
+
|
|
45
|
+
return service_info
|
|
46
|
+
|
|
47
|
+
@staticmethod
|
|
48
|
+
def get_api_info(region):
|
|
49
|
+
if region == 'ap-singapore-1':
|
|
50
|
+
api_info = {
|
|
51
|
+
# 播放
|
|
52
|
+
"GetPlayInfo": ApiInfo("GET", "/", {"Action": "GetPlayInfo", "Version": "2023-01-01"}, {}, {}),
|
|
53
|
+
"GetPrivateDrmPlayAuth": ApiInfo("GET", "/", {"Action": "GetPrivateDrmPlayAuth", "Version": "2023-01-01"},
|
|
54
|
+
{}, {}),
|
|
55
|
+
# 上传
|
|
56
|
+
"UploadMediaByUrl": ApiInfo("POST", "/", {"Action": "UploadMediaByUrl", "Version": "2023-01-01"}, {}, {}),
|
|
57
|
+
"QueryUploadTaskInfo": ApiInfo("GET", "/", {"Action": "QueryUploadTaskInfo", "Version": "2023-01-01"}, {}, {}),
|
|
58
|
+
"ApplyUploadInfo": ApiInfo("GET", "/", {"Action": "ApplyUploadInfo", "Version": "2023-01-01"}, {}, {}),
|
|
59
|
+
"CommitUploadInfo": ApiInfo("GET", "/", {"Action": "CommitUploadInfo", "Version": "2023-01-01"}, {}, {}),
|
|
60
|
+
# 媒资
|
|
61
|
+
"UpdateMediaInfo": ApiInfo("GET", "/", {"Action": "UpdateMediaInfo", "Version": "2023-01-01"}, {}, {}),
|
|
62
|
+
"UpdateMediaPublishStatus": ApiInfo("GET", "/", {"Action": "UpdateMediaPublishStatus", "Version": "2023-01-01"}, {}, {}),
|
|
63
|
+
"GetMediaInfos": ApiInfo("GET", "/", {"Action": "GetMediaInfos", "Version": "2023-01-01"}, {}, {}),
|
|
64
|
+
"DeleteMedia": ApiInfo("GET", "/", {"Action": "DeleteMedia", "Version": "2023-01-01"}, {}, {}),
|
|
65
|
+
"DeleteTranscodes": ApiInfo("GET", "/", {"Action": "DeleteTranscodes", "Version": "2023-01-01"}, {}, {}),
|
|
66
|
+
"GetMediaList": ApiInfo("GET", "/", {"Action": "GetMediaList", "Version": "2023-01-01"}, {}, {}),
|
|
67
|
+
"GetSubtitleInfoList": ApiInfo("GET", "/", {"Action": "GetSubtitleInfoList", "Version": "2023-01-01"}, {}, {}),
|
|
68
|
+
"UpdateSubtitleStatus": ApiInfo("GET", "/", {"Action": "UpdateSubtitleStatus", "Version": "2023-01-01"}, {}, {}),
|
|
69
|
+
"UpdateSubtitleInfo": ApiInfo("GET", "/", {"Action": "UpdateSubtitleInfo", "Version": "2023-01-01"}, {}, {}),
|
|
70
|
+
"ListVideoClassifications": ApiInfo("GET", "/",{"Action": "ListVideoClassifications", "Version": "2023-01-01"}, {},{}),
|
|
71
|
+
"CreatePlaylist": ApiInfo("GET", "/",{"Action": "CreatePlaylist", "Version": "2023-01-01"}, {},{}),
|
|
72
|
+
"GetPlaylists": ApiInfo("GET", "/",{"Action": "GetPlaylists", "Version": "2023-01-01"}, {},{}),
|
|
73
|
+
"UpdatePlaylist": ApiInfo("GET", "/",{"Action": "UpdatePlaylist", "Version": "2023-01-01"}, {},{}),
|
|
74
|
+
"DeletePlaylist": ApiInfo("GET", "/",{"Action": "DeletePlaylist", "Version": "2023-01-01"}, {},{}),
|
|
75
|
+
|
|
76
|
+
# 转码
|
|
77
|
+
"StartWorkflow": ApiInfo("GET", "/", {"Action": "StartWorkflow", "Version": "2023-01-01"}, {}, {}),
|
|
78
|
+
"RetrieveTranscodeResult": ApiInfo("GET", "/", {"Action": "RetrieveTranscodeResult", "Version": "2023-01-01"}, {}, {}),
|
|
79
|
+
"GetWorkflowExecution": ApiInfo("GET", "/", {"Action": "GetWorkflowExecution", "Version": "2023-01-01"}, {}, {}),
|
|
80
|
+
# 空间管理
|
|
81
|
+
"CreateSpace": ApiInfo("GET", "/", {"Action": "CreateSpace", "Version": "2023-01-01"}, {}, {}),
|
|
82
|
+
"ListSpace": ApiInfo("GET", "/", {"Action": "ListSpace", "Version": "2023-07-01"}, {}, {}),
|
|
83
|
+
"GetSpaceDetail": ApiInfo("GET", "/", {"Action": "GetSpaceDetail", "Version": "2023-07-01"}, {}, {}),
|
|
84
|
+
"UpdateSpaceUploadConfig": ApiInfo("GET", "/", {"Action": "UpdateSpaceUploadConfig", "Version": "2023-01-01"}, {}, {}),
|
|
85
|
+
"DescribeVodSpaceStorageData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceStorageData", "Version": "2023-01-01"},{}, {}),
|
|
86
|
+
# 分发加速
|
|
87
|
+
"ListDomain": ApiInfo("GET", "/", {"Action": "ListDomain", "Version": "2023-01-01"}, {}, {}),
|
|
88
|
+
"CreateCdnRefreshTask": ApiInfo("GET", "/", {"Action": "CreateCdnRefreshTask", "Version": "2023-01-01"}, {}, {}),
|
|
89
|
+
"CreateCdnPreloadTask": ApiInfo("GET", "/", {"Action": "CreateCdnPreloadTask", "Version": "2023-01-01"}, {}, {}),
|
|
90
|
+
"ListCdnTasks": ApiInfo("GET", "/", {"Action": "ListCDNTasks", "Version": "2023-01-01"}, {}, {}),
|
|
91
|
+
"ListCdnAccessLog": ApiInfo("GET", "/", {"Action": "ListCdnAccessLog", "Version": "2023-01-01"}, {}, {}),
|
|
92
|
+
"ListCdnTopAccessUrl": ApiInfo("GET", "/", {"Action": "ListCdnTopAccessUrl", "Version": "2023-01-01"}, {}, {}),
|
|
93
|
+
"DescribeVodDomainBandwidthData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainBandwidthData", "Version": "2023-01-01"}, {}, {}),
|
|
94
|
+
"DescribeVodDomainTrafficData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainTrafficData", "Version": "2023-01-01"}, {}, {}),
|
|
95
|
+
"ListCdnUsageData": ApiInfo("GET", "/", {"Action": "ListCdnUsageData", "Version": "2023-01-01"}, {}, {}),
|
|
96
|
+
"ListCdnStatusData": ApiInfo("GET", "/", {"Action": "ListCdnStatusData", "Version": "2023-01-01"}, {}, {}),
|
|
97
|
+
"DescribeIpInfo": ApiInfo("GET", "/", {"Action": "DescribeIpInfo", "Version": "2023-01-01"}, {}, {}),
|
|
98
|
+
"ListCdnPvData": ApiInfo("GET", "/", {"Action": "ListCdnPvData", "Version": "2023-01-01"}, {}, {}),
|
|
99
|
+
# 回调管理
|
|
100
|
+
"AddCallbackSubscription": ApiInfo("GET", "/", {"Action": "AddCallbackSubscription", "Version": "2023-01-01"}, {}, {}),
|
|
101
|
+
"SetCallbackEvent": ApiInfo("GET", "/", {"Action": "SetCallbackEvent", "Version": "2023-01-01"}, {}, {}),
|
|
102
|
+
# 计量计费
|
|
103
|
+
"DescribeVodSpaceTranscodeData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceTranscodeData", "Version": "2023-01-01"}, {}, {}),
|
|
104
|
+
"DescribeVodSnapshotData": ApiInfo("GET", "/", {"Action": "DescribeVodSnapshotData", "Version": "2023-01-01"}, {}, {}),
|
|
105
|
+
"DescribeVodEnhanceImageData": ApiInfo("GET", "/", {"Action": "DescribeVodEnhanceImageData", "Version": "2023-01-01"}, {}, {}),
|
|
106
|
+
"DescribeVodSpaceSubtitleStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceSubtitleStatisData", "Version": "2023-01-01"}, {}, {}),
|
|
107
|
+
"DescribeVodPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodPlayedStatisData", "Version": "2023-01-01"}, {}, {}),
|
|
108
|
+
"DescribeVodMostPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodMostPlayedStatisData", "Version": "2023-01-01"}, {}, {}),
|
|
109
|
+
"DescribeVodRealtimeMediaData": ApiInfo("GET", "/", {"Action": "DescribeVodRealtimeMediaData", "Version": "2023-01-01"}, {}, {}),
|
|
110
|
+
# 商业drm
|
|
111
|
+
"GetDrmLicense": ApiInfo("POST", "/", {"Action": "GetDrmLicense", "Version": "2023-01-01"}, {}, {}),
|
|
112
|
+
"GetFairPlayCert": ApiInfo("GET", "/", {"Action": "GetFairPlayCert", "Version": "2023-01-01"}, {}, {}),
|
|
113
|
+
}
|
|
114
|
+
return api_info
|
|
115
|
+
if region == 'ap-southeast-1':
|
|
116
|
+
api_info = {
|
|
117
|
+
# 播放
|
|
118
|
+
"GetPlayInfo": ApiInfo("GET", "/", {"Action": "GetPlayInfo", "Version": "2023-01-01"}, {}, {}),
|
|
119
|
+
"GetPrivateDrmPlayAuth": ApiInfo("GET", "/",
|
|
120
|
+
{"Action": "GetPrivateDrmPlayAuth", "Version": "2023-01-01"},
|
|
121
|
+
{}, {}),
|
|
122
|
+
# 上传
|
|
123
|
+
"UploadMediaByUrl": ApiInfo("POST", "/", {"Action": "UploadMediaByUrl", "Version": "2023-01-01"}, {},
|
|
124
|
+
{}),
|
|
125
|
+
"QueryUploadTaskInfo": ApiInfo("GET", "/", {"Action": "QueryUploadTaskInfo", "Version": "2023-01-01"},
|
|
126
|
+
{}, {}),
|
|
127
|
+
"ApplyUploadInfo": ApiInfo("GET", "/", {"Action": "ApplyUploadInfo", "Version": "2023-01-01"}, {}, {}),
|
|
128
|
+
"CommitUploadInfo": ApiInfo("GET", "/", {"Action": "CommitUploadInfo", "Version": "2023-01-01"}, {},
|
|
129
|
+
{}),
|
|
130
|
+
# 媒资
|
|
131
|
+
"UpdateMediaInfo": ApiInfo("GET", "/", {"Action": "UpdateMediaInfo", "Version": "2023-01-01"}, {}, {}),
|
|
132
|
+
"UpdateMediaPublishStatus": ApiInfo("GET", "/",
|
|
133
|
+
{"Action": "UpdateMediaPublishStatus", "Version": "2023-01-01"}, {},
|
|
134
|
+
{}),
|
|
135
|
+
"GetMediaInfos": ApiInfo("GET", "/", {"Action": "GetMediaInfos", "Version": "2023-01-01"}, {}, {}),
|
|
136
|
+
"DeleteMedia": ApiInfo("GET", "/", {"Action": "DeleteMedia", "Version": "2023-01-01"}, {}, {}),
|
|
137
|
+
"DeleteTranscodes": ApiInfo("GET", "/", {"Action": "DeleteTranscodes", "Version": "2023-01-01"}, {},
|
|
138
|
+
{}),
|
|
139
|
+
"GetMediaList": ApiInfo("GET", "/", {"Action": "GetMediaList", "Version": "2023-01-01"}, {}, {}),
|
|
140
|
+
"GetSubtitleInfoList": ApiInfo("GET", "/", {"Action": "GetSubtitleInfoList", "Version": "2023-01-01"},
|
|
141
|
+
{}, {}),
|
|
142
|
+
"UpdateSubtitleStatus": ApiInfo("GET", "/", {"Action": "UpdateSubtitleStatus", "Version": "2023-01-01"},
|
|
143
|
+
{}, {}),
|
|
144
|
+
"UpdateSubtitleInfo": ApiInfo("GET", "/", {"Action": "UpdateSubtitleInfo", "Version": "2023-01-01"}, {},
|
|
145
|
+
{}),
|
|
146
|
+
"ListVideoClassifications": ApiInfo("GET", "/",
|
|
147
|
+
{"Action": "ListVideoClassifications", "Version": "2023-01-01"}, {},
|
|
148
|
+
{}),
|
|
149
|
+
"CreatePlaylist": ApiInfo("GET", "/", {"Action": "CreatePlaylist", "Version": "2023-01-01"}, {}, {}),
|
|
150
|
+
"GetPlaylists": ApiInfo("GET", "/", {"Action": "GetPlaylists", "Version": "2023-01-01"}, {}, {}),
|
|
151
|
+
"UpdatePlaylist": ApiInfo("GET", "/", {"Action": "UpdatePlaylist", "Version": "2023-01-01"}, {}, {}),
|
|
152
|
+
"DeletePlaylist": ApiInfo("GET", "/", {"Action": "DeletePlaylist", "Version": "2023-01-01"}, {}, {}),
|
|
153
|
+
|
|
154
|
+
# 转码
|
|
155
|
+
# 空间管理
|
|
156
|
+
"CreateSpace": ApiInfo("GET", "/", {"Action": "CreateSpace", "Version": "2023-01-01"}, {}, {}),
|
|
157
|
+
"ListSpace": ApiInfo("GET", "/", {"Action": "ListSpace", "Version": "2023-07-01"}, {}, {}),
|
|
158
|
+
"GetSpaceDetail": ApiInfo("GET", "/", {"Action": "GetSpaceDetail", "Version": "2023-07-01"}, {}, {}),
|
|
159
|
+
"UpdateSpaceUploadConfig": ApiInfo("GET", "/",
|
|
160
|
+
{"Action": "UpdateSpaceUploadConfig", "Version": "2023-01-01"}, {},
|
|
161
|
+
{}),
|
|
162
|
+
"DescribeVodSpaceStorageData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceStorageData",
|
|
163
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
164
|
+
# 分发加速
|
|
165
|
+
"ListDomain": ApiInfo("GET", "/", {"Action": "ListDomain", "Version": "2023-01-01"}, {}, {}),
|
|
166
|
+
"CreateCdnRefreshTask": ApiInfo("GET", "/", {"Action": "CreateCdnRefreshTask", "Version": "2023-01-01"},
|
|
167
|
+
{}, {}),
|
|
168
|
+
"CreateCdnPreloadTask": ApiInfo("GET", "/", {"Action": "CreateCdnPreloadTask", "Version": "2023-01-01"},
|
|
169
|
+
{}, {}),
|
|
170
|
+
"ListCdnTasks": ApiInfo("GET", "/", {"Action": "ListCDNTasks", "Version": "2023-01-01"}, {}, {}),
|
|
171
|
+
"ListCdnAccessLog": ApiInfo("GET", "/", {"Action": "ListCdnAccessLog", "Version": "2023-01-01"}, {},
|
|
172
|
+
{}),
|
|
173
|
+
"ListCdnTopAccessUrl": ApiInfo("GET", "/", {"Action": "ListCdnTopAccessUrl", "Version": "2023-01-01"},
|
|
174
|
+
{}, {}),
|
|
175
|
+
"DescribeVodDomainBandwidthData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainBandwidthData",
|
|
176
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
177
|
+
"DescribeVodDomainTrafficData": ApiInfo("GET", "/", {"Action": "DescribeVodDomainTrafficData",
|
|
178
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
179
|
+
"ListCdnUsageData": ApiInfo("GET", "/", {"Action": "ListCdnUsageData", "Version": "2023-01-01"}, {},
|
|
180
|
+
{}),
|
|
181
|
+
"ListCdnStatusData": ApiInfo("GET", "/", {"Action": "ListCdnStatusData", "Version": "2023-01-01"}, {},
|
|
182
|
+
{}),
|
|
183
|
+
"DescribeIpInfo": ApiInfo("GET", "/", {"Action": "DescribeIpInfo", "Version": "2023-01-01"}, {}, {}),
|
|
184
|
+
"ListCdnPvData": ApiInfo("GET", "/", {"Action": "ListCdnPvData", "Version": "2023-01-01"}, {}, {}),
|
|
185
|
+
# 回调管理
|
|
186
|
+
"AddCallbackSubscription": ApiInfo("GET", "/",
|
|
187
|
+
{"Action": "AddCallbackSubscription", "Version": "2023-01-01"}, {},
|
|
188
|
+
{}),
|
|
189
|
+
"SetCallbackEvent": ApiInfo("GET", "/", {"Action": "SetCallbackEvent", "Version": "2023-01-01"}, {},
|
|
190
|
+
{}),
|
|
191
|
+
# 计量计费
|
|
192
|
+
"DescribeVodSpaceTranscodeData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceTranscodeData",
|
|
193
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
194
|
+
"DescribeVodSnapshotData": ApiInfo("GET", "/",
|
|
195
|
+
{"Action": "DescribeVodSnapshotData", "Version": "2023-01-01"}, {},
|
|
196
|
+
{}),
|
|
197
|
+
"DescribeVodEnhanceImageData": ApiInfo("GET", "/", {"Action": "DescribeVodEnhanceImageData",
|
|
198
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
199
|
+
"DescribeVodSpaceSubtitleStatisData": ApiInfo("GET", "/",
|
|
200
|
+
{"Action": "DescribeVodSpaceSubtitleStatisData",
|
|
201
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
202
|
+
"DescribeVodPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodPlayedStatisData",
|
|
203
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
204
|
+
"DescribeVodMostPlayedStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodMostPlayedStatisData",
|
|
205
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
206
|
+
"DescribeVodRealtimeMediaData": ApiInfo("GET", "/", {"Action": "DescribeVodRealtimeMediaData",
|
|
207
|
+
"Version": "2023-01-01"}, {}, {}),
|
|
208
|
+
# 商业drm
|
|
209
|
+
"GetDrmLicense": ApiInfo("POST", "/", {"Action": "GetDrmLicense", "Version": "2023-01-01"}, {}, {}),
|
|
210
|
+
"GetFairPlayCert": ApiInfo("GET", "/", {"Action": "GetFairPlayCert", "Version": "2023-01-01"}, {}, {}),
|
|
211
|
+
}
|
|
212
|
+
return api_info
|
|
213
|
+
|
|
214
|
+
@staticmethod
|
|
215
|
+
def crc32(file_path):
|
|
216
|
+
prev = 0
|
|
217
|
+
for eachLine in open(file_path, "rb"):
|
|
218
|
+
prev = crc32(eachLine, prev)
|
|
219
|
+
return prev & 0xFFFFFFFF
|
|
@@ -31,6 +31,7 @@ byteplus_sdk/example/cdn/add_cdn_certificate.py
|
|
|
31
31
|
byteplus_sdk/example/cdn/add_cdn_domain.py
|
|
32
32
|
byteplus_sdk/example/cdn/add_template_domain.py
|
|
33
33
|
byteplus_sdk/example/cdn/create_cipher_template.py
|
|
34
|
+
byteplus_sdk/example/cdn/create_rule_engine_template.py
|
|
34
35
|
byteplus_sdk/example/cdn/create_service_template.py
|
|
35
36
|
byteplus_sdk/example/cdn/delete_cdn_domain.py
|
|
36
37
|
byteplus_sdk/example/cdn/delete_template.py
|
|
@@ -58,6 +59,7 @@ byteplus_sdk/example/cdn/describe_ip_list_info.py
|
|
|
58
59
|
byteplus_sdk/example/cdn/describe_origin_nrt_data_summary.py
|
|
59
60
|
byteplus_sdk/example/cdn/describe_origin_top_nrt_data.py
|
|
60
61
|
byteplus_sdk/example/cdn/describe_origin_top_status_code.py
|
|
62
|
+
byteplus_sdk/example/cdn/describe_rule_engine_template.py
|
|
61
63
|
byteplus_sdk/example/cdn/describe_service_template.py
|
|
62
64
|
byteplus_sdk/example/cdn/describe_template_domains.py
|
|
63
65
|
byteplus_sdk/example/cdn/describe_templates.py
|
|
@@ -66,6 +68,7 @@ byteplus_sdk/example/cdn/list_cdn_cert_info.py
|
|
|
66
68
|
byteplus_sdk/example/cdn/list_cdn_domains.py
|
|
67
69
|
byteplus_sdk/example/cdn/list_cert_info.py
|
|
68
70
|
byteplus_sdk/example/cdn/lock_template.py
|
|
71
|
+
byteplus_sdk/example/cdn/release_template.py
|
|
69
72
|
byteplus_sdk/example/cdn/start_cdn_domain.py
|
|
70
73
|
byteplus_sdk/example/cdn/stop_cdn_domain.py
|
|
71
74
|
byteplus_sdk/example/cdn/submit_block_task.py
|
|
@@ -74,6 +77,7 @@ byteplus_sdk/example/cdn/submit_refresh_task.py
|
|
|
74
77
|
byteplus_sdk/example/cdn/submit_unblock_task.py
|
|
75
78
|
byteplus_sdk/example/cdn/update_cdn_config.py
|
|
76
79
|
byteplus_sdk/example/cdn/update_cipher_template.py
|
|
80
|
+
byteplus_sdk/example/cdn/update_rule_engine_template.py
|
|
77
81
|
byteplus_sdk/example/cdn/update_service_template.py
|
|
78
82
|
byteplus_sdk/example/cdn/update_template_domain.py
|
|
79
83
|
byteplus_sdk/example/live/__init__.py
|