class ClouderaManagerRoleRefreshService {

    void refreshClusterRoles(ApiClient client, Stack stack) throws ApiException, CloudbreakException {
        waitForGenerateCredentialsToFinish(stack, client);
        ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(client);
        ApiCommand refreshCommand = clustersResourceApi.refresh(stack.getCluster().getName());
        LOGGER.debug("Cluster role refresh has been started.");
        pollingRefresh(refreshCommand, client, stack);
        LOGGER.debug("Cluster role refresh finished successfully.");
    }

}