From bed18fd895d1ac240c7fdb361cb0ed994d392ecf Mon Sep 17 00:00:00 2001 From: lukegleeson Date: Fri, 6 May 2022 12:02:42 +0100 Subject: Get cm-handle public properties endpoint Added RestOuputCmHandlePublicProperties OpenApi Object Added Get cm-handle public properties endpoint Added rest and service layer functionality for endpoint with tests Fixed Copyright Checker violations Issue-ID: CPS-1018 Signed-off-by: lukegleeson Change-Id: Ifc13cde350a49f6ba705a09e31853dc9c73be168 --- .../rest/controller/NetworkCmProxyController.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'cps-ncmp-rest/src/main') diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 5c1f8704d..ca7e258bc 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Pantheon.tech * Modifications Copyright (C) 2021-2022 Nordix Foundation - * Modification Copyright (C) 2021 highstreet technologies GmbH - * Modifications (C) 2021-2022 Bell Canada + * Modifications Copyright (C) 2021 highstreet technologies GmbH + * Modifications Copyright (C) 2021-2022 Bell Canada * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,7 @@ import org.onap.cps.ncmp.rest.model.ModuleNameAsJsonObject; import org.onap.cps.ncmp.rest.model.ModuleNamesAsJsonArray; import org.onap.cps.ncmp.rest.model.RestModuleReference; import org.onap.cps.ncmp.rest.model.RestOutputCmHandle; +import org.onap.cps.ncmp.rest.model.RestOutputCmHandlePublicProperties; import org.onap.cps.utils.CpsValidator; import org.onap.cps.utils.JsonObjectMapper; import org.springframework.http.HttpStatus; @@ -240,6 +241,22 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { return ResponseEntity.ok(restOutputCmHandle); } + /** + * Get Cm Handle Properties by Cm Handle Id. + * @param cmHandleId cm-handle identifier + * @return cm handle and its properties + */ + @Override + public ResponseEntity getCmHandlePublicPropertiesByCmHandleId( + final String cmHandleId) { + final CmHandlePublicProperties cmHandlePublicProperties = new CmHandlePublicProperties(); + cmHandlePublicProperties.add(networkCmProxyDataService.getCmHandlePublicProperties(cmHandleId)); + final RestOutputCmHandlePublicProperties restOutputCmHandlePublicProperties = + new RestOutputCmHandlePublicProperties(); + restOutputCmHandlePublicProperties.setPublicCmHandleProperties(cmHandlePublicProperties); + return ResponseEntity.ok(restOutputCmHandlePublicProperties); + } + /** * Return module references for a cm handle. * -- cgit 1.2.3-korg