Search in sources :

Example 1 with RoleCommandsResourceApi

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

the class ClouderaManagerRangerUtil method triggerRoleRefresh.

private ApiCommand triggerRoleRefresh(ApiClient client, String clusterName, String serviceName, String roleName) throws ApiException {
    LOGGER.info("Trigerring role refresh on clusterName = {}, serviceName = {}, roleName = {}", clusterName, serviceName, roleName);
    ApiRoleNameList roleNameList = new ApiRoleNameList();
    roleNameList.addItemsItem(roleName);
    RoleCommandsResourceApi roleCommandsResourceApi = clouderaManagerApiFactory.getRoleCommandsResourceApi(client);
    ApiBulkCommandList bulkResponse = roleCommandsResourceApi.refreshCommand(clusterName, serviceName, roleNameList);
    return Iterables.getOnlyElement(bulkResponse.getItems());
}
Also used : ApiRoleNameList(com.cloudera.api.swagger.model.ApiRoleNameList) RoleCommandsResourceApi(com.cloudera.api.swagger.RoleCommandsResourceApi) ApiBulkCommandList(com.cloudera.api.swagger.model.ApiBulkCommandList)

Aggregations

RoleCommandsResourceApi (com.cloudera.api.swagger.RoleCommandsResourceApi)1 ApiBulkCommandList (com.cloudera.api.swagger.model.ApiBulkCommandList)1 ApiRoleNameList (com.cloudera.api.swagger.model.ApiRoleNameList)1