Rest API Get group options not working.

Gridlok

Cadet
Joined
Feb 24, 2021
Messages
5
I work in an environment where creating large numbers of shares is a regular occurrence, and all the shares I create will need to be assigned to different groups in Active Directory. So I am using the API to create shares and am trying to assign the Filesystem ACL to AD group, I have the Share ACL assignment working fine, but I am struggling with the Filesystem ACL. I think for the folders I need to first get the group ID and then assign that to the Directory.

In the API docs, it says the following.

Groups from directory services such as NIS, LDAP, or Active Directory will be included in query results if the option {'extra': {'search_dscache': True}} is specified.

But that is on a Get command, I can't add JSON to the body of a GET request. How to I specify this option? I tried putting it into the header option but it didn't work.

CURL tests I am doing look like this.

curl -X GET "http://10.30.163.35/api/v2.0/group" -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -d "{\"options\":{\"extra\":{\"search_dscache\": true}}}"

This returns {"message": "The following attributes are not expected: options"}

And this:
curl -X GET "http://10.30.163.35/api/v2.0/group" -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -d "{\"extra\": {\"search_dscache\": true}}"

This returns {"message": "The following attributes are not expected: extra"}

If I do the first with -H to make it a header like so:

curl -X GET "http://10.30.163.35/api/v2.0/group" -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -H "{\"options\":{\"extra\":{\"search_dscache\": true}}}"

I get only the local groups on the truenas and not the AD groups.

Is anyone able to show me what I am doing wrong?
 
Top