Hortonworks : Ambari Rest API tricks

Rest API allows us to perform operations in a cluster more conveniently..

Edit the following property in ambari.properties

api.csrfPrevention.enabled=false

Getting details about a service

curl -u admin:admin -X GET http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICENAME

Eg:-

curl -u admin:admin -X GET  http://10.xx.xx.xx:8080/api/v1/clusters/CLUSTERNAME/services/FALCON

Deleting a service from a cluster

curl -u admin:admin -X DELETE  http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICENAME

Eg:-

curl -u admin:ucsambari -X DELETE http://machinename.com:8080/api/v1/clusters/CLUSTERNAME/services/KNOX

Write data / Copy file into HDFS

curl -i -X PUT -T $file -L “http://$namenode:50070/webhdfs/v1/$file?op=CREATE&user.name=$user”

Advertisements

About shalishvj : My Experience with BigData

6+ years of experience using Bigdata technologies in Architect, Developer and Administrator roles for various clients. • Experience using Hortonworks, Cloudera, AWS distributions. • Cloudera Certified Developer for Hadoop. • Cloudera Certified Administrator for Hadoop. • Spark Certification from Big Data Spark Foundations. • SCJP, OCWCD. • Experience in setting up Hadoop clusters in PROD, DR, UAT , DEV environments.
This entry was posted in Rest API, Uncategorized and tagged , , , . Bookmark the permalink.

One Response to Hortonworks : Ambari Rest API tricks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s