Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Curl Commend for Changing HDFS Permission


What will  be the Equivalent Curl commend for hdfs dfs -chown <owner> -R <path>




@sarm In order to execute hdfs commands via curl you will need to use WEBHDFS Rest API:


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



@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 



@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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.