Cloudera Manager(CM) 6.0 introduced new Java API client based on Swagger. This new API client supports all CM API versions.
Older Java client will still be supported for API version less than 30. So older Java API client can still be used against Cloudera Manager version 6.0 and later as long as API version 19 or earlier is used.
For example, you can use the old CM API client version 5.14 against CM version 6.0 which by default will invoke API version 19. If you want to use new features that were introduced in Cloudera Manager 6.0 (i.e. API version 30) like “Fine Grained Access Control” then you must use this new API client.
Older Java client and new Swagger based Java client can co-exist in an application to allow for incremental transition to new Swagger based java client.
NOTE: Beginning in API version 42, the types of some fields of Java API model objects have changed as compared with previous versions. Several fields that were previously represented as type BigDecimal have been migrated to type Integer. This applies to the new Swagger based Java client only.
Merge the following to your Maven project’s pom.xml
:
<project>
<repositories>
<repository>
<id>cm.repo</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
<name>Cloudera Repository</name>
</repository>
…
</repositories>
<dependencies>
<dependency>
<groupId>com.cloudera.api.swagger</groupId>
<artifactId>cloudera-manager-api-swagger</artifactId>
<version>7.2.4</version> <!-- or CM version 6.0 and above -->
</dependency>
…
</dependencies>
...
</project>
You can also directly download the jar(and sources) from the Cloudera repository.
Here is the latest SDK doc, for API version 43 (CM 7.2.4).
The above example invokes API over secure HTTPS channel. If TLS is not enabled on Cloudera Manager Admin Console then update the base path (setBasePath()) to point to right URL and TLS configuration (setVerifyingSSL(), setSslCaCert()) for API client can be dropped.