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

What's the API CALL? #185

Closed zeshan1977 closed 2 years ago

zeshan1977 commented 2 years ago

I have got 10 enclosures/frame/with 9 Computer modules .Syn. Gen 10

In all thee enclosure/Frames I have virtual connect nodules,FrameLink Modules and Powersupply to the enclosure/chassis.

I need access the installed Firmware version And the Component Name for i)virtual connect module, ii) The Frame link Module iiii) The Power supply

How do I go about getting this via the python SDK ? I have looked at the examples and I am starting from looping so I don''t hav any names Below does not get me what I want

   logical_interconnects = oneview_client.logical_interconnects

   # Get all logical interconnects
   print("\nGet all logical interconnects")
   all_logical_interconnects = logical_interconnects.get_all()
   for logical_interconnect in all_logical_interconnects:
      #print('  Name: {name}').format(**logical_interconnect)
      #Get a logical interconnect by name
      #logical_interconnect = logical_interconnects.get_by_name(logical_interconnect_name)
      print("\nFound logical interconnect by name {name}.\n URI: {uri}").format(**logical_interconnect.data)
      print("who is jerry antrell 3rd try ")
      #print(logical_interconnect.data)
      #fw=logical_interconnect.get_firmware()
      pprint(logical_interconnect)

  """
zeshan1977 commented 2 years ago

Helllo Any update? I am able to get the model number of the Virtual Connect and the framelinkmod/fwversion but unable to procure the fw version of the VC.See Below , what should i use instead of ?????

pip install flatten_json

all_enclosures = oneview_client.enclosures.get_all()
    for enclosure in all_enclosures:
        flat_enc=(flatten(enclosure))

 virtual_connect_model_num=flat_enc.get('interconnectBays_1_interconnectModel',"NO VC in this ENC!")
 virtual_connect_model_firmware=flat_enc.get('???", "NO fwin this ENC!")
 frame_link_mod_name=flat_enc.get('managerBays_0_model',"NO FRAME LINK MOD !!!")
 frame_link_mod_fwversion=flat_enc.get('managerBays_0_fwVersion',"NO FRAMELINK VERNUM")

chebroluharika commented 2 years ago

Hi @zeshan1977, You can get firmware version of VC from get call of interconnects resource. Please try this out and let us know if this helps.

zeshan1977 commented 2 years ago

Which get Call, Please give examples. Do you mean the enclosure iterator

chebroluharika commented 2 years ago

Please look into this line in examples/interconnects.py https://github.com/HewlettPackard/oneview-python/blob/086f7de73f2a29a29340f51581b2755ee8ebaaec/examples/interconnects.py#L59 From this response, you can find firmware version.

ChrisLynchHPE commented 2 years ago

Firmware versions are not stored within logical resources. You must get that information from the physical device. In this specific case, getting the firmware version of a VC module needs to be from a GET /rest/interconnects API call, or the interconnects.py example script @chebroluharika provided.

zeshan1977 commented 2 years ago

Yes I got it. Thnks . Closing