Search in sources :

Example 1 with ApiVersionInfo

use of com.cloudera.api.swagger.model.ApiVersionInfo in project cloudbreak by hortonworks.

the class ClouderaManagerConfigService method isVersionAtLeast.

private boolean isVersionAtLeast(Versioned requiredVersion, ClouderaManagerResourceApi resourceApiInstance) throws ApiException {
    ApiVersionInfo versionInfo = resourceApiInstance.getVersion();
    LOGGER.debug("CM version is {}, used version string {}", versionInfo, versionInfo.getVersion());
    if (isVersionNewerOrEqualThanLimited(versionInfo.getVersion(), requiredVersion)) {
        return true;
    }
    LOGGER.debug("Version is smaller than {}, not setting cdp_environment", requiredVersion.getVersion());
    return false;
}
Also used : ApiVersionInfo(com.cloudera.api.swagger.model.ApiVersionInfo)

Example 2 with ApiVersionInfo

use of com.cloudera.api.swagger.model.ApiVersionInfo in project cloudbreak by hortonworks.

the class ClouderaManagerConfigServiceTest method setUpCMVersion.

private void setUpCMVersion(String version) throws ApiException {
    ClouderaManagerResourceApi clouderaManagerResourceApi = mock(ClouderaManagerResourceApi.class);
    when(clouderaManagerApiFactory.getClouderaManagerResourceApi(any())).thenReturn(clouderaManagerResourceApi);
    ApiVersionInfo version701 = new ApiVersionInfo().version(version);
    when(clouderaManagerResourceApi.getVersion()).thenReturn(version701);
}
Also used : ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) ApiVersionInfo(com.cloudera.api.swagger.model.ApiVersionInfo)

Aggregations

ApiVersionInfo (com.cloudera.api.swagger.model.ApiVersionInfo)2 ClouderaManagerResourceApi (com.cloudera.api.swagger.ClouderaManagerResourceApi)1