大脑bofh客户
bofh的Python项目详细描述
波夫
bofh,是hvermannsen的缩写 管理工具。在
它是用于
Cerebrum.modules.bofhd
服务器。你不太可能想用这个
除非你知道大脑是什么。在
安装
bofh是用Python实现的,它支持Python运行时2.7(>;=2.7.9
= RHEL7 2.7.5), and 3.6 or newer.
如果您在RHEL上,我们建议您安装bofh RPM包 从大学软件包存储库:
# dnf install pybofh
在其他系统上,我们建议从官方的Python包安装 索引(PyPI)到virtualenv:
^{pr2}$使用
pybofh --help
python -m bofh --help
模块使用
importbofhfromgetpassimportgetuser,getpass# Get a client by connecting to bofhdurl='https://example.org:8000'cacert='/path/to/ca.pem'client=bofh.connect(url=url,cert=cacert)# You'll need to authenticate to access restricted commandsclient.login(getuser(),getpass())# Call commands on the client objecttry:# formatted outputclient.user.info('foo')# structured outputclient.run_command('user_info','foo')finally:client.logout()
文件
您必须自己构建bofh文档(目前)。在
文档是使用sphinx构建的,构建需求是 在docs/requirements.txt文件中指定。在
% python setup.py build_sphinx -b html
% cd build/sphinx/html
% python3 -m http.server
然后转到http://localhost:8000/。在
还有一个bofh脚本的troff手册页,可以 建造方式:
% python setup.py build_sphinx -b man
% man ./build/sphinx/man/bofh.1
有关其他文档格式,请参见docs/README.md和docs/Makefile。在
- 项目
标签: