Search in sources :

Example 1 with AssetDependencyResponse

use of com.emc.vipr.model.catalog.AssetDependencyResponse in project coprhd-controller by CoprHD.

the class AssetOptionService method getAssetDependencies.

@POST
@Path("/{assetType}/dependencies")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public AssetDependencyResponse getAssetDependencies(@PathParam("assetType") String assetType, AssetDependencyRequest request) {
    final Set<String> availableAssetTypes = request.getAvailableAssetTypes();
    final String sanitizedAssetType = SecurityUtils.stripXSS(assetType);
    log.info("Retrieving asset dependencies for " + sanitizedAssetType + " with available assets : " + StringUtils.join(availableAssetTypes, ", "));
    List<String> dependencies = assetOptionsManager.getAssetDependencies(sanitizedAssetType, availableAssetTypes);
    AssetDependencyResponse response = new AssetDependencyResponse();
    response.setAssetType(sanitizedAssetType);
    response.setAssetDependencies(dependencies);
    return response;
}
Also used : AssetDependencyResponse(com.emc.vipr.model.catalog.AssetDependencyResponse) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Aggregations

AssetDependencyResponse (com.emc.vipr.model.catalog.AssetDependencyResponse)1 Consumes (javax.ws.rs.Consumes)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1