solidfire-sdk-python
solidfire-sdk-python copied to clipboard
ListVolumeQoSHistograms should probably ignore invalid requests
Asking for QoS histograms for 2 volumes, I get 32 back:
>>> params= {"VolumeIDs": [1]}
>>> qosh = sfe.invoke_sfapi("ListVolumeQoSHistograms", parameters=params)['qosHistograms']
2024-05-03 13:52:19,323 - solidfire.Element - INFO - {"method": "ListVolumeQoSHistograms", "id": 58, "params": {"VolumeIDs": [1]}}
>>> len(qosh)
32
After 2 hours of digging from the app to logic to API, another try:
>>> params = {"volumeIDs": [1, 2]}
>>> qosh = sfe.invoke_sfapi("ListVolumeQoSHistograms", parameters=params)['qosHistograms']
2024-05-03 13:52:01,419 - solidfire.Element - INFO - {"method": "ListVolumeQoSHistograms", "id": 57, "params": {"volumeIDs": [1, 2]}}
>>> len(qosh)
2
If you specify VolumeIDs instead of volumeIDs, you get all histograms back.
The API should probably warn or outright reject invalid params. Even if it's not a "bug" (SolidFire Python SDK docs don't say anything on this behavior and especially in this case it's invoke_sfapi and not some specific function), some users who come across this issue on Github may save time.