Class RESTApiClusterManager

All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, ClusterManager

public class RESTApiClusterManager extends org.apache.hadoop.conf.Configured implements ClusterManager
A ClusterManager implementation designed to control Cloudera Manager ( clusters via REST API. This API uses HTTP GET requests against the cluster manager server to retrieve information and POST/PUT requests to perform actions. As a simple example, to retrieve a list of hosts from a CM server with login credentials admin:admin, a simple curl command would be curl -X POST -H "Content-Type:application/json" -u admin:admin \ "" This command would return a JSON result, which would need to be parsed to retrieve relevant information. This action and many others are covered by this class. A note on nomenclature: while the ClusterManager interface uses a ServiceType enum when referring to things like RegionServers and DataNodes, cluster managers often use different terminology. As an example, Cloudera Manager ( would refer to a RegionServer as a "role" of the HBase "service." It would further refer to "hbase" as the "serviceType." Apache Ambari ( would call the RegionServer a "component" of the HBase "service." This class will defer to the ClusterManager terminology in methods that it implements from that interface, but uses Cloudera Manager's terminology when dealing with its API directly. DEBUG-level logging gives more details of the actions this class takes as they happen. Log at TRACE-level to see the API requests and responses. TRACE-level logging on RetryCounter displays wait times, so that can be helpful too.