Software Development Kit (SDK) and API Discussions

How to patch an Fpolicy event

Nate-Itkin
314 Views

Any ideas on why this fails? I have protocol and file-operations set. Thanks.

 

event = FpolicyEvent()

event.name = "read"

event.svm = {"uuid": svm_uuid}

event.get()

event.file_operations = {"read": True, "write": True}

event.patch()

 

====== 

Output from print(event):

FpolicyEvent({'protocol': 'nfsv3', 'file_operations': {'read': True, 'write': True}, 'volume_monitoring': False, 'monitor_fileop_failure': False, 'name': 'read', 'svm': {'uuid': '83794749-9b69-11ee-b897-005056b06c96'}})

 

=======

Traceback (most recent call last):
File "f2.py", line 22, in <module>
event.patch()
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/resources/fpolicy_event.py", line 963, in patch
poll_timeout=poll_timeout, **kwargs
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/utils.py", line 55, in wrapper
return on_api_fail(erro)
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/utils.py", line 78, in on_api_fail
raise NetAppRestError(cause=erro) from None
netapp_ontap.error.NetAppRestError: Caused by HTTPError('400 Client Error: Bad Request for url: https://192.168.0.101:44
3/api/protocols/fpolicy/83794749-9b69-11ee-b897-005056b06c96/events/read',): Required parameter is missing. Reason: Spe
cify either " -protocol and -file-operations " or " -protocol, -file-operations and -filters" or none of these three.

 

0 REPLIES 0
Public