Closed albinpopote closed 6 months ago
Thank you for reporting an issue! If you haven't already joined our Discord community, then we invite you to do so. This is a great place to get help and ask questions from our community.
Hi @albinpopote,
It looks like the example in the official netapp_ontap documentation page is incorrect. You need to pass the SVM uuid as well as the local_cifs_group sid. The code would then look something like this:
print(list(LocalCifsGroupMembers.get_collection("<svm_uuid>", "<local_cifs_group.sid>")))
You can also refer to the official REST API documentation where the same example exists correctly using curl
Can you please try that out and let us know if it works. Thanks!
Best, Noor
Hello @noorbuchi,
Yes It works if you pass directly the arguments (*args) to the get_collection. It doesn't work if you try to use kwargs arguments on the get_collection function:
print(list(LocalCifsGroupMember.get_collection(**{'svm.uuid': '<svm_uuid>', 'local_cifs_group.sid': '<local_cifs_group.sid>'})
Thks for your help ^^
Glad to hear that it works!
For get_collection, netapp_ontap expects that all parent keys/path keys to be provided as *args. On the other hand, values passed as **kwargs are sent as query parameters in the REST request. I hope this clears it up.
Hello,
I try to use the LocalCifsGroupMembers class to associate local user(s) from an SVM to a local group (cifs workgroup). Based on the documentation: https://library.netapp.com/ecmdocs/ECMLP2885777/html/resources/local_cifs_group_members.html#overview, I try to simply get information of members on my local group "cifs_group":
When I try to request the LocalCifsGroupMembers with group SID:
print(list(LocalCifsGroupMembers.get_collection("S-1-5-21-1704451965-2597020852-3779635676-1001")))
I got the following NetAppRestError:
Could not compute the location of the LocalCifsGroupMembers collection. Values for ['svm.uuid', 'local_cifs_group.sid'] are required. Caused by AttributeError("'LocalCifsGroupMembers' object has no attribute 'svm'")
I've tried to pass the SID from user in place of the group SID, the complete local group response object, svm.uuid and local_cifs_group.sid as parameters but I got always the same error....
Environment: netapp-ontap 9.14.1.0 NetApp Release 9.11.1P12: Fri Sep 22 11:58:50 UTC 2023
Regards ^^