Package: hpeOneView
HPE OneView SDK for PythonBuild StatusOV Version8.708.608.508.408.308.208.108.007.207.107.006.606.506.406.306.206.106.005.60SDK Version/Tagv8.7.0v8.6.0v8.5.1v8.4.0v8.3.0v8.2.0v8.1.0v8.0.0v7.2.0v7.1.0v7.0.0v6.6.0v6.5.0v6.4.0v6.3.0v6.2.0v6.1.0v6.0.0v5.6.0Build StatusIntroductionHPE OneView makes it simple to deploy and manage today’s complex hybrid cloud infrastructure. HPE OneView can help you transform your data center to software-defined, and it supports HPE’s broad portfolio of servers, storage, and networking solutions, ensuring the simple and automated management of your hybrid infrastructure. Software-defined intelligence enables a template-driven approach for deploying, provisioning, updating, and integrating compute, storage, and networking infrastructure.The HPE OneView Python library provides a pure Python interface to the HPE OneView REST APIs. It depends on thePython-Futurelibrary to provide Python 2/3 compatibility.You can find the latest supported HPE OneView Python SDKhereRefer toSupported HPE OneView PythonAPIs Implementationand
Latest version of the OneView PythonSDK DocumentationWhat's NewHPE OneView Python library extends support of the SDK to OneView REST API version 6000 (OneView v8.70)Migration scriptPerform migration from HPE OneView 6.x to HPE OneView 7.0 for non-Synergy appliance using below script.$gitclonehttps://github.com/HewlettPackard/oneview-python.git$cdoneview-python/examples/migration/$pythonmigrate.py[<listofserverhardwwarenamestobemigrated>]Please refer tonotesfor more information on the changes , features supported and issues fixed in this versionGetting StartedHPE OneView SDK for Python can be installed from Source,Pypi and Docker container installation methods.From Source$gitclonehttps://github.com/HewlettPackard/oneview-python.git
$cdoneview-python$pythonsetup.pyinstall--user# to install in the user directory (~/.local)$sudopythonsetup.pyinstall# to install globallyOr using PIP:$gitclonehttps://github.com/HewlettPackard/oneview-python.git$cdoneview-python$pipinstall.From Pypi$gitclonehttps://github.com/HewlettPackard/oneview-python.git
$cdoneview-python$pipinstallhpeOneViewFrom Docker Image / ContainerClone this repo and cd into it:$gitclonehttps://github.com/HewlettPackard/oneview-python.git
$cdoneview-pythonBuild the docker image:$dockerbuild-toneview-python.Now you can run any of the example in this directory:
Run the container, passing in your credentials to OneView and specifying which example recipe to run.-v: The volume on which repo code is mountedReplaceconnection_templateswith the name of the example you'd like to runReplacepwdwith the path of the example file you'd like to run.$dockerrun-it--rm\-v$(pwd)/:/root/oneview/pythonexamples/connection_templates.pyRunning Examples with published docker imageWe also provide a lightweight and easy way to test and run oneview-python. The hewlettpackardenterprise/hpe-oneview-sdk-for-python: docker image
contains an installation of oneview-python installation you can use by just pulling down the Docker Image:The Docker Store image tag consist of two sections: <sdk_version-OV_version>Download and store a local copy of hpe-oneview-sdk-for-python and use it as a Docker image.$dockerpullhewlettpackardenterprise/hpe-oneview-sdk-for-python:v8.7.0-OV8.7Run docker commands and this will in turn create sh session where you can create files, issue commands and execute the tests$dockerrun-ithewlettpackardenterprise/hpe-oneview-sdk-for-python:v8.7.0-OV8.7/bin/shConfigurationJSON:Connection properties for accessing the OneView appliance can be set in a JSON file.
Before running the samples or your own scripts, you must create the JSON file. An example can be found at: OneView configuration sample.Note: If you have an active and valid login session and want to use it, define the sessionID in the Credentials. When sessionID is defined, you can remove username
and password from your JSON (they will be disregarded anyway).Once you have created the JSON file, you can initialize the OneViewClient:fromhpeOneView.oneview_clientimportOneViewClientoneview_client=OneViewClient.from_json_file('/path/config.json'):lock: Tip: Check the file permissions because the password is stored in clear-text.Environment Variables:Configuration can also be defined through environment variables:RequiredexportONEVIEWSDK_IP='172.16.102.82'exportONEVIEWSDK_USERNAME='Administrator'exportONEVIEWSDK_PASSWORD='secret123'Or sessionIDexportONEVIEWSDK_SESSIONID='123'Once you have defined the environment variables, you can initialize the OneViewClient using the following code snippet:fromhpeOneView.oneview_clientimportOneViewClientoneview_client=OneViewClient.from_environment_variables():lock: Tip: Make sure no unauthorized person has access to the environment variables, since the password is stored in clear-text.Note: If you have an active and valid login session and want to use it, define theONEVIEWSDK_SESSIONID. When a sessionID is defined, it will be used for
authentication (username and password will be ignored in this case).Dictionary:# You can also set the configuration using a dictionary. As described above, for authentication you can use username/password:config={"ip":"172.16.102.82","credentials":{"userName":"Administrator","password":"secret123"}}#Or if you have an active and valid login session and want to use it, define the sessionID in the Credentials:config={"ip":"172.16.102.82","credentials":{"sessionID":"123"}}# If you need to use a proxy server, You can add the same in config dictionary as below:config={"ip":"172.16.102.82","proxy":"1.2.3.4:8080","credentials":{"userName":"Administrator","password":"secret123"}}fromhpeOneView.oneview_clientimportOneViewClientoneview_client=OneViewClient(config):lock: Tip: Check the file permissions because the password is stored in clear-text.For more details on the Installation , Configuration , Logging , Troubleshooting refer toWIKI# Installation & Configuration section.HPE Synergy Image StreamerFrom Release 8.1, Image streamer is no longer supported.Getting HelpAre you running into a road block? Have an issue with unexpected bahriov? Feel free to open a new issue on theissue trackerFor more information on how to open a new issue refer toHow can I get help & supportLicenseThis project is licensed under the Apache license. Please seeLICENSEfor more information.Additional ResourcesHPE OneView DocumentationHPE OneView Release NotesHPE OneView Support MatrixHPE OneView Installation GuideHPE OneView User GuideHPE OneView Online HelpHPE OneView REST API ReferenceHPE OneView Firmware Management White PaperHPE OneView Deployment and Management White PaperHPE OneView CommunityHPE OneView Community ForumsLearn more about HPE OneView athpe.com/info/oneview