use of com.cloudera.api.swagger.model.ApiBulkCommandList in project cloudbreak by hortonworks.
the class ClouderaManagerRangerUtilTest method setupRoleRefreshResponse.
private void setupRoleRefreshResponse(boolean success) throws ApiException {
ApiCommand response = new ApiCommand();
response.setActive(Boolean.FALSE);
response.setSuccess(success);
ApiBulkCommandList apiBulkCommandList = new ApiBulkCommandList();
apiBulkCommandList.addItemsItem(response);
when(roleCommandsResourceApi.refreshCommand(eq(CLUSTER), anyString(), any())).thenReturn(apiBulkCommandList);
}
use of com.cloudera.api.swagger.model.ApiBulkCommandList 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());
}
Aggregations