用于轻松访问leaseweb api的python客户端库
lswapi的Python项目详细描述
python模块与leaseweb的api对话。
有关更多信息,请参阅 [http://developer.leaseweb.com]
安装
使用pip安装模块:
pip install lswapi
用法
函数创建leaseweb api的一个实例 使用x-lsw-auth键的对象。可以将api密钥作为参数提供 获取最新的API
$ python >>> import lswapi >>> client = lswapi.get_leaseweb_api(api_key="xxxx-xxx-xxxxxx") >>> response = client.get("/bareMetals/v2/servers") >>> servers = response.json()
或者作为环境变量
$ LSW_API_KEY=xxxx-xxxx-xxxxx python >>> import lswapi >>> client = lswapi.get_leaseweb_api() >>> response = client.get("/bareMetals/v2/servers") >>> servers = response.json()
贡献
- 叉开它
- 创建您的功能分支(git checkout-b my new feature)
- 提交更改(git commit-am'add some feature')
- 确保测试通过(进行测试)
- 推到分支(git push origin my new feature)
- 创建新的拉取请求