use of alien4cloud.rest.model.JsonRawRestResponse in project alien4cloud by alien4cloud.
the class DeploymentController method getByIds.
/**
* Bulk id request API.
*/
@ApiOperation(value = "Get a list of deployments from their ids.", authorizations = { @Authorization("ADMIN") })
@RequestMapping(value = "/bulk/ids", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('ADMIN')")
public JsonRawRestResponse getByIds(@RequestBody String[] deploymentIds) {
// Check topology status for this deployment object
MultiGetResponse response = alienDAO.getClient().prepareMultiGet().add(alienDAO.getIndexForType(Deployment.class), MappingBuilder.indexTypeFromClass(Deployment.class), deploymentIds).get();
JsonRawRestResponse restResponse = new JsonRawRestResponse();
restResponse.setData(ResponseUtil.rawMultipleData(response));
return restResponse;
}
use of alien4cloud.rest.model.JsonRawRestResponse in project alien4cloud by alien4cloud.
the class EnvironmentBulkController method getByIds.
/**
* Bulk id request API.
*/
@ApiOperation(value = "Get a list of environment from their ids.", authorizations = { @Authorization("ADMIN") })
@RequestMapping(value = "/bulk/ids", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('ADMIN')")
public JsonRawRestResponse getByIds(@RequestBody String[] deploymentIds) {
// Check topology status for this deployment object
MultiGetResponse response = alienDAO.getClient().prepareMultiGet().add(alienDAO.getIndexForType(ApplicationEnvironment.class), MappingBuilder.indexTypeFromClass(ApplicationEnvironment.class), deploymentIds).get();
JsonRawRestResponse restResponse = new JsonRawRestResponse();
restResponse.setData(ResponseUtil.rawMultipleData(response));
return restResponse;
}
Aggregations