软层api库
SoftLayer的Python项目详细描述
软层API Python客户端图片::https://travis-ci.org/softlayer/softlayer-python.svg?branch=master
:目标:https://travis ci.org/softlayer/softlayer python
…图像::https://landscape.io/github/softlayer/softlayer python/master/landscape.svg
:目标:https://landscape.io/github/softlayer/softlayer python/master
图片::https://badge.fury.io/py/softlayer.svg
:目标:http://badge.fury.io/py/softlayer
…图片::https://workalls.io/repos/github/softlayer/softlayer-python/badge.svg?branch=master
:目标:https://coveralls.io/github/softlayer/softlayer-python?分支=主
…图像::https://build.snapcraft.io/badge/softlayer/softlayer python.svg
:目标:https://build.snapcraft.io/user/softlayer/softlayer python
此库提供了一个简单的python客户端,可与"softlayer"进行交互
xml-rpc api<;https://softlayer.github.io/reference/softlayerapi>;`.
还包括命令行界面,可用于管理各种软层产品和服务。
其他api文档可以在软层开发网络上找到:
*`softlayer api reference
<;http://developer.softlayer.com/reference/softlayerapi>;`\br/>*`object mask information and examples
<;http://developer.softlayer.com/article/object masks>;`\r/>*`代码示例
<;https://softlayer.github.io/python/>;`
安装
----
通过pip安装:
…代码块:bash
$pip install softlayer
,或者您可以从源代码安装。下载源代码并运行:
…代码块::bash
$python setup.py install
另一种(更安全的)安装方法是使用发布的快照。快照可用于运行snap的任何linux操作系统,snap是运行和管理快照的服务。快照是"自动更新"软件包,不会中断基于Linux系统上的库和软件包的当前版本。要了解更多信息,请访问:https://snapcraft.io/
安装slcli快照:
…代码块::bash
$sudo snap install slcli
此库的最新版本可以在http://github.com/softlayer的github公共存储库中找到。有关使用此库的问题,请在https://stack overflow.com/上发布到堆栈溢出,并在您的文章中添加"softlayer",以便我们的团队可以轻松找到您的文章。若要报告此库的错误,请在GitHub上创建一个问题。
InsecurePlatformWarning Notice
---------------------------
此库依赖于"requests<;http://docs.python requests.org/>;"库来发出HTTP请求。在python 2.7.9以下的python版本上,由于创建ssl连接的不安全性,请求已开始发出安全警告(insecureplatformwarning)。若要解决此问题,请升级到python 2.7.9+,或按照以下说明进行操作:http://stackoverflow.com/a/29099439。
击打他们。
Softlayer API本身的问题应该通过打开票证来解决。
examples
——
-----
要获取此库发出的确切api调用,可以执行以下操作。
对于cli,只需使用-vvv选项。如果您使用的是rest端点,这将输出一个curl命令,如果使用g XML,这将打印最小的Python代码,以便在没有软层库的情况下发出请求。
…代码块::bash
$slcli-vvvs list
代码bock::python
self.client=softlayer.client()
debugger=softlayer.debugtransport(self.client.transport)
self.client.transport=debugger
def main(self):
mask="mask[id]"
account=self.client.call('account','getobject',mask=mask);
print("accountid:%s%account['id'])
def debug(self):
用于调用self.client.transport.get_last_calls():
打印(self.client.transport.print_reproductable(call))
oftlayer api用户名和密钥。
*需要连接到softlayer的专用网络才能使用我们的专用网络api端点。
----
*six>;=1.7.0
*prettytable>;=0.7.0
*click>;=5,<;7
*requests>;=2.18.4
*prompt_toolkit>;=0.53
*pygments>;=2.0.0
*urllib3>;=1.22
版权所有
——
本软件版权所有(c)2016-2018 Softlayer Technologies,Inc.
有关详细信息,请参阅捆绑的许可文件。
:目标:https://travis ci.org/softlayer/softlayer python
…图像::https://landscape.io/github/softlayer/softlayer python/master/landscape.svg
:目标:https://landscape.io/github/softlayer/softlayer python/master
图片::https://badge.fury.io/py/softlayer.svg
:目标:http://badge.fury.io/py/softlayer
…图片::https://workalls.io/repos/github/softlayer/softlayer-python/badge.svg?branch=master
:目标:https://coveralls.io/github/softlayer/softlayer-python?分支=主
…图像::https://build.snapcraft.io/badge/softlayer/softlayer python.svg
:目标:https://build.snapcraft.io/user/softlayer/softlayer python
此库提供了一个简单的python客户端,可与"softlayer"进行交互
xml-rpc api<;https://softlayer.github.io/reference/softlayerapi>;`.
还包括命令行界面,可用于管理各种软层产品和服务。
其他api文档可以在软层开发网络上找到:
*`softlayer api reference
<;http://developer.softlayer.com/reference/softlayerapi>;`\br/>*`object mask information and examples
<;http://developer.softlayer.com/article/object masks>;`\r/>*`代码示例
<;https://softlayer.github.io/python/>;`
安装
----
通过pip安装:
…代码块:bash
$pip install softlayer
,或者您可以从源代码安装。下载源代码并运行:
…代码块::bash
$python setup.py install
另一种(更安全的)安装方法是使用发布的快照。快照可用于运行snap的任何linux操作系统,snap是运行和管理快照的服务。快照是"自动更新"软件包,不会中断基于Linux系统上的库和软件包的当前版本。要了解更多信息,请访问:https://snapcraft.io/
安装slcli快照:
…代码块::bash
$sudo snap install slcli
此库的最新版本可以在http://github.com/softlayer的github公共存储库中找到。有关使用此库的问题,请在https://stack overflow.com/上发布到堆栈溢出,并在您的文章中添加"softlayer",以便我们的团队可以轻松找到您的文章。若要报告此库的错误,请在GitHub上创建一个问题。
InsecurePlatformWarning Notice
---------------------------
此库依赖于"requests<;http://docs.python requests.org/>;"库来发出HTTP请求。在python 2.7.9以下的python版本上,由于创建ssl连接的不安全性,请求已开始发出安全警告(insecureplatformwarning)。若要解决此问题,请升级到python 2.7.9+,或按照以下说明进行操作:http://stackoverflow.com/a/29099439。
击打他们。
Softlayer API本身的问题应该通过打开票证来解决。
examples
——
-----
要获取此库发出的确切api调用,可以执行以下操作。
对于cli,只需使用-vvv选项。如果您使用的是rest端点,这将输出一个curl命令,如果使用g XML,这将打印最小的Python代码,以便在没有软层库的情况下发出请求。
…代码块::bash
$slcli-vvvs list
代码bock::python
debugger=softlayer.debugtransport(self.client.transport)
self.client.transport=debugger
def main(self):
mask="mask[id]"
account=self.client.call('account','getobject',mask=mask);
print("accountid:%s%account['id'])
def debug(self):
用于调用self.client.transport.get_last_calls():
打印(self.client.transport.print_reproductable(call))
oftlayer api用户名和密钥。
*需要连接到softlayer的专用网络才能使用我们的专用网络api端点。
*six>;=1.7.0
*prettytable>;=0.7.0
*click>;=5,<;7
*requests>;=2.18.4
*prompt_toolkit>;=0.53
*pygments>;=2.0.0
*urllib3>;=1.22
版权所有
——
本软件版权所有(c)2016-2018 Softlayer Technologies,Inc.
有关详细信息,请参阅捆绑的许可文件。