开源软件名称(OpenSource Name):HewlettPackard/python-ilorest-library-old开源软件地址(OpenSource Url):https://github.com/HewlettPackard/python-ilorest-library-old开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):python-ilorest-library-oldPython iLOrest Library Announcement
Contents DescriptionHPE 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. Installingpip install python-ilorest-library Building from zip file sourcepython setup.py sdist --formats=zip (this will produce a .zip file)
cd dist
pip install python-ilorest-library-x.x.x.zip RequirementsRemote communicationNo special requirements. Inband communicationTo 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. UsageA 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
from _restobject import RestObject
For Redfish compliant application: from _redfishobject import RedfishObject Create a REST or Redfish ObjectBoth 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 serverThe 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 operationA 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 sessionMake 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. Contributing
History
Copyright and LicenseCopyright 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. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论