Just a simple method to delete a service in Ambari using the REST API…
[root@ambari2012 ~]# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.56.121:8080/api/v1/clusters/ambari2012/services/RANGER [root@ambari2012 ~]# curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.56.121:8080/api/v1/clusters/ambari2012/services/RANGER { "status" : 404, "message" : "org.apache.ambari.server.controller.spi.NoSuchResourceException: The specified resource doesn't exist: Service not found, clusterName=ambari2012, serviceName=RANGER" }[root@ambari2012 ~]#