Giter Site home page Giter Site logo

python-ilorest-library-old's Introduction

python-ilorest-library-old

https://travis-ci.org/HewlettPackard/python-ilorest-library.svg?branch=master https://img.shields.io/pypi/v/python-ilorest-library.svg?maxAge=2592000 https://img.shields.io/pypi/pyversions/python-ilorest-library.svg?maxAge=2592000 https://api.codacy.com/project/badge/Grade/1283adc3972d42b4a3ddb9b96660bc07
**The Python iLOrest Library team would like to inform you that this repository has reached its end of life. We will be continuing our efforts on the forked project directly from the DMTF repository. Click here to be redirected to the new project repository. **
HPE RESTful API for iLO is a RESTful application programming interface for the management of iLO and iLO Chassis Manager based HPE servers. REST (Representational State Transfer) is a web based software architectural style consisting of a set of constraints that focuses on a system's resources. iLO REST library performs the basic HTTP operations GET, POST, PUT, PATCH and DELETE on resources using the HATEOAS (Hypermedia as the Engine of Application State) REST architecture. The API allows the clients to manage and interact with iLO through a fixed URL and several URIs. Go to the wiki for more details.
pip install python-ilorest-library

Building from zip file source

python setup.py sdist --formats=zip (this will produce a .zip file)
cd dist
pip install python-ilorest-library-x.x.x.zip

Remote communication

No special requirements.

Inband communication

To enable support for inband communications, you must download the DLL/SO for your system from: windows / linux. It must be placed in your working environment path.
A large set of examples is provided under the examples directory of this project. In addition to the directives present in this paragraph, you will find valuable implementation tips and tricks in those examples.

Import the relevant python module

Depending on your desire to develop an HPE legacy REST or Redfish compliant application import the relevant python module.

For a legacy REST application:

       from _restobject import RestObject

For Redfish compliant application:
from _redfishobject import RedfishObject

Create a REST or Redfish Object

Both legacy REST and Redfish Objects contain 3 parameters: the target secured URL (i.e. "https://ilo-IP" or "https://X.Y.Z.T"), an iLO user name and its password. To create a REST object, call the RestObject method:
       REST_OBJ = RestObject(iLO_https_url, iLO_account, iLO_password)

To crete a Redfish Object, call the RedfishObject method:
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)

Login to the server

The login operation is performed when creating the REST_OBJ or REDFISH_OBJ. You can continue with a basic authentication, but it would less secure.
REST_OBJ.login(auth="session")

Perform a GET operation

A simple GET operation can be performed to obtain the data present in any valid path. An example of rawget operation on the path "/rest/v1/system/1" is shown below:
       response = REST_OBJ.get("/rest/v1/systems/1", None)

A safer implementation of GET operation is performed in the library. This method finds the path of requested data based on the selected type. This will allow for the script to work seamlessly with any changes of location of data. The response obtained is also validated against schema for correct return values.

Logout the created session

Make sure you logout every session you create as it will remain alive until it times out.
       REST_OBJ.logout()

A logout deletes the current sesssion from the system. The redfish_client and the rest_client object destructor includes a logout statement.
  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D
  • 04/01/2016: Initial Commit
  • 06/23/2016: Release of v1.1.0
  • 07/25/2016: Release of v1.2.0
  • 08/02/2016: Release of v1.3.0
  • 09/06/2016: Release of v1.4.0
  • 11/04/2016: Release of v1.5.0
  • 12/06/2016: Release of v1.6.0
  • 01/17/2017: Release of v1.7.0
  • 02/01/2017: Release of v1.8.0
  • 03/22/2017: Release of v1.9.0
  • 04/12/2017: Release of v1.9.1
Copyright 2016 Hewlett Packard Enterprise Development LP

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

python-ilorest-library-old's People

Contributors

aliciajackson avatar chriswrightris avatar danhp avatar daverickdunn avatar lumbajack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-ilorest-library-old's Issues

1.6.0 : ImportError: No module named _redfishobject

Hi,

I got an exception with 1.6.0 sdk.
There is only "redfish" dir in "site-packages" dir
Which one should I use ? redfish or RedfishObject ?

pip list result :
python-ilorest-library (1.6.0)

python -c "import RedfishObject" :
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named RedfishObject

Thanks

IML Log severity levels

Hi guys,

I'm trying to parse IML warnings and find it a little strange that serious errors such as the ones below all have a severity level of 'OK'. These errors are due to a CPU needing re-seating - can't get much more severe than that.

Following: Gen9 Troubleshooting Guide, there appears to be no information on the 'Class' and 'Code' attributes either. Save hard coding strings to match all the pertinent errors in that document, I'm not sure how I can classify critical errors easily, I imagine that's what the 'Severity' attribute is supposed to do.

Am I correct in thinking this is an issue, or am I misinterpreting what the severity attribute is actually supposed to indicate?

*The below is output from 'ex22_dump_iml.py'

OK: Class 5 / Code 3: Uncorrectable Machine Check Exception (Board 0, Processor 1, APIC ID 0x00000018, Bank 0x00000013, Status 0xFE200000'000C110A, Address 0x00000040'53500500, Misc 0xE8FCF016'1F002086)
OK: Class 20 / Code 5: Unrecoverable System Error (NMI) has occurred. System Firmware will log additional details in a separate IML entry if possible
OK: Class 8 / Code 2: Uncorrectable PCI Express Error (Embedded device, Bus 0, Device 2, Function 0, Error status 0x00000024)
OK: Class 5 / Code 3: Uncorrectable Machine Check Exception (Board 0, Processor 1, APIC ID 0x00000000, Bank 0x00000004, Status 0xF2000000'00400407, Address 0x00000000'00000000, Misc 0x00000000'00000000)
OK: Class 8 / Code 2: Uncorrectable PCI Express Error (Embedded device, Bus 0, Device 2, Function 0, Error status 0x0000002C)
OK: Class 5 / Code 3: Uncorrectable Machine Check Exception (Board 0, Processor 1, APIC ID 0x00000000, Bank 0x00000003, Status 0xB2000000'00800400, Address 0x00000000'71CBC3C0, Misc 0x00000000'00000085)
OK: Class 5 / Code 3: Uncorrectable Machine Check Exception (Board 0, Processor 1, APIC ID 0x00000010, Bank 0x00000003, Status 0xB2000000'00800400, Address 0x00000000'7FA0EB40, Misc 0x00000000'00700085)

Thanks.

RestObject - Not imported

Hi,

I've followed the installation as documented and it completed without errors.

quickstart.py works without issue, however all other scripts fail as follows:

File "ilo_change.py", line 17, in <module> from restobject import RestObject ImportError: No module named restobject

I'm not sure how to install that module?

server no access internet

I can't install with PIP
pip install python-ilorest-library-x.x.x.zip not run because my server has no access internet
how install lib ??

Input values are not validated before patch operation

Body is not validated before patch operation

For example: BIOS property patching
Actual: When user is trying to patching the property or value which is improper, the API doesn’t through any exception.

Expected: API should prompt proper exception.

Before patch operation validation of the body(property and value) is necessary and the all supported properties/values/field can be found http://h22208.www2.hpe.com/eginfolib/servers/docs/HPRestfultool/iLo4/data_model_reference.html

settings = { "PowerProfile": "MaxPerf"}
response = bios_rest_obj.patch(path = uri,
body = settings,
optionalpassword = None)

For property PowerProfile:
String containing one of the following supported values:
"BalancedPowerPerf" Balanced Power and Performance
"MinPower" Minimum Power Usage
"MaxPerf" Maximum Performance
"Custom" Custom

If user tries to patch any value other than the supported values then exception should be thrown.
Even if user tries with Property name being wrong then also it shouldn’t be supported(Example: settings = { "Invalid_Property_Name": "Invalid_Value"}

Issue after putting HPrest_chif.so file

**"This issue is coming after version 1.4.0"
It working fine till 1.4.0.

Please fix this as this comes for inband communication**

AttributeError: /root/python-ilorest-library/examples/Rest/hprest_chif.so: undefined symbol: size_of_responseHeaderBlob
Traceback (most recent call last):
File "/usr/local/lib/python2.7/logging/init.py", line 877, in emit
self.flush()
File "/usr/local/lib/python2.7/logging/init.py", line 837, in flush
self.stream.flush()
IOError: [Errno 9] Bad file descriptor
Logged from file v1.py, line 959

Detect changes not applied

Hi ,

When we use the REST API , somes changes are not applied because we need to trigger a reboot .

Can we read a property via the REST API to detect this need of reboot ?

Inband location links are broken

Both pages yield the following error:

Could not open page

The service or information you requested is not available at this time.
Please try again later.

(Error: system-websrv_unavail)

Link Status is different in ILO compared to API?

Hey,

I have several DL380 using 561T Adapters and using the redfish API I only seem to be able to pull out the data of 'enabled' or 'disabled' but not a link status. If I go into the remote console in the ILO I can clearly see that one of the interfaces has a Link Status 'Connected' and Link Speed Status of '10 Gbps Full'.

But when I use /redfish/v1/Systems/1/NetworkAdapters, I don't seem to have such values. In fact it actually appears as 'disabled' (quite misleading).

Is there anyway to get the link status of each Adapter?

Cheers,

  • Calvin

pip install python-ilorest-library doesn't work.

pip install isn't working, giving this error.

Could not fetch URL https://pypi.python.org/simple/python-ilorest-library/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) - skipping
Could not find a version that satisfies the requirement python-ilorest-library (from versions: )
No matching distribution found for python-ilorest-library

Looked into it, but can't find the project.

  • Searching for python-ilorest-library in the directory of: https://pypi.python.org/simple/
  • Gives no results. Can't find the project there manually either.

KeyError: 'Type'

Is the examples support hp Gen8 servers?
i run ex20_get_ilo_nic, ex09_find_ilo_mac_address

in line 103 _restobject.py throw KeyError: 'Type'
(rest examples)

Is it possible to get the iLO-jirc.jnlp file from REST API

Firmware 2.4.0 now offers java web start file to launch a Java Console access.

Is it possible to use a REST API call to generate the ILO-jirc.jnlp file?

This will allow me to bypass having to use the web interface to spawn a java console on linux. This will allow me spawn a console via python.

Thanks,
D

Any way of running Secure Erase on Drives using API?

Hi,

First, I love everything you guys are working on! I'm currently assigned a fairly painful project, in which I need to securely wipe all of the drives at one of our datacenters (400 Physicals, each has 2+ drives). I've looked absolutely everywhere through all the HP API stuff I can find, is there any way at all of triggering the Secure Erase using the API, or this PythonAPI? It would save me a TON of time!

I found several properties on the HpSmartStorageDiskDrive object, like EraseCompletionPercentage and ErasePattern, which makes me think it's possible, but I can't find any that actually initiate the command?

Thanks in advance!

Ken

Pass thru disks

Hey,
How can I check how much disks and size I have with rest API if i have only pass-through disks?

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.