数字海洋cli实用程序的python包装器-doctl。
doctl的Python项目详细描述
python doctl
优秀的doctl命令行实用程序的python包装器,来自Digital Ocean。
用法
>>> import doctl
>>> for droplet in doctl.compute.droplet.list():
... print(droplet['name'])
pypi.kennethreitz.org
code.kennethreitz.org
build.kennethreitz.org
…
>>> for key in doctl.compute.ssh_key.list():
... print(key['name'])
Blink (iPad)
thoth
macbook
所有方法都返回python数据结构,包括时区感知的datetime对象。
注释
建议使用DIGITALOCEAN_ACCESS_TOKEN
环境变量。
可用命名空间
这个库覆盖了doctl的整个api表面,因此 名称空间可供您使用和享受:
compute.account
compute.action
compute.certificate
compute.domain
compute.domain_records
compute.droplet
compute.firewall
compute.floating_ip
compute.image
compute.image_action
compute.load_balancer
compute.plugin
compute.region_list
compute.size_list
compute.snapshot
compute.ssh_key
compute.tag
compute.volume
compute.volume_action
安装
$ pipenv install doctl