- Community Home
- >
- Software
- >
- HPE OneView
- >
- HP oneview python SDK
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2020 08:47 AM
12-11-2020 08:47 AM
HP oneview python SDK
How do I get scope attached to piece of server hardware.
I cannot tie them as there is nothing common betweeen the scopes and the scopes assigned to a server hardwware.
I found scopesUri but they are very different between the two.
#########################################
def usage():
if len(sys.argv) < 2:
print("You have specified too few arguments","Usage >>"+ sys.argv[0]+ " oneviewIP [sample 19.14.3.210]")
print("FYI: This works on the basis of account readonly/readonly existing with the local domain of the appliance")
sys.exit()
try:
socket.inet_aton(sys.argv[1])
except socket.error:
print("You have an invalid IP Parameter","Usage >>"+ sys.argv[0]+ " oneviewIP [sample 19.14.3.210]")
sys.exit()
def parseandSetLoginParams():
#This is config json sample with all the attribs
#https://github.com/HewlettPackard/oneview-python/blob/master/examples/config-rename.json
config = {
"ip": sys.argv[1],
"credentials": {
"userName":"readonly",
"password":"readonly",
"authLoginDomain":"local"
}
}
return config
#################################################################
#Create Session
################################################################
def OneViewAttribs(lconfig):
try:
oneview_client = OneViewClient(lconfig)
except HPOneViewException:
print("ERROR:Cannot Connect OV: >>"+ sys.argv[1]+ " oneviewIP [sample: 19.14.3.210]")
sys.exit()
return oneview_client
#################################################################
#Off of the oneView object return , ov_scopes, server_hardwares and the dict pf scope->resource
################################################################
def returnobjectree(object):
oneview_client2=object
server_hardwares = oneview_client2.server_hardware
server_hardware_all = server_hardwares.get_all()
print("seer_hardware_all ")
pprint(server_hardware_all)
#################################################################
# Get scopes
################################################################
#Step A
ov_scopes=oneview_client2.scopes
retlistdict=ov_scopes.get_all()
print ("retlistdict .ovscopes ---> ")
pprint(retlistdict)
return (retlistdict,server_hardware_all)
if __name__ == "__main__":
usage()
returnobjectree(OneViewAttribs(parseandSetLoginParams()))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 07:38 AM
12-14-2020 07:38 AM
Re: HP oneview python SDK
I would suggest you post this on the HPE OneView Python SDK issue tracker.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
