23 Commits

Author SHA1 Message Date
Uggla
9094675555 Manage python3 compatibility
- Use future module to allow python2/3 compatibility.
- New dependencies added future and configparser.
2016-03-07 11:15:32 +01:00
Uggla
e699acf328 Some PEP8 cleanup 2016-02-13 19:55:34 +01:00
Uggla
89ae5f7d76 Add reset method for manager 2016-02-13 19:55:34 +01:00
Uggla
a2cafc9802 Change SystemCollection from list to dict
- Change systems_list to systems_dict["<index>"] .
  The systems_dict will contain system objects, <index> is
  the redfish <index> as reported inside url.
2016-02-13 19:55:34 +01:00
Uggla
c34d85fbc5 Documentation update
- Put in place sphinx mechanism to build documentation.
  Most of the documentation is generated from python docstrings.
- redfish-client.py usage is a bit modified to display a decent
  documentation.
- A link rfclient.py to redfish-client.py was created to allow sphinx
  parsing. The '-' char is not allowed for module and so sphinx autodoc
  module.
- Note : Copyright may need to be reviewed as well as main.py.
2016-02-11 16:20:00 +01:00
Uggla
173e7798cf Use Jinja2 template system to display manager info
- Use templating system, so user will be able to customize output.
- This could be use later to propose output in various format (html,
  xml, json).
- Undefined EthernetInterfacesCollection in case of failure. So it
  allows to test definition in the template or elsewhere.
2016-01-14 00:36:23 +01:00
Uggla
6ffbd4aec8 Add manager functions
- Add function get_managed_chassis.
- Add function get_managed_systems.
- Modiy mapping to handle proliant fw 2.40 bugs reporting :
  - links instead of Links.
  - href instead of @odata.id.
- I'll report this bug to redfish folks.
- Various PEP8 cleans.
2016-01-09 19:12:27 +01:00
Uggla
59a3e11c1b Finalise new EthernetInterfaces functions
- Add get_mac, get_fqdn, get_ipv4, get_ipv6.
2016-01-09 19:03:33 +01:00
Uggla
7b43449a84 Add a couple of new functions to EthernetInterfaces
- This is a WIP.
2016-01-04 23:22:14 +01:00
Uggla
301790c32c Work on EthernetInterfaces within types.py
- Change EthernetInterfacesCollection to not report a list but a dict.
  This change will be the same on *Collection.
- Factorise get_name function from Root to Base class as Name parameter
  seems defined for all kind of Redfish objects.
- Report first EthernetInterfaces data in redfish-client as
  an example --> need to be elaborated
2016-01-03 23:33:40 +01:00
Uggla
4b2b4ad5c6 Retrieve first part of manager data.
- Update type.py with new manager functions and manage exceptions.
- Retrieve some basic manager data from client getinfo.
2016-01-03 19:58:46 +01:00
Uggla
6c4bb1480a Work on types.py
- Change ManagersCollection to not report a list by a dict.
  The managers_dict will contain index --> manager object, index is the
  redfish index as reported inside url
- Notice that Proliant firmware now uses EthernetInterfaces as specified
  by Redfish
- Bug to be reported :
  /redfish/v1/Managers/1/EthernetInterfaces/1 returns invalid content (not json)
- Revert some changes on " to ' as it can break json data. Example :
  return self.set_parameter_json('{"Boot": {"BootSourceOverrideTarget":
  "'+target+'"},{"BootSourceOverrideEnabled" : "'+enabled+'"}}')
2016-01-03 00:30:53 +01:00
Uggla
5f42022b64 First round of PEP8 sanitization on types.py 2016-01-02 23:07:44 +01:00
Uggla
6b4db2baef Improve debug
- Try to factorise initialize_logger into redfish.config.
- Remove global logger declaration to avoid potential side effects.
- Add new logging.debug instead of print and try to cleanup.
- Allow logger.setlevel to be more flexible by configuring console and
  file level of log.
- Prepare client to allow optional debug parameter with loglevel
  selection.
2016-01-02 19:32:59 +01:00
Uggla
466534359c Improve error management
- Better handle connection errors.
- Better handle login errors.
- Improve exception process.
- Update examples.
	- Make examples compatible with new configuration file.
	- Show exception handling.
- Validate trusted SSL connection.
- Various PEP8 corrections.
2016-01-02 11:33:58 +01:00
Uggla
e92169956f Merge branch 'prototype' of https://github.com/vmisson/python-redfish into prototype.
Quick fix to allow library to run on the mockup.
Update the simple-simulator example.
Update redfish-client.
2015-12-02 20:54:51 +01:00
vmisson
6b296a79a3 Add comment 2015-12-02 20:54:51 +01:00
vmisson
6bc483a465 New function set_parameter and set_parameter_json on Systems Class
- set_parameter(parameter_name, value): change parameter_name to value. Restart is required to apply the changes.
- set_parameter_json(json): update System with the json. Restart is required to apply the changes.

New tests were added to simple-proliat file to update boot value.
2015-12-02 20:54:51 +01:00
vmisson
69122fa26d New classes in types.py: Bios & Boot
Creating Bios class to manage System/Bios:
- get_parameters()
- get_parameter(parameter_name)
- set_parameter(parameter_name, value)

Creating Boot class to manage System/Bios/Boot:
- get_parameters()
- get_parameter(parameter_name)
- set_parameter(parameter_name, value)

New tests in simple-porliant.py file
2015-12-02 20:54:51 +01:00
vmisson
4cae02c3c9 New function get_power() and generic function get_parameter(parameter_name) for class Systems
get_power(): return power state of the system
get_parameter(parameter_name): return parameter value based on the parameter_name
2015-12-02 20:54:51 +01:00
vmisson
c48f239792 Create new function: get_serialnumber. Tested with Simulator (v1) + Proliant v0.9.5 + Proliant v1.0 2015-12-02 20:54:51 +01:00
Bruno Cornec
f844afc49b First working 0.1 version
- Uses tortilla lib to wrap the REST API (dep)
- Uses python requests to manage login/logout (dep)
- Provides 2 functional working examples with Redfish simulator and
  ProLiant server or Moonshot Server
- Remove OpenStack deps as this code has to be usable outside of
  OpenStack
- Provides a configuration file to handle credentials and connection
  URL
- Provides a mapping class to handle multiple versions of Redfish
  (in this version, 0.95.0 for ProLiant and 1.0.0 for mockup)
- Provides a first action reset_server to ... reset system
  The action is commented into simple-proliant.py to not do
  unexpected reset.
- Provides a first retrieving function get_bios_version to get the
  BIOS version of a system.
- Add basic logging capability
- Clean up to meet pep8 and doc strings (in progress).
2015-12-02 20:33:03 +01:00
Devananda van der Veen
2a70e6e765 Refactoring and adding Types
Some big changes here:

Rename connection.py to server.py

Refactor about half of server.py into a new types.py module which builds
classes for each resource type, and auto-builds links to fetch
sub-resources from each type.

Add examples/walk-chassis.py to demonstrate how to use the Root and
Chassis classes to walk all the objects returned from /rest/v1/chassis/

Import oslo_log and start using it (more to do here, it's not working
quite yet).
2015-04-04 08:44:22 -07:00