From f53d4650e18007ab7820efd84638edac90b61090 Mon Sep 17 00:00:00 2001 From: "Manor, Yanir (ym903w)" Date: Sun, 21 Oct 2018 10:20:53 +0300 Subject: upgrade dace-be Change-Id: Iaef6ef0d37e2e216321f141d10692edcaf26ffab Issue-ID: DCAEGEN2-836 Signed-off-by: Manor, Yanir (ym903w) --- .../asdc/src/main/java/org/onap/sdc/dcae/client/ISdcClient.java | 2 ++ .../asdc/src/main/java/org/onap/sdc/dcae/client/SdcRestClient.java | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'dcaedt_catalog/asdc') diff --git a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/ISdcClient.java b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/ISdcClient.java index 9623d4c..77ff046 100644 --- a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/ISdcClient.java +++ b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/ISdcClient.java @@ -25,6 +25,8 @@ public interface ISdcClient { String addExternalMonitoringReference(String userId, CreateVFCMTRequest resource, ReferenceUUID vfcmtUuid, String requestId); + void updateExternalMonitoringReference(String userId, String contextType, String serviceUuid, String vfiName, String vfcmtUuid, ReferenceUUID updatedReference, String requestId); + void deleteExternalMonitoringReference(String userId, String contextType, String uuid, String vfiName, String vfcmtUuid, String requestId); ResourceDetailed createResource(String userId, CreateVFCMTRequest resource, String requestId); diff --git a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/SdcRestClient.java b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/SdcRestClient.java index 7b89465..e405ffc 100644 --- a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/SdcRestClient.java +++ b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/client/SdcRestClient.java @@ -126,6 +126,12 @@ public class SdcRestClient implements ISdcClient { return addExternalMonitoringReference(userId, resource.getContextType(), resource.getServiceUuid(), resource.getVfiName(), vfcmtUuid, requestId); } + public void updateExternalMonitoringReference(String userId, String contextType, String serviceUuid, String vfiName, String vfcmtUuid, ReferenceUUID updatedReference, String requestId) { + String url = buildRequestPath(AssetType.getSdcContextPath(contextType), serviceUuid, RESOURCE_INSTANCES_PATH, Normalizers.normalizeComponentInstanceName(vfiName), MONITORING_REFERENCES_PATH, vfcmtUuid); + debugLogger.log(LogLevel.DEBUG, this.getClass().getName(), "Updating external monitoring reference from service id {} vfi name {} to vfcmt {} URL={}", serviceUuid, vfiName, vfcmtUuid, url); + client.put(url, new HttpEntity<>(updatedReference, postResourceHeaders(userId, requestId))); + } + public void deleteExternalMonitoringReference(String userId, String contextType, String serviceUuid, String normalizeVfiName, String vfcmtUuid, String requestId) { String url = buildRequestPath(AssetType.getSdcContextPath(contextType), serviceUuid, RESOURCE_INSTANCES_PATH, normalizeVfiName, MONITORING_REFERENCES_PATH, vfcmtUuid); debugLogger.log(LogLevel.DEBUG, this.getClass().getName(), "Delete external monitoring reference from SDC asset. URL={}", url); -- cgit 1.2.3-korg