|
1 | 1 | #!/usr/bin/python
|
2 | 2 | # -*- coding: UTF-8 -*-
|
3 |
| -from kscore.session import get_session |
| 3 | +from kscore.ket import getKetClient |
4 | 4 | import json
|
5 | 5 |
|
6 | 6 | 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) |
9 | 8 |
|
10 | 9 | uniqname = 'mytest'
|
11 | 10 | presetname = 'testpreset00'
|
|
34 | 33 | }
|
35 | 34 | ]
|
36 | 35 | }
|
37 |
| - res = client.preset(**param) |
| 36 | + res = client.Preset(param) |
38 | 37 | print json.dumps(res)
|
39 | 38 |
|
40 | 39 | # 更新模板
|
41 |
| - res = client.update_preset(**param) |
| 40 | + res = client.UpdatePreset(param) |
42 | 41 | print json.dumps(res)
|
43 | 42 |
|
44 | 43 | # 获取模板详情
|
45 |
| - res = client.get_preset_detail(App=appname, UniqName=uniqname, Preset=presetname) |
| 44 | + res = client.GetPresetDetail(App=appname, UniqName=uniqname, Preset=presetname) |
46 | 45 | print json.dumps(res)
|
47 | 46 |
|
48 | 47 | # 获取用户模板列表
|
49 |
| - res = client.get_preset_list(App=appname, UniqName=uniqname) |
| 48 | + res = client.GetPresetList(App=appname, UniqName=uniqname) |
50 | 49 | print json.dumps(res)
|
51 | 50 |
|
52 | 51 | # 删除模板
|
53 |
| - res = client.del_preset(App=appname, UniqName=uniqname, Preset=presetname) |
| 52 | + res = client.DelPreset(App=appname, UniqName=uniqname, Preset=presetname) |
54 | 53 | print json.dumps(res)
|
55 | 54 |
|
56 | 55 | # 启动外网拉流
|
|
61 | 60 | "App": appname,
|
62 | 61 | "Params": "a",
|
63 | 62 | }
|
64 |
| - res = client.start_stream_pull(**param1) |
| 63 | + res = client.StartStreamPull(param1) |
65 | 64 | print json.dumps(res)
|
66 | 65 |
|
67 | 66 | # 停止外网拉流
|
|
70 | 69 | "StreamID": streamid,
|
71 | 70 | "App": appname,
|
72 | 71 | }
|
73 |
| - res = client.stop_stream_pull(**param2) |
| 72 | + res = client.StopStreamPull(param2) |
74 | 73 | print json.dumps(res)
|
75 | 74 |
|
76 | 75 | # 获取转码任务列表
|
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) |
78 | 77 | print json.dumps(res)
|
79 | 78 |
|
80 | 79 | # 获取用户已占用配额
|
81 |
| - res = client.get_quota_used(UniqName=uniqname) |
| 80 | + res = client.GetQuotaUsed(UniqName=uniqname) |
82 | 81 | print json.dumps(res)
|
0 commit comments