Search in sources :

Example 1 with ApiBulkCommandList

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);
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ApiBulkCommandList(com.cloudera.api.swagger.model.ApiBulkCommandList)

Example 2 with 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());
}
Also used : ApiRoleNameList(com.cloudera.api.swagger.model.ApiRoleNameList) RoleCommandsResourceApi(com.cloudera.api.swagger.RoleCommandsResourceApi) ApiBulkCommandList(com.cloudera.api.swagger.model.ApiBulkCommandList)

Aggregations

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