Support Questions
Find answers, ask questions, and share your expertise

Cloudera Manager Java API returning null ReplicationSchedules

New Contributor

I am trying to implement the same logic mentioned here: https://blog.cloudera.com/how-to-automate-replications-with-cloudera-manager-api/

I am using Java API for Cloudera Manager:

 

<dependency>
    <groupId>com.cloudera.api</groupId>
    <artifactId>cloudera-manager-api</artifactId>
    <version>5.14.4</version>
</dependency>

 

 

Scala code snippet looks like: 

 

val clouderaManagerClientBuilder = new ClouderaManagerClientBuilder
val apiRootResourceV19 = clouderaManagerClientBuilder
          .withBaseURL(new URL(clouderaManagerURL))
          .withUsernamePassword(clouderaManagerUsername, clouderaManagerPassword)
          .disableTlsCertValidation
          .build
          .getRootV19

val servicesResourceV18 = apiRootResourceV19.getClustersResource.getServicesResource(clusterName)

apiServiceList.getServices.forEach { apiService: ApiService =>
    if (apiService.getType.equalsIgnoreCase("HDFS") || apiService.getType.equalsIgnoreCase("Hive")) {
        val replicationSchedules = apiService.getReplicationSchedules
        if(replicationSchedules == null)
             logger.error("null replication schedules")
    }
}

 

 While other methods of apiService is returning data, replicationSchedules is always coming as null; even though there are more than 30 schedules available.

0 REPLIES 0