许多人要求这样做,我很荣幸地宣布对Linode的libcloud的全面支持API!
libcloud是由Cloudkick的创始人进行的标准化工作,以应对云供应商API的标准化。我很荣幸能与Alex Polvi和libcloud的贡献者合作,将LinodeAPI集成到libcloud中;今天标志着每个人的成功。
使用libcloud(用Python ),一个简单的配方来重新启动你所有的Linodes,看起来就像这样:
from libcloud.providers import linode
driver = linode.LinodeNodeDriver("api_key")
for node in driver.list_nodes():
node.reboot()
libcloud的大部分功能集是非常抽象的;完整的LinodeAPI 所提供的定制功能很少可以用它来实现。在代码中做了许多假设,LinodeAPI 的许多内容被改编为libcloud,而不是反过来 - 只提供非常基本的功能,因为 libcloud 被设计为一个高级抽象层,而不是一个完整的解决方案。
对于大多数项目,你会想考虑完整的LinodeAPI 。
下面是libcloud的六个功能与LinodeAPI 的对应调用的粗略映射。
云计算 | LinodeAPI |
list_nodes | linode.list |
重新启动_节点 | linode.reboot |
destroy_node | linode.delete |
创建节点 | linode.create 读取磁盘,从分布中创建。 读取数据 读取配置,创建 镜像启动 |
列表_尺寸 | 利用.线路计划 |
列表_图像 | 利用.分布 |
libcloud目前只通过git提供。更多信息请见其GitHub项目页面。我个人的libcloud树也在GitHub上,这也是我将进行Linode开发的地方。
我希望libcloud能让你们中的许多人生活得更轻松。我鼓励大家积极测试和报告错误(我需要它们!),因为我无法测试所有可能的情况。享受吧!
评论 (4)
I’d probably still use Linode API, More choice is good though and I can see this being useful for some people.
Thanks!
Jed,
That is GREAT news.
Good work getting that in place.
-Dave
[…] may remember full libcloud support for Linode that we announced in September. It has been our privilege to work with the Cloudkick and libcloud teams to bring Linode support to […]
I know this is quite old – was wondering if you had considered any of the newer libraries (http://bit.ly/9pLiJs)