Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Curl Commend for Changing HDFS Permission

Highlighted

Curl Commend for Changing HDFS Permission

Explorer

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

 

I

3 REPLIES 3
Highlighted

Re: Curl Commend for Changing HDFS Permission

@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>]"

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Re: Curl Commend for Changing HDFS Permission

Explorer

@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 

 

 

Highlighted

Re: Curl Commend for Changing HDFS Permission

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

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Don't have an account?
Coming from Hortonworks? Activate your account here