Skip to main content
aggo
Gold ⭐️
August 16, 2023
Solved

REST API command to upload Tez tar files

Hello, 

I'm trying to upload the tez tar files using a rest api command, but I'm not able to find any in the swagger documentation (maybe I just missed it..)

I've tried replicating the url that is pointed at when using the button through the UI, but I require the Tez service ID for it, and I couldn't find an API call to get that neither.. 

Is there an easier way to do this perhaps? Or if you know about one of the api calls I'm missing from the swagger docs mentioned above, that would help me as well. 

Thanks!

aggo
aggoAnswer
Gold ⭐️
August 18, 2023
tez_version="0.9.1.7.1.3.0-100"                                                              
export HADOOP_USER_NAME=hdfs
hdfs dfs -mkdir -p /user/tez/$tez_version
hdfs dfs -chown tez:hadoop /user/tez/$tez_version
hdfs dfs -chmod 0755 /user/tez/$tez_version
hdfs dfs -put /opt/cloudera/parcels/CDH/lib/tez/tez.tar.gz /user/tez/$tez_version/tez.tar.gz
hdfs dfs -chown tez:hadoop /user/tez/$tez_version/tez.tar.gz
hdfs dfs -chmod 0644 /user/tez/$tez_version/tez.tar.gz

These are the commands I ended up using. 

3 replies

DianaTorres
Community Manager
Community Manager
August 16, 2023

@aggo Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our Tez experts @Shmoo @cravani  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
aggo
aggoAuthor
Gold ⭐️
August 17, 2023

After looking some more in the forums, I realise that to do this I can enable WebHDFS and use the Snakebite library. However, that's not how i will go about this.
I'm trying to get it working using hdfs in the command line, but so far I'm not being able to replicate what the UI does. I will report back when I have a working solution. (sorry for the edits)

Translate
aggo
aggoAuthorAnswer
Gold ⭐️
August 18, 2023
tez_version="0.9.1.7.1.3.0-100"                                                              
export HADOOP_USER_NAME=hdfs
hdfs dfs -mkdir -p /user/tez/$tez_version
hdfs dfs -chown tez:hadoop /user/tez/$tez_version
hdfs dfs -chmod 0755 /user/tez/$tez_version
hdfs dfs -put /opt/cloudera/parcels/CDH/lib/tez/tez.tar.gz /user/tez/$tez_version/tez.tar.gz
hdfs dfs -chown tez:hadoop /user/tez/$tez_version/tez.tar.gz
hdfs dfs -chmod 0644 /user/tez/$tez_version/tez.tar.gz

These are the commands I ended up using. 

Translate