华为IBMC客户端
python-ibmcclient的Python项目详细描述
python ibmcclient
python ibmcclient是一个与华为通信的python库iBMC
基于系统。
图书馆的目标是非常简单,小,有
尽可能依赖,在处理BMC时非常保守
通过访问华为基于iBMC
的系统提供的http rest api。
目前,图书馆的范围仅限于支持
^{
要求。
python 2.7和3.4+
安装
来自PYPI:
$ pip install python-ibmcclient
或
$ easy_install python-ibmcclient
或来源:
$ python setup.py install
开始
请按照installation procedure操作,然后运行以下命令:
from__future__importprint_functionfrompprintimportpprintimportibmc_clientfromibmc_clientimportconstants# ibmc serveraddress="https://example.ibmc.com"# credentialusername="username"password="password"# disable certification verifyverify=Falsewithibmc_client.connect(address,username,password,verify)asclient:# get systemsystem=client.system.get()print('Power State: ')pprint(system.power_state)print('Boot Sequence: ')pprint(system.boot_sequence)print('Boot Source Override:')pprint(system.boot_source_override)# reset systemclient.system.reset(constants.RESET_FORCE_RESTART)# set boot source overrideclient.system.set_boot_source(constants.BOOT_SOURCE_TARGET_PXE,constants.BOOT_SOURCE_MODE_BIOS,constants.BOOT_SOURCE_ENABLED_ONCE)