超级基础设施上的Docker Py
hyper-sh的Python项目详细描述
超什
Docker PY适应了超高
它在其名称中使用下划线“\u”而不是“-”,就像原来的“超级”服务一样,但实际上您可以安装这两种拼写。
这是docker py的一个很薄的适配层,它可以与hyper的凭证方案一起工作
从PIP安装
pip install hyper_sh
如何使用
hyper_sh与docker py使用相同的api
from hyper_sh import Client c = Client() # without argument, config is guessed by reading ~/.hyper/config.json print c.images()
from hyper_sh import Client c = Client("path/to/config.json") # you can pass a specific config.json print c.images()
from hyper_sh import Client c = Client({'clouds': { os.environ['hyper_endpoint']: { "accesskey": os.environ['hyper_accesskey'], "secretkey": os.environ['hyper_secretkey'] } }}) # or you can give the content of a config.json directly print c.images()
API
目前,hyper-sh将1:1映射到docker py的api,这意味着有些api不起作用,因为它们不受hyper-cite支持。
https://docker-py.readthedocs.io
此模块还不支持其他一些由hyper\uu支持的api(即fip管理)。 欢迎使用修补程序。