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:

I am using Java API for Cloudera Manager:





Scala code snippet looks like: 


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

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.