Giter Site home page Giter Site logo

python-ibmcclient's Introduction

python-ibmcclient

https://travis-ci.org/IamFive/python-ibmcclient.svg?branch=master

python-ibmcclient is a Python library to communicate with HUAWEI iBMC based systems.

The goal of the library is to be extremely simple, small, have as few dependencies as possible and be very conservative when dealing with BMCs by access HTTP REST API provided by HUAWEI iBMC based systems.

Currently, the scope of the library has been limited to supporting OpenStack Ironic ibmc driver

Requirements

Python 2.7 and 3.4+

Installation

From PyPi:

$ pip install python-ibmcclient

or

$ easy_install python-ibmcclient

Or from source:

$ python setup.py install

Getting Started

Please follow the Installation and then run the following:

from __future__ import print_function
from pprint import pprint

import ibmc_client
from ibmc_client import constants

# ibmc server
address = "https://example.ibmc.com"
# credential
username = "username"
password = "password"
# disable certification verify
verify = False

with ibmc_client.connect(address, username, password, verify) as client:
    # get system
    system = 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 system
    client.system.reset(constants.RESET_FORCE_RESTART)

    # set boot source override
    client.system.set_boot_source(constants.BOOT_SOURCE_TARGET_PXE,
                                  constants.BOOT_SOURCE_MODE_BIOS,
                                  constants.BOOT_SOURCE_ENABLED_ONCE)

python-ibmcclient's People

Contributors

dtantsur avatar iamfive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dtantsur

python-ibmcclient's Issues

The page required does not exist.

When try to connect to iBMC server getting below Traceback.

iBMC response -> GET http://172.16.24.205//redfish/v1, code: 404, response: b'The page required does not exist.'
Error response from GET http://172.16.24.205//redfish/v1 with status code 404 has no JSON body
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/ibmc_client/connector.py", line 155, in request
headers=headers)
File "/usr/lib/python3.6/site-packages/ibmc_client/connector.py", line 210, in _request
res.raise_for_status()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://172.16.24.205//redfish/v1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "ibmc_config.py", line 15, in
with ibmc_client.connect(address, username, password, verify) as client:
File "/usr/lib/python3.6/site-packages/ibmc_client/init.py", line 32, in connect
return IBMCClient(address, username, password, verify_ca)
File "/usr/lib/python3.6/site-packages/ibmc_client/init.py", line 43, in init
self.connector = Connector(address, username, password, verify_ca)
File "/usr/lib/python3.6/site-packages/ibmc_client/connector.py", line 50, in init
self._meta = self.request(constants.GET, self.base_url).json()
File "/usr/lib/python3.6/site-packages/ibmc_client/connector.py", line 178, in request
raise exceptions.raise_for_response(method, url, response)
File "/usr/lib/python3.6/site-packages/ibmc_client/exceptions.py", line 230, in raise_for_response
raise ResourceNotFoundError(method, url, response)
ibmc_client.exceptions.ResourceNotFoundError: Resource http://172.16.24.205//redfish/v1 not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.