Skip to content

Commit 844ef10

Browse files
committed
Merge remote-tracking branch 'upstream/master'
Merge recent changes from upstream
2 parents f8002fb + f7125fd commit 844ef10

File tree

21 files changed

+5760
-223
lines changed

21 files changed

+5760
-223
lines changed

README.rst

Lines changed: 111 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ SDK 使用文档
44
A low-level interface to a growing number of KSC Web Services.
55

66

7-
87
----------------
98
Install 安装
109
----------------
1110

1211
+ pip 安装
13-
+ pip install kscore
12+
+ pip install ksc-sdk-python
1413

1514
+ github 安装
1615
+ 通过 `GitHub <https://github.com/liuyichen/kscore>`__ 下载
@@ -63,23 +62,33 @@ Service 服务
6362
| cn-shanghai-2 | 上海2区 |
6463
+-------------------+------------+
6564

66-
+ 服务列表 service_name, `详情参考API手册 <http://docs.ksyun.com>`__
6765

68-
+-------------------+------------+
69-
| service_name | 服务名 |
70-
+===================+============+
71-
| iam | |
72-
+-------------------+------------+
73-
| eip | |
74-
+-------------------+------------+
75-
| kec | |
76-
+-------------------+------------+
77-
| slb | |
78-
+-------------------+------------+
79-
| vpc | |
80-
+-------------------+------------+
81-
| monitor | |
82-
+-------------------+------------+
66+
+ 已支持服务列表 service_name,具体方法与API的Action对应,如kec服务RunInstances对应为run_instances方法。 `详情参考API手册 <http://docs.ksyun.com>`__
67+
68+
+-------------------+----------------+
69+
| service | 服务名 |
70+
+===================+================+
71+
| iam | 身份与访问控制 |
72+
+-------------------+----------------+
73+
| eip | 弹性IP |
74+
+-------------------+----------------+
75+
| kec | 云服务器 |
76+
+-------------------+----------------+
77+
| tag | 标签服务 |
78+
+-------------------+----------------+
79+
| slb | 负载均衡 |
80+
+-------------------+----------------+
81+
| kcs | REDIS |
82+
+-------------------+----------------+
83+
| vpc | 虚拟私有网络 |
84+
+-------------------+----------------+
85+
| cdn | 内容分发网络 |
86+
+-------------------+----------------+
87+
| monitor | 云监控 |
88+
+-------------------+----------------+
89+
| offline | 视频转码 |
90+
+-------------------+----------------+
91+
8392

8493
----------------
8594
Method 方法
@@ -165,8 +174,92 @@ Examples 示例
165174

166175
print json.dumps(m,sort_keys=True,indent=4)
167176

177+
+ OFFLINE
178+
179+
::
180+
181+
from kscore.session import get_session
182+
import json
183+
184+
if __name__=="__main__":
185+
186+
#初始化
187+
s = get_session()
188+
client = s.create_client("offline", "cn-beijing-6", use_ssl=False)
189+
190+
#创建模板接口调用示例 : preset
191+
presetname = 'testpreset'
192+
description = 'just a demo'
193+
presetType = 'avop'
194+
param = {
195+
"preset": presetname,
196+
"description": description,
197+
"presettype": presetType,
198+
"param": {
199+
"f": "mp4",
200+
"AUDIO": {
201+
"acodec": "aac",
202+
"ar":"44100",
203+
"ab":"64k"
204+
},
205+
"VIDEO": {
206+
"vr": 25,
207+
"vb": "500k",
208+
"vcodec": "h264",
209+
"width": 640,
210+
"height": 360
211+
}
212+
}
213+
}
214+
res = client.preset(**param)
215+
print json.dumps(res)
216+
217+
#获取模板信息接口调用示例 : get_preset_detail
218+
res = client.get_preset_detail(preset = presetname)
219+
print json.dumps(res)
220+
221+
+ CDN
222+
223+
::
224+
225+
from kscore.session import get_session
226+
227+
if __name__ == "__main__":
228+
# CDN API调用 详细示例位于 ./examples/cdn.py
229+
s = get_session()
230+
231+
client = s.create_client("cdn", use_ssl=False)
232+
233+
res = client.get_cdn_domains(PageSize=20,PageNumber=0,DomainStatus='online',CdnType='download')
234+
235+
print res
236+
168237
+ 更多
169238

239+
--------------------
240+
BUG FIXED 问题修正
241+
--------------------
242+
243+
+ CERTIFICATE_VERIFY_FAILED
244+
::
245+
246+
requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
247+
248+
+ 参考 `InsecurePlatformWarning <https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings>`__ 解决方法如下
249+
::
250+
251+
pip install requests[security]
252+
253+
+ 如 `build/temp.linux-x86_64-2.7/_openssl.c:433:30: fatal error: openssl/opensslv.h: No such file or directory` 解决方法如下
254+
::
255+
256+
yum install openssl-devel
257+
258+
+ 如 `build/temp.linux-x86_64-2.7/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory`解决方法如下
259+
::
260+
261+
yum install python-devel
262+
170263
--------------------
171264
Contact Information
172265
--------------------

0 commit comments

Comments
 (0)