Search in sources :

Example 1 with MonitorClient

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);
}
Also used : MonitorClient(io.cdap.cdap.client.MonitorClient) SystemServiceMeta(io.cdap.cdap.proto.SystemServiceMeta)

Aggregations

MonitorClient (io.cdap.cdap.client.MonitorClient)1 SystemServiceMeta (io.cdap.cdap.proto.SystemServiceMeta)1