#Mapping 'export-policy check-access' command to equivalent private CLI call

1 messages · Page 1 of 1 (latest)

grim sigil
#

Need help in mapping export-policy check-access command to its equivalent private CLI endpoint. Tried both get and post operations and its giving me "invalid operation" error.

Below is the curl command i used:

curl -X POST "https://cluster/api/private/cli/vserver/export-policy/check-access" -H "accept: application/json" -H "authorization: Basic TOKEN" -d '{"vserver":"vservername", "volume":"volumename", "client_ip":"client-ip-addr", "authentication_method":"sys", "protocol":"nfs3", "access_type":"read-write", "qtree":"qtree-name"}' --insecure

below is the response recieved.
{
"error": {
"message": "invalid operation",
"code": "3"
}

oblique hill
#

Hi @grim sigil ,

For this request, you should definetly use GET instead of POST. And since it's a get operation, the body of the request should be empty. The fields you want to query should be added as query parameters instead of the body.

For example try something like this:
curl -X GET "https://cluster/api/private/cli/vserver/export-policy/check-access?vserver=vservername&volume=volumename&client_ip=addrs" etc

please let me know if this works

grim sigil
#

hi @oblique hill : was able to get the private CLI working as suggested by you.. thank you