Skip to content

Commit eb80fc8

Browse files
author
liyan.90210
committed
feat auto update sdk
1 parent 966222e commit eb80fc8

File tree

10 files changed

+516
-326
lines changed

10 files changed

+516
-326
lines changed

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
### Change log
22

3+
2025-12-11 Bumped to version v1.0.209
4+
- Updated apis for vms/vod
5+
36
2025-12-04 Bumped to version v1.0.208
47
- Updated apis for tls
58

volcengine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# coding:utf-8
2-
VERSION='v1.0.208'
2+
VERSION='v1.0.209'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding:utf-8
2+
from __future__ import print_function
3+
4+
from volcengine.vod.VodService import VodService
5+
from volcengine.vod.models.request.request_vod_pb2 import VodAsyncVCreativeTaskRequest
6+
import json
7+
8+
if __name__ == '__main__':
9+
# Create a VOD instance in the specified region.
10+
# vod_service = VodService('cn-north-1')
11+
vod_service = VodService()
12+
13+
# 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.
14+
# The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
15+
# 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.
16+
# vod_service.set_ak('your ak')
17+
# vod_service.set_sk('your sk')
18+
try:
19+
paramObj = {
20+
'input': 'vid://{your vid}',
21+
'style': '漫画风',
22+
'resolution': '720p'
23+
}
24+
paramStr = json.dumps(paramObj)
25+
req = VodAsyncVCreativeTaskRequest()
26+
req.Uploader = "your Uploader"
27+
req.ParamStr = paramStr
28+
req.Scene = "videostyletrans"
29+
req.CallbackArgs = "your CallbackArgs"
30+
31+
resp = vod_service.async_v_creative_task(req)
32+
except Exception:
33+
raise
34+
else:
35+
l = json.loads(resp)
36+
print(json.dumps(l, ensure_ascii=False, indent=4))
37+
print("****")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding:utf-8
2+
from __future__ import print_function
3+
4+
from volcengine.vod.VodService import VodService
5+
from volcengine.vod.models.request.request_vod_pb2 import VodGetVCreativeTaskResultRequest
6+
import json
7+
8+
if __name__ == '__main__':
9+
# Create a VOD instance in the specified region.
10+
# vod_service = VodService('cn-north-1')
11+
vod_service = VodService()
12+
13+
# 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.
14+
# The SDK will automatically fetch the AK and SK from the environment variables or the ~/.volc/config file as needed.
15+
# 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.
16+
# vod_service.set_ak('your ak')
17+
# vod_service.set_sk('your sk')
18+
try:
19+
req = VodGetVCreativeTaskResultRequest()
20+
req.VCreativeId = "your VCreativeId"
21+
22+
resp = vod_service.get_v_creative_task_result(req)
23+
except Exception:
24+
raise
25+
else:
26+
l = json.loads(resp)
27+
print(json.dumps(l, ensure_ascii=False, indent=4))
28+
print("****")

volcengine/vms/VmsService.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def get_api_info():
8484
"CreateAXGGroup": ApiInfo("POST", "/", {"Action": "CreateAXGGroup", "Version": SERVICE_VERSION}, {}, {}),
8585
"UpdateAXGGroup": ApiInfo("POST", "/", {"Action": "UpdateAXGGroup", "Version": SERVICE_VERSION}, {}, {}),
8686
"DeleteAXGGroup": ApiInfo("POST", "/", {"Action": "DeleteAXGGroup", "Version": SERVICE_VERSION}, {}, {}),
87+
"RegisterIndustrialId": ApiInfo("POST", "/", {"Action": "RegisterIndustrialId", "Version": SERVICE_VERSION}, {}, {}),
8788
"RouteAAuth": ApiInfo("POST", "/", {"Action": "RouteAAuth", "Version": SERVICE_VERSION}, {}, {}),
8889
"NumberPoolList": ApiInfo("POST", "/", {"Action": "NumberPoolList", "Version": SERVICE_VERSION}, {}, {}),
8990
"NumberList": ApiInfo("GET", "/", {"Action": "NumberList", "Version": SERVICE_VERSION}, {}, {}),
@@ -373,6 +374,14 @@ def delete_axg_group(self, body):
373374
except Exception as e:
374375
raise Exception(str(e))
375376

377+
@retry(tries=2, delay=0)
378+
def register_industrial_id(self, body):
379+
try:
380+
res_json = self.do_json_handler("RegisterIndustrialId", body)
381+
return res_json
382+
except Exception as e:
383+
raise Exception(str(e))
384+
376385
@retry(tries=2, delay=0)
377386
def route_a_auth(self, form):
378387
try:

volcengine/vod/VodService.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,57 @@ def cancel_direct_edit_task(self, request):
577577
raise Exception(resp.ResponseMetadata.Error)
578578
else:
579579
return res
580+
#
581+
# AsyncVCreativeTask.
582+
#
583+
# @param request VodAsyncVCreativeTaskRequest
584+
# @return VodAsyncVCreativeTaskResponse
585+
# @raise Exception
586+
def async_v_creative_task(self, request):
587+
try:
588+
jsonData = MessageToJson(request, False, True)
589+
res = self.json("AsyncVCreativeTask", {}, jsonData)
590+
except Exception as Argument:
591+
try:
592+
resp = Parse(Argument.__str__(), VodAsyncVCreativeTaskResponse(), True)
593+
except Exception:
594+
raise Argument
595+
else:
596+
raise Exception(resp.ResponseMetadata.Error)
597+
else:
598+
return res
599+
#
600+
# GetVCreativeTaskResult.
601+
#
602+
# @param request VodGetVCreativeTaskResultRequest
603+
# @return VodGetVCreativeTaskResultResponse
604+
# @raise Exception
605+
def get_v_creative_task_result(self, request):
606+
try:
607+
params = MessageToDict(request, False, True)
608+
if sys.version_info[0] == 3:
609+
for k, v in params.items():
610+
if isinstance(v, (int, float, bool, str)) is True:
611+
continue
612+
else:
613+
params[k] = json.dumps(v)
614+
else:
615+
for k, v in params.items():
616+
if isinstance(v, (int, float, bool, str, unicode)) is True:
617+
continue
618+
else:
619+
params[k] = json.dumps(v)
620+
res = self.get("GetVCreativeTaskResult", params)
621+
except Exception as Argument:
622+
try:
623+
resp = Parse(Argument.__str__(), VodGetVCreativeTaskResultResponse(), True)
624+
except Exception:
625+
raise Argument
626+
else:
627+
raise Exception(resp.ResponseMetadata.Error.Code)
628+
else:
629+
return res
630+
580631

581632

582633
#

volcengine/vod/VodServiceConfig.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ def get_api_info():
167167
"GetDirectEditResult": ApiInfo("POST", "/", {"Action": "GetDirectEditResult", "Version": "2018-01-01"}, {}, {}),
168168
"GetDirectEditProgress": ApiInfo("GET", "/", {"Action": "GetDirectEditProgress", "Version": "2018-01-01"}, {}, {}),
169169
"CancelDirectEditTask": ApiInfo("POST", "/", {"Action": "CancelDirectEditTask", "Version": "2018-01-01"}, {}, {}),
170+
"AsyncVCreativeTask": ApiInfo("POST", "/", {"Action": "AsyncVCreativeTask", "Version": "2018-01-01"}, {}, {}),
171+
"GetVCreativeTaskResult": ApiInfo("GET", "/", {"Action": "GetVCreativeTaskResult", "Version": "2018-01-01"}, {}, {}),
170172
# 计量计费
171173
"DescribeVodSpaceTranscodeData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceTranscodeData", "Version": "2023-07-01"}, {}, {}),
172174
"DescribeVodSpaceAIStatisData": ApiInfo("GET", "/", {"Action": "DescribeVodSpaceAIStatisData", "Version": "2023-07-01"}, {}, {}),

volcengine/vod/models/business/vod_edit_pb2.py

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

volcengine/vod/models/request/request_vod_pb2.py

Lines changed: 185 additions & 165 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

volcengine/vod/models/response/response_vod_pb2.py

Lines changed: 179 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)