Created 04-15-2020 09:33 PM
What will be the Equivalent Curl commend for hdfs dfs -chown <owner> -R <path>
I
Created 04-16-2020 05:47 AM
@sarm In order to execute hdfs commands via curl you will need to use WEBHDFS Rest API:
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html
From link above I was able to find this:
Submit a HTTP PUT request.
curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER [&owner=<USER>][&group=<GROUP>]"
Created 04-16-2020 06:07 AM
@stevenmatison Thanks for the Update
The commend you mention will change the owner and group for the Path we are giving
It will not change the owner and group for all the files under the directory
I am looking for the curl to change the owner and group permissions recursively
Created 04-16-2020 06:40 AM
@sarm Ah yes sorry about missing the -R.... I am not sure you can do this with a single common via the api. HDFS command line method would be preferred. That said, depending on how you interact with the API, you could programmatically complete the api calls for individual folders and files that would be effected by a -R in command line.