2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.sdc.be.externalapi.servlet;
\r
23 import java.io.ByteArrayInputStream;
\r
24 import java.io.InputStream;
\r
25 import java.util.EnumMap;
\r
26 import java.util.HashMap;
\r
27 import java.util.List;
\r
28 import java.util.Map;
\r
29 import javax.inject.Inject;
\r
30 import javax.inject.Singleton;
\r
31 import javax.servlet.http.HttpServletRequest;
\r
32 import javax.ws.rs.GET;
\r
33 import javax.ws.rs.HeaderParam;
\r
34 import javax.ws.rs.Path;
\r
35 import javax.ws.rs.PathParam;
\r
36 import javax.ws.rs.Produces;
\r
37 import javax.ws.rs.QueryParam;
\r
38 import javax.ws.rs.core.Context;
\r
39 import javax.ws.rs.core.MediaType;
\r
40 import javax.ws.rs.core.Response;
\r
41 import org.apache.commons.lang3.tuple.ImmutablePair;
\r
42 import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
\r
43 import org.openecomp.sdc.be.components.impl.ComponentBusinessLogicProvider;
\r
44 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
\r
45 import org.openecomp.sdc.be.components.impl.ElementBusinessLogic;
\r
46 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
\r
47 import org.openecomp.sdc.be.config.BeEcompErrorManager;
\r
48 import org.openecomp.sdc.be.dao.api.ActionStatus;
\r
49 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
\r
50 import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum;
\r
51 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
\r
52 import org.openecomp.sdc.be.ecomp.converters.AssetMetadataConverter;
\r
53 import org.openecomp.sdc.be.externalapi.servlet.representation.AssetMetadata;
\r
54 import org.openecomp.sdc.be.impl.ComponentsUtils;
\r
55 import org.openecomp.sdc.be.impl.ServletUtils;
\r
56 import org.openecomp.sdc.be.model.Component;
\r
57 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
\r
58 import org.openecomp.sdc.be.resources.data.auditing.model.DistributionData;
\r
59 import org.openecomp.sdc.be.resources.data.auditing.model.ResourceCommonInfo;
\r
60 import org.openecomp.sdc.be.servlets.AbstractValidationsServlet;
\r
61 import org.openecomp.sdc.be.servlets.RepresentationUtils;
\r
62 import org.openecomp.sdc.be.user.UserBusinessLogic;
\r
63 import org.openecomp.sdc.common.api.Constants;
\r
64 import org.openecomp.sdc.common.log.wrappers.Logger;
\r
65 import org.openecomp.sdc.common.util.GeneralUtility;
\r
66 import org.openecomp.sdc.exception.ResponseFormat;
\r
67 import com.jcabi.aspects.Loggable;
\r
68 import fj.data.Either;
\r
69 import io.swagger.v3.oas.annotations.OpenAPIDefinition;
\r
70 import io.swagger.v3.oas.annotations.Operation;
\r
71 import io.swagger.v3.oas.annotations.Parameter;
\r
72 import io.swagger.v3.oas.annotations.info.Info;
\r
73 import io.swagger.v3.oas.annotations.media.ArraySchema;
\r
74 import io.swagger.v3.oas.annotations.media.Content;
\r
75 import io.swagger.v3.oas.annotations.media.Schema;
\r
76 import io.swagger.v3.oas.annotations.responses.ApiResponse;
\r
77 import io.swagger.v3.oas.annotations.responses.ApiResponses;
\r
80 * This Servlet serves external users for retrieving component metadata.
\r
86 @Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
\r
87 @Path("/v1/catalog")
\r
88 // for retrieving component metadata.")
\r
89 @OpenAPIDefinition(info = @Info(title = "Asset Metadata External Servlet",
\r
90 description = "This Servlet serves external users for retrieving component metadata."))
\r
92 public class AssetsDataServlet extends AbstractValidationsServlet {
\r
95 private HttpServletRequest request;
\r
97 private static final Logger log = Logger.getLogger(AssetsDataServlet.class);
\r
98 private final ElementBusinessLogic elementBusinessLogic;
\r
99 private final AssetMetadataConverter assetMetadataConverter;
\r
100 private final ComponentBusinessLogicProvider componentBusinessLogicProvider;
\r
103 public AssetsDataServlet(UserBusinessLogic userBusinessLogic, ComponentInstanceBusinessLogic componentInstanceBL,
\r
104 ComponentsUtils componentsUtils, ServletUtils servletUtils, ResourceImportManager resourceImportManager,
\r
105 ElementBusinessLogic elementBusinessLogic, AssetMetadataConverter assetMetadataConverter,
\r
106 ComponentBusinessLogicProvider componentBusinessLogicProvider) {
\r
107 super(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager);
\r
108 this.elementBusinessLogic = elementBusinessLogic;
\r
109 this.assetMetadataConverter = assetMetadataConverter;
\r
110 this.componentBusinessLogicProvider = componentBusinessLogicProvider;
\r
116 * @param instanceIdHeader
\r
118 * @param authorization
\r
121 * @param subCategory
\r
122 * @param distributionStatus
\r
123 * @param resourceType
\r
127 @Path("/{assetType}")
\r
128 @Produces(MediaType.APPLICATION_JSON)
\r
129 @Operation(description = "Fetch list of assets", method = "GET", summary = "Returns list of assets")
\r
130 @ApiResponses(value = {
\r
131 @ApiResponse(responseCode = "200",
\r
132 description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
\r
133 content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
\r
134 @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
\r
135 @ApiResponse(responseCode = "401",
\r
136 description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
\r
137 @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
\r
138 @ApiResponse(responseCode = "405",
\r
139 description = "Method Not Allowed : Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
\r
140 @ApiResponse(responseCode = "500",
\r
141 description = "The GET request failed either due to internal SDC problem. ECOMP Component should continue the attempts to get the needed information - POL5000")})
\r
142 public Response getAssetListExternal(
\r
143 @Parameter(description = "X-ECOMP-RequestID header",
\r
144 required = false) @HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
\r
145 @Parameter(description = "X-ECOMP-InstanceID header", required = true) @HeaderParam(
\r
146 value = Constants.X_ECOMP_INSTANCE_ID_HEADER) final String instanceIdHeader,
\r
147 @Parameter(description = "Determines the format of the body of the response",
\r
148 required = false) @HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
\r
149 @Parameter(description = "The username and password",
\r
150 required = true) @HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
\r
151 @Parameter(description = "The requested asset type",schema = @Schema(allowableValues = {"resources", "services"}),
\r
152 required = true) @PathParam("assetType") final String assetType,
\r
153 @Parameter(description = "The filter key (resourceType only for resources)",
\r
154 required = false) @QueryParam("category") String category,
\r
155 @Parameter(description = "The filter key (resourceType only for resources)",
\r
156 required = false) @QueryParam("subCategory") String subCategory,
\r
157 @Parameter(description = "The filter key (resourceType only for resources)",
\r
158 required = false) @QueryParam("distributionStatus") String distributionStatus,
\r
159 @Parameter(description = "The filter key (resourceType only for resources)",
\r
160 required = false) @QueryParam("resourceType") String resourceType) {
\r
162 Response response = null;
\r
163 ResponseFormat responseFormat = null;
\r
164 String query = request.getQueryString();
\r
165 String requestURI =
\r
166 request.getRequestURI().endsWith("/") ? removeDuplicateSlashSeparator(request.getRequestURI())
\r
167 : request.getRequestURI();
\r
168 String url = request.getMethod() + " " + requestURI;
\r
169 log.debug("Start handle request of {}", url);
\r
171 AuditingActionEnum auditingActionEnum =
\r
172 query == null ? AuditingActionEnum.GET_ASSET_LIST : AuditingActionEnum.GET_FILTERED_ASSET_LIST;
\r
174 String resourceUrl = query == null ? requestURI : requestURI + "?" + query;
\r
175 DistributionData distributionData = new DistributionData(instanceIdHeader, resourceUrl);
\r
178 if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
\r
179 log.debug("getAssetList: Missing X-ECOMP-InstanceID header");
\r
180 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID);
\r
181 getComponentsUtils().auditExternalGetAssetList(responseFormat, auditingActionEnum, distributionData,
\r
183 return buildErrorResponse(responseFormat);
\r
187 Map<FilterKeyEnum, String> filters = new EnumMap<>(FilterKeyEnum.class);
\r
189 if (category != null) {
\r
190 filters.put(FilterKeyEnum.CATEGORY, category);
\r
192 if (subCategory != null) {
\r
193 filters.put(FilterKeyEnum.SUB_CATEGORY, subCategory);
\r
195 if (distributionStatus != null) {
\r
196 filters.put(FilterKeyEnum.DISTRIBUTION_STATUS, distributionStatus);
\r
198 if (resourceType != null) {
\r
199 ResourceTypeEnum resourceTypeEnum = ResourceTypeEnum.getTypeIgnoreCase(resourceType);
\r
200 if (resourceTypeEnum == null) {
\r
201 log.debug("getAssetList: Asset Fetching Failed. Invalid resource type was received");
\r
202 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
\r
203 getComponentsUtils().auditExternalGetAssetList(responseFormat, auditingActionEnum, distributionData,
\r
205 return buildErrorResponse(responseFormat);
\r
207 filters.put(FilterKeyEnum.RESOURCE_TYPE, resourceTypeEnum.name());
\r
210 Either<List<? extends Component>, ResponseFormat> assetTypeData =
\r
211 elementBusinessLogic.getFilteredCatalogComponents(assetType, filters, query);
\r
213 if (assetTypeData.isRight()) {
\r
214 log.debug("getAssetList: Asset Fetching Failed");
\r
215 responseFormat = assetTypeData.right().value();
\r
216 getComponentsUtils().auditExternalGetAssetList(responseFormat, auditingActionEnum, distributionData,
\r
218 return buildErrorResponse(responseFormat);
\r
220 log.debug("getAssetList: Asset Fetching Success");
\r
221 Either<List<? extends AssetMetadata>, ResponseFormat> resMetadata =
\r
222 assetMetadataConverter.convertToAssetMetadata(assetTypeData.left().value(), requestURI, false);
\r
223 if (resMetadata.isRight()) {
\r
224 log.debug("getAssetList: Asset conversion Failed");
\r
225 responseFormat = resMetadata.right().value();
\r
226 getComponentsUtils().auditExternalGetAssetList(responseFormat, auditingActionEnum, distributionData,
\r
228 return buildErrorResponse(responseFormat);
\r
230 Object result = RepresentationUtils.toRepresentation(resMetadata.left().value());
\r
231 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
\r
232 getComponentsUtils().auditExternalGetAssetList(responseFormat, auditingActionEnum, distributionData,
\r
235 response = buildOkResponse(responseFormat, result);
\r
238 } catch (Exception e) {
\r
239 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Fetch filtered list of assets");
\r
240 log.debug("getAssetList: Fetch list of assets failed with exception", e);
\r
241 return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR));
\r
248 * @param instanceIdHeader
\r
250 * @param authorization
\r
256 @Path("/{assetType}/{uuid}/metadata")
\r
257 @Produces(MediaType.APPLICATION_JSON)
\r
258 @Operation(description = "Detailed metadata of asset by uuid", method = "GET",
\r
259 summary = "Returns detailed metadata of an asset by uuid")
\r
260 @ApiResponses(value = {
\r
261 @ApiResponse(responseCode = "200",
\r
262 description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
\r
263 content = @Content(array = @ArraySchema(schema = @Schema(implementation = AssetMetadata.class)))),
\r
264 @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
\r
265 @ApiResponse(responseCode = "401",
\r
266 description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
\r
267 @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
\r
268 @ApiResponse(responseCode = "404",
\r
269 description = "Error: Requested '%1' (uuid) resource was not found - SVC4063"),
\r
270 @ApiResponse(responseCode = "405",
\r
271 description = "Method Not Allowed : Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
\r
272 @ApiResponse(responseCode = "500",
\r
273 description = "The GET request failed either due to internal SDC problem. ECOMP Component should continue the attempts to get the needed information - POL5000")})
\r
274 public Response getAssetSpecificMetadataByUuidExternal(
\r
275 @Parameter(description = "X-ECOMP-RequestID header",
\r
276 required = false) @HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
\r
277 @Parameter(description = "X-ECOMP-InstanceID header", required = true) @HeaderParam(
\r
278 value = Constants.X_ECOMP_INSTANCE_ID_HEADER) final String instanceIdHeader,
\r
279 @Parameter(description = "Determines the format of the body of the response",
\r
280 required = false) @HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
\r
281 @Parameter(description = "The username and password",
\r
282 required = true) @HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
\r
283 @Parameter(description = "The requested asset type",schema = @Schema(allowableValues = {"resources", "services"}),
\r
284 required = true) @PathParam("assetType") final String assetType,
\r
285 @Parameter(description = "The requested asset uuid",
\r
286 required = true) @PathParam("uuid") final String uuid) {
\r
288 Response response = null;
\r
289 ResponseFormat responseFormat = null;
\r
290 AuditingActionEnum auditingActionEnum = AuditingActionEnum.GET_ASSET_METADATA;
\r
291 String requestURI = request.getRequestURI();
\r
292 String url = request.getMethod() + " " + requestURI;
\r
293 log.debug("Start handle request of {}", url);
\r
295 ComponentTypeEnum componentType = ComponentTypeEnum.findByParamName(assetType);
\r
296 ResourceCommonInfo resourceCommonInfo = new ResourceCommonInfo(componentType.getValue());
\r
297 DistributionData distributionData = new DistributionData(instanceIdHeader, requestURI);
\r
299 if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
\r
300 log.debug("getAssetList: Missing X-ECOMP-InstanceID header");
\r
301 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID);
\r
302 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
303 resourceCommonInfo, requestId, uuid);
\r
304 return buildErrorResponse(responseFormat);
\r
308 Either<List<? extends Component>, ResponseFormat> assetTypeData =
\r
309 elementBusinessLogic.getCatalogComponentsByUuidAndAssetType(assetType, uuid);
\r
311 if (assetTypeData.isRight()) {
\r
312 log.debug("getAssetList: Asset Fetching Failed");
\r
313 responseFormat = assetTypeData.right().value();
\r
314 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
315 resourceCommonInfo, requestId, uuid);
\r
317 return buildErrorResponse(responseFormat);
\r
319 resourceCommonInfo.setResourceName(assetTypeData.left().value().iterator().next().getName());
\r
320 log.debug("getAssetList: Asset Fetching Success");
\r
321 Either<List<? extends AssetMetadata>, ResponseFormat> resMetadata =
\r
322 assetMetadataConverter.convertToAssetMetadata(assetTypeData.left().value(), requestURI, true);
\r
323 if (resMetadata.isRight()) {
\r
324 log.debug("getAssetList: Asset conversion Failed");
\r
325 responseFormat = resMetadata.right().value();
\r
327 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
328 resourceCommonInfo, requestId, uuid);
\r
329 return buildErrorResponse(responseFormat);
\r
331 Object result = RepresentationUtils.toRepresentation(resMetadata.left().value().iterator().next());
\r
332 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
\r
333 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
334 resourceCommonInfo, requestId, uuid);
\r
336 response = buildOkResponse(responseFormat, result);
\r
339 } catch (Exception e) {
\r
340 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Fetch filtered list of assets");
\r
341 log.debug("getAssetList: Fetch list of assets failed with exception", e);
\r
342 return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR));
\r
349 * @param instanceIdHeader
\r
351 * @param authorization
\r
357 @Path("/{assetType}/{uuid}/toscaModel")
\r
358 @Produces(MediaType.APPLICATION_OCTET_STREAM)
\r
359 @Operation(description = "Fetch assets CSAR", method = "GET", summary = "Returns asset csar",
\r
360 responses = @ApiResponse(
\r
361 content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))
\r
362 @ApiResponses(value = {
\r
363 @ApiResponse(responseCode = "200",
\r
364 description = "ECOMP component is authenticated and list of Catalog Assets Metadata is returned",
\r
365 content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))),
\r
366 @ApiResponse(responseCode = "400", description = "Missing 'X-ECOMP-InstanceID' HTTP header - POL5001"),
\r
367 @ApiResponse(responseCode = "401",
\r
368 description = "ECOMP component should authenticate itself and to re-send again HTTP request with its Basic Authentication credentials - POL5002"),
\r
369 @ApiResponse(responseCode = "403", description = "ECOMP component is not authorized - POL5003"),
\r
370 @ApiResponse(responseCode = "404",
\r
371 description = "Error: Requested '%1' (uuid) resource was not found - SVC4063"),
\r
372 @ApiResponse(responseCode = "405",
\r
373 description = "Method Not Allowed : Invalid HTTP method type used ( PUT,DELETE,POST will be rejected) - POL4050"),
\r
374 @ApiResponse(responseCode = "500",
\r
375 description = "The GET request failed either due to internal SDC problem. ECOMP Component should continue the attempts to get the needed information - POL5000")})
\r
376 public Response getToscaModelExternal(
\r
377 @Parameter(description = "X-ECOMP-RequestID header",
\r
378 required = false) @HeaderParam(value = Constants.X_ECOMP_REQUEST_ID_HEADER) String requestId,
\r
379 @Parameter(description = "X-ECOMP-InstanceID header", required = true) @HeaderParam(
\r
380 value = Constants.X_ECOMP_INSTANCE_ID_HEADER) final String instanceIdHeader,
\r
381 @Parameter(description = "Determines the format of the body of the response",
\r
382 required = false) @HeaderParam(value = Constants.ACCEPT_HEADER) String accept,
\r
383 @Parameter(description = "The username and password",
\r
384 required = true) @HeaderParam(value = Constants.AUTHORIZATION_HEADER) String authorization,
\r
385 @Parameter(description = "The requested asset type",schema = @Schema(allowableValues = {"resources", "services"}),
\r
386 required = true) @PathParam("assetType") final String assetType,
\r
387 @Parameter(description = "The requested asset uuid",
\r
388 required = true) @PathParam("uuid") final String uuid) {
\r
390 String url = request.getRequestURI();
\r
391 log.debug("Start handle request of {} {}", request.getMethod(), url);
\r
392 Response response = null;
\r
393 ResponseFormat responseFormat = null;
\r
394 ComponentTypeEnum componentType = ComponentTypeEnum.findByParamName(assetType);
\r
395 AuditingActionEnum auditingActionEnum = AuditingActionEnum.GET_TOSCA_MODEL;
\r
397 ResourceCommonInfo resourceCommonInfo = new ResourceCommonInfo(componentType.getValue());
\r
398 DistributionData distributionData = new DistributionData(instanceIdHeader, url);
\r
400 if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
\r
401 log.debug("getToscaModel: Missing X-ECOMP-InstanceID header");
\r
402 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.MISSING_X_ECOMP_INSTANCE_ID);
\r
403 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
404 resourceCommonInfo, requestId, uuid);
\r
405 return buildErrorResponse(responseFormat);
\r
409 ComponentBusinessLogic componentBL = componentBusinessLogicProvider.getInstance(componentType);
\r
412 Either<ImmutablePair<String, byte[]>, ResponseFormat> csarArtifact =
\r
413 componentBL.getToscaModelByComponentUuid(componentType, uuid, resourceCommonInfo);
\r
414 if (csarArtifact.isRight()) {
\r
415 responseFormat = csarArtifact.right().value();
\r
416 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
417 resourceCommonInfo, requestId, uuid);
\r
418 response = buildErrorResponse(responseFormat);
\r
420 byte[] value = csarArtifact.left().value().getRight();
\r
421 InputStream is = new ByteArrayInputStream(value);
\r
422 String contenetMD5 = GeneralUtility.calculateMD5Base64EncodedByByteArray(value);
\r
423 Map<String, String> headers = new HashMap<>();
\r
424 headers.put(Constants.CONTENT_DISPOSITION_HEADER,
\r
425 getContentDispositionValue(csarArtifact.left().value().getLeft()));
\r
426 headers.put(Constants.MD5_HEADER, contenetMD5);
\r
427 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK);
\r
428 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
429 resourceCommonInfo, requestId, uuid);
\r
430 response = buildOkResponse(responseFormat, is, headers);
\r
434 } catch (Exception e) {
\r
435 BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get asset tosca model");
\r
436 log.debug("falied to get asset tosca model", e);
\r
437 responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR);
\r
438 response = buildErrorResponse(responseFormat);
\r
439 getComponentsUtils().auditExternalGetAsset(responseFormat, auditingActionEnum, distributionData,
\r
440 resourceCommonInfo, requestId, uuid);
\r
446 private String removeDuplicateSlashSeparator(String requestUri) {
\r
447 return requestUri.substring(0, requestUri.length() - 1);
\r