Skip to content

Commit 5295037

Browse files
author
金山云SDK
authored
Merge pull request KscSDK#13 from KscSDK/trunk
merge bug fix code from trunk version
2 parents dae92be + 03b7c96 commit 5295037

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

README.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Service 服务
7979
+-------------------+------------+
8080
| monitor | |
8181
+-------------------+------------+
82+
| offline | |
83+
+-------------------+------------+
8284

8385
----------------
8486
Method 方法
@@ -164,6 +166,50 @@ Examples 示例
164166

165167
print json.dumps(m,sort_keys=True,indent=4)
166168

169+
+ OFFLINE
170+
171+
::
172+
173+
from kscore.session import get_session
174+
import json
175+
176+
if __name__=="__main__":
177+
178+
#初始化
179+
s = get_session()
180+
client = s.create_client("offline", "cn-beijing-6", use_ssl=False)
181+
182+
#创建模板接口调用示例 : preset
183+
presetname = 'testpreset'
184+
description = 'just a demo'
185+
presetType = 'avop'
186+
param = {
187+
"preset": presetname,
188+
"description": description,
189+
"presettype": presetType,
190+
"param": {
191+
"f": "mp4",
192+
"AUDIO": {
193+
"acodec": "aac",
194+
"ar":"44100",
195+
"ab":"64k"
196+
},
197+
"VIDEO": {
198+
"vr": 25,
199+
"vb": "500k",
200+
"vcodec": "h264",
201+
"width": 640,
202+
"height": 360
203+
}
204+
}
205+
}
206+
res = client.preset(**param)
207+
print json.dumps(res)
208+
209+
#获取模板信息接口调用示例 : get_preset_detail
210+
res = client.get_preset_detail(preset = presetname)
211+
print json.dumps(res)
212+
167213
+ 更多
168214

169215
--------------------

examples/offline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,8 @@
9595

9696
#任务置顶接口调用示例 : top_task_by_task_id
9797
res = client.top_task_by_task_id(taskid = taskid)
98+
print json.dumps(res)
99+
100+
#查询任务META列表接口调用示例 : get_task_meta_info
101+
res = client.get_task_meta_info(taskid = taskid)
98102
print json.dumps(res)

kscore/data/offline/2016-09-19/service-2.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ operations:
7878
requestUri: /
7979
input:
8080
shape: TaskIDInstance
81+
GetTaskMetaInfo:
82+
name: GetTaskMetaInfo
83+
http:
84+
method: GET
85+
requestUri: /
86+
input:
87+
shape: TaskIDInstance
8188

8289
shapes:
8390
Preset:
@@ -90,8 +97,6 @@ shapes:
9097
max: 45
9198
PresetInstance:
9299
type: structure
93-
required:
94-
- preset
95100
members:
96101
preset:
97102
shape: Preset
@@ -102,10 +107,8 @@ shapes:
102107
shape: WithDetail
103108
TaskIDInstance:
104109
type: structure
105-
required:
106-
- taskid
107110
members:
108111
taskid:
109112
shape: TaskID
110113

111-
114+

0 commit comments

Comments
 (0)