from netapp_ontap import config, HostConnection
from netapp_ontap.resources import Node
config.CONNECTION = HostConnection('myfiler.example.com', username='admin', password='mypass', verify=False)
for n in Node.get_collection(fields='controller'):
pass
Then I get a traceback:
Traceback (most recent call last):
File "test.py", line 6, in <module>
for n in Node.get_collection(fields='controller'):
File "/home/pedro/venv/lib64/python3.6/site-packages/netapp_ontap/resource.py", line 640, in _get_collection
obj = cls.from_dict(record, *args)
File "/home/pedro/venv/lib64/python3.6/site-packages/netapp_ontap/resource.py", line 486, in from_dict
raise NetAppRestError(cause=exc) from None
netapp_ontap.error.NetAppRestError: Caused by ValidationError({'controller': {'frus': {0: {'id': ['"FAN1" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 1: {'id': ['"FAN3" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 2: {'id': ['"FAN2" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 3: {'id': ['"PSU1" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 4: {'id': ['"PSU2" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 5: {'id': ['"DIMM-4" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 6: {'id': ['"DIMM-3" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 7: {'id': ['"DIMM-2" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 8: {'id': ['"DIMM-1" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 9: {'id': ['"NVRA" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}, 10: {'id': ['"BOOT MEDIA" could not be interpreted as a valid size. Valid values are of the form \\d+[KB|MB|GB|TB|PB]']}}}},)
The problem is in netapp_ontap/models/node_controller_frus.py:22 where the NodeControllerFrusSchema indicates that the id field is a "Size". If I change it to be a "fields.Str" then it works as expected.
Can someone here help get this fixed?