Skip to content

Commit 21acf13

Browse files
author
lijing
committed
update ket examples
1 parent 806808a commit 21acf13

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

examples/ket.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/usr/bin/python
22
# -*- coding: UTF-8 -*-
3-
from kscore.session import get_session
3+
from kscore.ket import getKetClient
44
import json
55

66
if __name__ == "__main__":
7-
s = get_session()
8-
client = s.create_client("ket", "cn-beijing-6", use_ssl=False)
7+
client = getKetClient("ket", "cn-beijing-6",use_ssl=False)
98

109
uniqname = 'mytest'
1110
presetname = 'testpreset00'
@@ -34,23 +33,23 @@
3433
}
3534
]
3635
}
37-
res = client.preset(**param)
36+
res = client.Preset(param)
3837
print json.dumps(res)
3938

4039
# 更新模板
41-
res = client.update_preset(**param)
40+
res = client.UpdatePreset(param)
4241
print json.dumps(res)
4342

4443
# 获取模板详情
45-
res = client.get_preset_detail(App=appname, UniqName=uniqname, Preset=presetname)
44+
res = client.GetPresetDetail(App=appname, UniqName=uniqname, Preset=presetname)
4645
print json.dumps(res)
4746

4847
# 获取用户模板列表
49-
res = client.get_preset_list(App=appname, UniqName=uniqname)
48+
res = client.GetPresetList(App=appname, UniqName=uniqname)
5049
print json.dumps(res)
5150

5251
# 删除模板
53-
res = client.del_preset(App=appname, UniqName=uniqname, Preset=presetname)
52+
res = client.DelPreset(App=appname, UniqName=uniqname, Preset=presetname)
5453
print json.dumps(res)
5554

5655
# 启动外网拉流
@@ -61,7 +60,7 @@
6160
"App": appname,
6261
"Params": "a",
6362
}
64-
res = client.start_stream_pull(**param1)
63+
res = client.StartStreamPull(param1)
6564
print json.dumps(res)
6665

6766
# 停止外网拉流
@@ -70,13 +69,13 @@
7069
"StreamID": streamid,
7170
"App": appname,
7271
}
73-
res = client.stop_stream_pull(**param2)
72+
res = client.StopStreamPull(param2)
7473
print json.dumps(res)
7574

7675
# 获取转码任务列表
77-
res = client.get_stream_tran_list(App=appname, UniqName=uniqname, StreamID=streamid, OutPull=outpull)
76+
res = client.GetStreamTranList(App=appname, UniqName=uniqname, StreamID=streamid, OutPull=outpull)
7877
print json.dumps(res)
7978

8079
# 获取用户已占用配额
81-
res = client.get_quota_used(UniqName=uniqname)
80+
res = client.GetQuotaUsed(UniqName=uniqname)
8281
print json.dumps(res)

0 commit comments

Comments
 (0)