HewlettPackard / oneview-python

Python library for HPE OneView
https://github.com/HewlettPackard/oneview-python/wiki
Apache License 2.0
28 stars 27 forks source link

In OneView _ How do I get a list of scopes attached to the server profile not to the server hardware? #156

Closed zeshan1977 closed 3 years ago

zeshan1977 commented 3 years ago
OK.    oneview_client = OneViewClient(config)
OK   scopes = oneview_client.scopes
OK    server_hardwares = oneview_client.server_hardware
OK    server_profile_templates = oneview_client.server_profile_templates
OK   server_profiles = oneview_client.server_profiles
Not OK.. server_profille_list = server_profile.scopes 

******************
From Looking at the 
URI value it appears as if they are one and  the same, yet in the GUI we are able to set a scope 
Server_Hardware > Scope="foo_scope"
Server_Hardware>server_profile> Scope ??? .HOW DO WE access this?

*******************
VenkateshRavula commented 3 years ago

You can use get_scope_resource method which is available in scopes resource.

oneview_client = OneViewClient(config)
scopes = oneview_client.scopes

profile_uri = "/rest/server-profiles/xxxxxxx"
sp_scopes = scopes.get_scope_resource(profile_uri)
pprint(sp_scopes.data['scopeUris'])
zeshan1977 commented 3 years ago

I see thanks, I will test it out .For Now Closing the issue. Thank You