NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Python Discussions

FileDirectorySecurity call in Python library not returning anything

Greg_pebkac
5,154 Views

We have just upgraded to ONTAP 9.9.1 so I upgraded our Python library to 9.9.1 as I need to retrieve/update the NTFS permissions using the FileDirectorySecurity module.

However when I perform a get I'm not getting any return.
The call isn't erroring out even when I use incorrect filters.
Example of code ( which is direct copy from the documentation - https://library.netapp.com/ecmdocs/ECMLP2876965/html/resources/file_directory_security.html)
###
resource = FileDirectorySecurity(path="na_student_videos",**{"svm.uuid": "2059c57e-04b3-11e9-a63b-00a09899b75b"})
resource.get
print (resource)
###

When I test the REST API call using curl it returns data as expected.
curl -u XXXX -X GET "https://array-name/api/protocols/file-security/permissions/2059c57e-04b3-11e9-a63b-00a09899b75b/%2Fna_student_videos/?fields=acls&return_records=true&..." -H "accept application/hal+json"

Has anyone used the FileDirectorySecurity module or can provide advice on why it's not working.

1 ACCEPTED SOLUTION

Greg_pebkac
5,021 Views

I've had a response from the NetApp developers and they have confirmed that this is a bug in the library code to be fixed in a future release.
In the meantime will need to use the python requests library for the endpoint (api/protocols/file-security/permissions) to retrieve the information.
Unfortunately that means recoding my scripting and having to use different methodology to the other calls as I am trying to use the python module.

View solution in original post

2 REPLIES 2

Greg_pebkac
5,022 Views

I've had a response from the NetApp developers and they have confirmed that this is a bug in the library code to be fixed in a future release.
In the meantime will need to use the python requests library for the endpoint (api/protocols/file-security/permissions) to retrieve the information.
Unfortunately that means recoding my scripting and having to use different methodology to the other calls as I am trying to use the python module.

tahmad
4,884 Views

Thank you for the update @Greg_pebkac 

Public