How to use REST API to change "other" permissions of a file?

1 follower
0
Avatar

The documentation specifies the following but i'm not sure how to use it.

curl -u '<username>:<password>' -X PUT -H 'Content-Type:application/json' -d '{name="<group>",flags:{executable:<false> or <true>,readable:<false> or <true>,writable:<false> or <true>}}' 'http://<Datameer-serverIP>:<port-number>/api/filesystem/files/<file-id> or <uuid>/permission/others'
 
 
curl -u 'nikhil:password' -X PUT -H 'Content-Type:application/json' -d '{name="datameer_users",flags:{executable:true,readable:true,writable:false}}' 'http://10.11.12.131:8080/api/filesystem/files/<uuid>/permission/others'
 
I filled in the <uuid>  with the uuid of the artifact whose permission I am trying to change.
 
Am I doing something wrong ? because this keeps throwing an error.
 
Nikhil Srinidhi

1 comment

  • Avatar
    Gido

    Hello Nikhil,

    it seems that the command is not fully correct. Please try the following, which is working in my test environment

    curl -v -k -u "nikhil:<pass>" -w"\n%{http_code}\n" -X PUT -H 'Content-Type:application/json' -d "{executable:false,readable:false,writable:false}" "http://<IP>:8080/api/filesystem/files/<UUID>/permission/others"

    In general I like to recommend to use REST call with HTTP Status Code included 

    curl -s -k -u "<user>:<pass>" -w"\n%{http_code}\n" ...

    or with additional verbose messages for debugging purpose

    curl -v -k -u "<user>:<pass>" -w"\n%{http_code}\n" ...
    0
Please sign in to leave a comment.