use of io.cdap.cdap.client.MonitorClient in project cdap by caskdata.
the class GenerateClientUsageExample method monitorClient.
public void monitorClient() throws Exception {
// Construct the client used to interact with CDAP
MonitorClient monitorClient = new MonitorClient(clientConfig);
// Fetch the list of system services
List<SystemServiceMeta> services = monitorClient.listSystemServices();
// Fetch status of system transaction service
String serviceStatus = monitorClient.getSystemServiceStatus("transaction");
// Fetch the number of instances of the system transaction service
int systemServiceInstances = monitorClient.getSystemServiceInstances("transaction");
// Set the number of instances of the system transaction service
monitorClient.setSystemServiceInstances("transaction", 1);
}
Aggregations