Merge "Support Alternate-Id for CPS-E05 id-searches and searchCmHandleIds"
diff --git a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
index 183698c..1664887 100644
--- a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
+++ b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
@@ -213,7 +213,8 @@
     }
 
     @Override
-    public ResponseEntity<List<String>> searchCmHandleIds(@Valid final CmHandleQueryParameters body) {
+    public ResponseEntity<List<String>> searchCmHandleIds(@Valid final CmHandleQueryParameters body,
+                                                          @Valid final Boolean outputAlternateId) {
         return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
 
     }
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml
index 112dddf..99072c4 100644
--- a/cps-ncmp-rest/docs/openapi/components.yaml
+++ b/cps-ncmp-rest/docs/openapi/components.yaml
@@ -513,6 +513,14 @@
       schema:
         type: string
         example: my-cm-handle-reference
+    outputAlternateIdOptionInQuery:
+      name: outputAlternateId
+      in: query
+      description: Boolean parameter to determine if returned value(s) will be cmHandle Ids or Alternate Ids for a given query
+      required: false
+      schema:
+        type: boolean
+        default: false
     moduleNameInQuery:
       name: module-name
       in: query
diff --git a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml b/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml
index ea020f9..24b83cf 100755
--- a/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml
+++ b/cps-ncmp-rest/docs/openapi/ncmp-inventory.yml
@@ -1,6 +1,6 @@
 #  ============LICENSE_START=======================================================
 #  Copyright (C) 2021 Bell Canada
-#  Modifications Copyright (C) 2021-2022 Nordix Foundation
+#  Modifications Copyright (C) 2021-2024 Nordix Foundation
 #  ================================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -121,11 +121,13 @@
 
 searchCmHandleIds:
   post:
-    description: Query and get CMHandleIds for additional properties, public properties and registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin).
+    description: Query and get CMHandle references for additional properties, public properties and registered DMI plugin (DMI plugin, DMI data plugin, DMI model plugin).
     tags:
       - network-cm-proxy-inventory
     summary: Query for CM Handle IDs
     operationId: searchCmHandleIds
+    parameters:
+      - $ref: 'components.yaml#/components/parameters/outputAlternateIdOptionInQuery'
     requestBody:
       required: true
       content:
diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml
index adb2419..a3ddc3f 100755
--- a/cps-ncmp-rest/docs/openapi/ncmp.yml
+++ b/cps-ncmp-rest/docs/openapi/ncmp.yml
@@ -417,11 +417,13 @@
 
 searchCmHandleIds:
   post:
-    description: Execute cm handle query search and return a list of cm handle ids. Any number of conditions can be applied. To be included in the result a cm-handle must fulfill ALL the conditions. An empty collection will be returned in the case that the cm handle does not match a condition. For more on cm handle query search please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/ncmp-cmhandle-querying.html">cm handle query search Read the Docs</a>.<br/>By supplying a CPS Path it is possible to query on any data related to the cm handle. For more on CPS Path please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html">CPS Path Read the Docs</a>. The cm handle ancestor is automatically returned for this query.
+    description: Execute cm handle query search and return a list of cm handle references. Any number of conditions can be applied. To be included in the result a cm-handle must fulfill ALL the conditions. An empty collection will be returned in the case that the cm handle does not match a condition. For more on cm handle query search please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/ncmp-cmhandle-querying.html">cm handle query search Read the Docs</a>.<br/>By supplying a CPS Path it is possible to query on any data related to the cm handle. For more on CPS Path please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html">CPS Path Read the Docs</a>. The cm handle ancestor is automatically returned for this query.
     tags:
       - network-cm-proxy
     summary: Execute cm handle query upon a given set of query parameters
     operationId: searchCmHandleIds
+    parameters:
+      - $ref: 'components.yaml#/components/parameters/outputAlternateIdOptionInQuery'
     requestBody:
       required: true
       content:
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 42f709d..3676bb1 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
@@ -268,18 +268,20 @@
     }
 
     /**
-     * Query and return cm handle ids that match the given query parameters.
+     * Query and return cm handle ids or alternate ids that match the given query parameters.
      *
-     * @param cmHandleQueryParameters the cm handle query parameters
-     * @return collection of cm handle ids
+     * @param cmHandleQueryParameters   the cm handle query parameters
+     * @param outputAlternateId         Boolean for cm handle reference type either
+     *                                  cm handle id (false or null) or alternate id (true)
+     * @return                          collection of cm handle ids
      */
     @Override
-    public ResponseEntity<List<String>> searchCmHandleIds(
-            final CmHandleQueryParameters cmHandleQueryParameters) {
+    public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters,
+                                                          final Boolean outputAlternateId) {
         final CmHandleQueryApiParameters cmHandleQueryApiParameters =
                 jsonObjectMapper.convertToValueType(cmHandleQueryParameters, CmHandleQueryApiParameters.class);
         final Collection<String> cmHandleIds
-            = networkCmProxyInventoryFacade.executeCmHandleIdSearch(cmHandleQueryApiParameters);
+            = networkCmProxyInventoryFacade.executeCmHandleIdSearch(cmHandleQueryApiParameters, outputAlternateId);
         return ResponseEntity.ok(List.copyOf(cmHandleIds));
     }
 
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
index cea3d2a..f763769 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
@@ -1,7 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2021-2022 Bell Canada
- *  Modifications Copyright (C) 2022-2023 Nordix Foundation
+ *  Modifications Copyright (C) 2022-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -51,13 +51,22 @@
     private final NetworkCmProxyInventoryFacade networkCmProxyInventoryFacade;
     private final NcmpRestInputMapper ncmpRestInputMapper;
 
+    /**
+     * Get all cm handle references under a registered DMI plugin.
+     *
+     * @param cmHandleQueryParameters DMI plugin identifier
+     * @param outputAlternateId       Boolean for cm handle reference type either
+     *                                cm handle id (False) or alternate id (True)
+     * @return                        list of cm handle IDs
+     */
     @Override
-    public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters) {
+    public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters,
+                                                          final Boolean outputAlternateId) {
         final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = ncmpRestInputMapper
                 .toCmHandleQueryServiceParameters(cmHandleQueryParameters);
 
         final Collection<String> cmHandleIds = networkCmProxyInventoryFacade
-                .executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters);
+                .executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters, outputAlternateId);
         return ResponseEntity.ok(List.copyOf(cmHandleIds));
     }
 
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
index 43403fa..5340c6d 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
@@ -363,7 +363,7 @@
         given: 'an endpoint and json data'
             def searchesEndpoint = "$ncmpBasePathV1/ch/id-searches"
         and: 'the service method is invoked with module names and returns cm handle ids'
-            1 * mockNetworkCmProxyInventoryFacade.executeCmHandleIdSearch(_) >> ['ch-1', 'ch-2']
+            1 * mockNetworkCmProxyInventoryFacade.executeCmHandleIdSearch(_, _) >> ['ch-1', 'ch-2']
         when: 'the searches api is invoked'
             def response = mvc.perform(post(searchesEndpoint).contentType(MediaType.APPLICATION_JSON).content('{}')).andReturn().response
         then: 'cm handle ids are returned'
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryControllerSpec.groovy
index d7ac466..74e6759 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryControllerSpec.groovy
@@ -1,7 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2021-2022 Bell Canada
- *  Modifications Copyright (C) 2021-2023 Nordix Foundation
+ *  Modifications Copyright (C) 2021-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -113,7 +113,7 @@
         and: 'the mapper service returns a converted object'
             ncmpRestInputMapper.toCmHandleQueryServiceParameters(_) >> cmHandleQueryServiceParameters
         and: 'the service returns the desired results'
-            mockNetworkCmProxyInventoryFacade.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters) >> serviceMockResponse
+            mockNetworkCmProxyInventoryFacade.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters, _) >> serviceMockResponse
         when: 'post request is performed & search is called with the given request parameters'
             def response = mvc.perform(
                     post("$ncmpBasePathV1/ch/searches")
@@ -136,7 +136,7 @@
         and: 'the mapper service returns a converted object'
             ncmpRestInputMapper.toCmHandleQueryServiceParameters(_) >> cmHandleQueryServiceParameters
         and: 'the service returns the desired results'
-            mockNetworkCmProxyInventoryFacade.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters) >> serviceMockResponse
+            mockNetworkCmProxyInventoryFacade.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters, _) >> serviceMockResponse
         when: 'post request is performed & search is called with the given request parameters'
             def response = mvc.perform(
                     post("$ncmpBasePathV1/ch/searches")
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java
index a4ea7b4..e9e5f54 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java
@@ -29,7 +29,6 @@
 import java.util.Collection;
 import java.util.Map;
 import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryApiParameters;
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters;
 import org.onap.cps.ncmp.api.inventory.models.CompositeState;
@@ -51,7 +50,6 @@
 import org.onap.cps.utils.JsonObjectMapper;
 import org.springframework.stereotype.Service;
 
-@Slf4j
 @Service
 @RequiredArgsConstructor
 public class NetworkCmProxyInventoryFacade {
@@ -90,12 +88,16 @@
      * Get all cm handle IDs by various properties.
      *
      * @param cmHandleQueryServiceParameters cm handle query parameters
-     * @return collection of cm handle IDs
+     * @param outputAlternateId              Boolean for cm handle reference type either
+     *                                       cm handle id (false) or alternate id (true)
+     * @return                               collection of cm handle IDs
      */
     public Collection<String> executeParameterizedCmHandleIdSearch(
-        final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+        final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
         validateCmHandleQueryParameters(cmHandleQueryServiceParameters, InventoryQueryConditions.ALL_CONDITION_NAMES);
-        return parameterizedCmHandleQueryService.queryCmHandleIdsForInventory(cmHandleQueryServiceParameters);
+
+        return parameterizedCmHandleQueryService.queryCmHandleIdsForInventory(cmHandleQueryServiceParameters,
+            outputAlternateId);
     }
 
 
@@ -157,13 +159,16 @@
      * Retrieve cm handle ids for the given query parameters.
      *
      * @param cmHandleQueryApiParameters cm handle query parameters
+     * @param outputAlternateId boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
      * @return cm handle ids
      */
-    public Collection<String> executeCmHandleIdSearch(final CmHandleQueryApiParameters cmHandleQueryApiParameters) {
+    public Collection<String> executeCmHandleIdSearch(final CmHandleQueryApiParameters cmHandleQueryApiParameters,
+                                                      final Boolean outputAlternateId) {
         final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = jsonObjectMapper.convertToValueType(
             cmHandleQueryApiParameters, CmHandleQueryServiceParameters.class);
         validateCmHandleQueryParameters(cmHandleQueryServiceParameters, CmHandleQueryConditions.ALL_CONDITION_NAMES);
-        return parameterizedCmHandleQueryService.queryCmHandleIds(cmHandleQueryServiceParameters);
+        return parameterizedCmHandleQueryService.queryCmHandleReferenceIds(cmHandleQueryServiceParameters,
+            outputAlternateId);
     }
 
     /**
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacade.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacade.java
index 5343a2e..b9b295a 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacade.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacade.java
@@ -28,16 +28,13 @@
 
 import java.util.Collection;
 import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.ncmp.api.data.models.CmResourceAddress;
 import org.onap.cps.ncmp.api.data.models.DataOperationRequest;
 import org.onap.cps.ncmp.api.data.models.DatastoreType;
 import org.onap.cps.ncmp.api.data.models.OperationType;
-import org.onap.cps.ncmp.impl.utils.AlternateIdMatcher;
 import org.onap.cps.spi.model.DataNode;
 import org.springframework.stereotype.Service;
 
-@Slf4j
 @Service
 @RequiredArgsConstructor
 public class NetworkCmProxyFacade {
@@ -45,7 +42,6 @@
     private final NcmpCachedResourceRequestHandler ncmpCachedResourceRequestHandler;
     private final NcmpPassthroughResourceRequestHandler ncmpPassthroughResourceRequestHandler;
     private final DmiDataOperations dmiDataOperations;
-    private final AlternateIdMatcher alternateIdMatcher;
 
     /**
      * Fetches resource data for a given data store using DMI (Data Management Interface).
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryService.java
index 95c3c77..86e9c93 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryService.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryService.java
@@ -32,25 +32,31 @@
      * Query Cm Handles based on additional (private) properties.
      *
      * @param additionalPropertyQueryPairs private properties for query
+     * @param outputAlternateId boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
      * @return Ids of Cm Handles which have these private properties
      */
-    Collection<String> queryCmHandleAdditionalProperties(Map<String, String> additionalPropertyQueryPairs);
+    Collection<String> queryCmHandleAdditionalProperties(Map<String, String> additionalPropertyQueryPairs,
+                                                         Boolean outputAlternateId);
 
     /**
      * Query Cm Handles based on public properties.
      *
      * @param publicPropertyQueryPairs public properties for query
+     * @param outputAlternateId  boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
      * @return CmHandles which have these public properties
      */
-    Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs);
+    Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs,
+                                                     Boolean outputAlternateId);
 
     /**
      * Query Cm Handles based on Trust Level.
      *
      * @param trustLevelPropertyQueryPairs trust level properties for query
+     * @param outputAlternateId boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
      * @return Ids of Cm Handles which have desired trust level
      */
-    Collection<String> queryCmHandlesByTrustLevel(Map<String, String> trustLevelPropertyQueryPairs);
+    Collection<String> queryCmHandlesByTrustLevel(Map<String, String> trustLevelPropertyQueryPairs,
+                                                  Boolean outputAlternateId);
 
     /**
      * Method which returns cm handles by the cm handles state.
@@ -101,4 +107,12 @@
      */
     Collection<String> getCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);
 
+    /**
+     * Get map of cmHandle ids and alternate ids by DMI plugin identifier.
+     *
+     * @param dmiPluginIdentifier DMI plugin identifier
+     * @return map of cmHandle references key:CmHandleId Value:AlternateId
+     */
+    Map<String, String> getCmHandleReferencesByDmiPluginIdentifier(String dmiPluginIdentifier);
+
 }
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
index 71e7384..4249b45 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
@@ -29,6 +29,7 @@
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -53,6 +54,7 @@
 
     private static final String DESCENDANT_PATH = "//";
     private static final String ANCESTOR_CM_HANDLES = "/ancestor::cm-handles";
+    private static final String ALTERNATE_ID = "alternate-id";
     private final CpsDataService cpsDataService;
     private final CpsQueryService cpsQueryService;
 
@@ -65,21 +67,23 @@
     private final CpsValidator cpsValidator;
 
     @Override
-    public Collection<String> queryCmHandleAdditionalProperties(final Map<String, String> privatePropertyQueryPairs) {
-        return queryCmHandleAnyProperties(privatePropertyQueryPairs, PropertyType.ADDITIONAL);
+    public Collection<String> queryCmHandleAdditionalProperties(final Map<String, String> privatePropertyQueryPairs,
+                                                                final Boolean outputAlternateId) {
+        return queryCmHandleAnyProperties(privatePropertyQueryPairs, PropertyType.ADDITIONAL, outputAlternateId);
     }
 
     @Override
-    public Collection<String> queryCmHandlePublicProperties(final Map<String, String> publicPropertyQueryPairs) {
-        return queryCmHandleAnyProperties(publicPropertyQueryPairs, PropertyType.PUBLIC);
+    public Collection<String> queryCmHandlePublicProperties(final Map<String, String> publicPropertyQueryPairs,
+                                                            final Boolean outputAlternateId) {
+        return queryCmHandleAnyProperties(publicPropertyQueryPairs, PropertyType.PUBLIC, outputAlternateId);
     }
 
     @Override
-    public Collection<String> queryCmHandlesByTrustLevel(final Map<String, String> trustLevelPropertyQueryPairs) {
+    public Collection<String> queryCmHandlesByTrustLevel(final Map<String, String> trustLevelPropertyQueryPairs,
+                                                         final Boolean outputAlternateId) {
         final String trustLevelProperty = trustLevelPropertyQueryPairs.values().iterator().next();
         final TrustLevel targetTrustLevel = TrustLevel.valueOf(trustLevelProperty);
-
-        return getCmHandleIdsByTrustLevel(targetTrustLevel);
+        return getCmHandleReferencesByTrustLevel(targetTrustLevel, outputAlternateId);
     }
 
     @Override
@@ -130,37 +134,64 @@
         return cmHandleIds;
     }
 
-    private Collection<String> getCmHandleIdsByTrustLevel(final TrustLevel targetTrustLevel) {
-        final Collection<String> selectedCmHandleIds = new HashSet<>();
+    @Override
+    public Map<String, String> getCmHandleReferencesByDmiPluginIdentifier(final String dmiPluginIdentifier) {
+        final Map<String, String> cmHandleReferencesMap = new HashMap<>();
+        for (final ModelledDmiServiceLeaves modelledDmiServiceLeaf : ModelledDmiServiceLeaves.values()) {
+            for (final DataNode cmHandleAsDataNode: getCmHandlesByDmiPluginIdentifierAndDmiProperty(
+                dmiPluginIdentifier,
+                modelledDmiServiceLeaf.getLeafName())) {
+                cmHandleReferencesMap.put(cmHandleAsDataNode.getLeaves().get("id").toString(),
+                                            cmHandleAsDataNode.getLeaves().get(ALTERNATE_ID).toString());
+            }
+        }
+        return cmHandleReferencesMap;
+    }
+
+    private Collection<String> getCmHandleReferencesByTrustLevel(final TrustLevel targetTrustLevel,
+                                                                 final Boolean outputAlternateId) {
+        final Collection<String> selectedCmHandleReferences = new HashSet<>();
 
         for (final Map.Entry<String, TrustLevel> mapEntry : trustLevelPerDmiPlugin.entrySet()) {
             final String dmiPluginIdentifier = mapEntry.getKey();
             final TrustLevel dmiTrustLevel = mapEntry.getValue();
-            final Collection<String> candidateCmHandleIds = getCmHandleIdsByDmiPluginIdentifier(dmiPluginIdentifier);
-            for (final String candidateCmHandleId : candidateCmHandleIds) {
-                final TrustLevel candidateCmHandleTrustLevel = trustLevelPerCmHandle.get(candidateCmHandleId);
+            final Map<String, String> candidateCmHandleReferences =
+                getCmHandleReferencesByDmiPluginIdentifier(dmiPluginIdentifier);
+            for (final Map.Entry<String, String> candidateCmHandleReference : candidateCmHandleReferences.entrySet()) {
+                final TrustLevel candidateCmHandleTrustLevel =
+                    trustLevelPerCmHandle.get(candidateCmHandleReference.getKey());
                 final TrustLevel effectiveTrustlevel =
                     candidateCmHandleTrustLevel.getEffectiveTrustLevel(dmiTrustLevel);
                 if (targetTrustLevel.equals(effectiveTrustlevel)) {
-                    selectedCmHandleIds.add(candidateCmHandleId);
+                    if (Boolean.TRUE.equals(outputAlternateId)) {
+                        selectedCmHandleReferences.add(candidateCmHandleReference.getValue());
+                    } else {
+                        selectedCmHandleReferences.add(candidateCmHandleReference.getKey());
+                    }
                 }
             }
         }
-
-        return selectedCmHandleIds;
+        return selectedCmHandleReferences;
     }
 
-    private Collection<String> collectCmHandleIdsFromDataNodes(final Collection<DataNode> dataNodes) {
-        return dataNodes.stream().map(dataNode -> (String) dataNode.getLeaves().get("id")).collect(Collectors.toSet());
+    private Collection<String> collectCmHandleReferencesFromDataNodes(final Collection<DataNode> dataNodes,
+                                                               final Boolean outputAlternateId) {
+        if (Boolean.TRUE.equals(outputAlternateId)) {
+            return dataNodes.stream().map(dataNode ->
+                (String) dataNode.getLeaves().get(ALTERNATE_ID)).collect(Collectors.toSet());
+        } else {
+            return dataNodes.stream().map(dataNode ->
+                (String) dataNode.getLeaves().get("id")).collect(Collectors.toSet());
+        }
     }
 
     private Collection<String> queryCmHandleAnyProperties(
         final Map<String, String> propertyQueryPairs,
-        final PropertyType propertyType) {
+        final PropertyType propertyType, final Boolean outputAlternateId) {
         if (propertyQueryPairs.isEmpty()) {
             return Collections.emptySet();
         }
-        Collection<String> cmHandleIds = null;
+        Collection<String> cmHandleReferences = null;
         for (final Map.Entry<String, String> publicPropertyQueryPair : propertyQueryPairs.entrySet()) {
             final String cpsPath = DESCENDANT_PATH + propertyType.getYangContainerName() + "[@name=\""
                 + publicPropertyQueryPair.getKey()
@@ -168,17 +199,18 @@
 
             final Collection<DataNode> dataNodes = queryCmHandleAncestorsByCpsPath(cpsPath,
                     OMIT_DESCENDANTS);
-            if (cmHandleIds == null) {
-                cmHandleIds = collectCmHandleIdsFromDataNodes(dataNodes);
+            if (cmHandleReferences == null) {
+                cmHandleReferences = collectCmHandleReferencesFromDataNodes(dataNodes, outputAlternateId);
             } else {
-                final Collection<String> cmHandleIdsToRetain = collectCmHandleIdsFromDataNodes(dataNodes);
-                cmHandleIds.retainAll(cmHandleIdsToRetain);
+                final Collection<String> cmHandleReferencesToRetain;
+                cmHandleReferencesToRetain = collectCmHandleReferencesFromDataNodes(dataNodes, outputAlternateId);
+                cmHandleReferences.retainAll(cmHandleReferencesToRetain);
             }
-            if (cmHandleIds.isEmpty()) {
+            if (cmHandleReferences.isEmpty()) {
                 break;
             }
         }
-        return cmHandleIds;
+        return cmHandleReferences;
     }
 
     private Collection<DataNode> getCmHandlesByDmiPluginIdentifierAndDmiProperty(final String dmiPluginIdentifier,
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistence.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistence.java
index a0d3a3e..850edf7 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistence.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistence.java
@@ -149,9 +149,12 @@
      * get CM handles that has given module names.
      *
      * @param moduleNamesForQuery module names
+     * @param outputAlternateIds  Boolean for cm handle reference type either
+     *                            cm handle id (false or null) or alternate id (true)
      * @return Collection of CM handle Ids
      */
-    Collection<String> getCmHandleIdsWithGivenModules(Collection<String> moduleNamesForQuery);
+    Collection<String> getCmHandleReferencesWithGivenModules(Collection<String> moduleNamesForQuery,
+                                                             Boolean outputAlternateIds);
 
     /**
      * Check database if cm handle id exists if not return false.
@@ -159,5 +162,5 @@
      * @param cmHandleId cmHandle Id
      * @return Boolean
      */
-    boolean isExistingCmHandleId(String cmHandleId);
+    Boolean isExistingCmHandleId(String cmHandleId);
 }
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java
index 06c3f8d..655d843 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java
@@ -201,12 +201,19 @@
     }
 
     @Override
-    public Collection<String> getCmHandleIdsWithGivenModules(final Collection<String> moduleNamesForQuery) {
-        return cpsAnchorService.queryAnchorNames(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, moduleNamesForQuery);
+    public Collection<String> getCmHandleReferencesWithGivenModules(final Collection<String> moduleNamesForQuery,
+                                                                    final Boolean outputAlternateIds) {
+        if (Boolean.TRUE.equals(outputAlternateIds)) {
+            final Collection<String> cmHandleIds =
+                cpsAnchorService.queryAnchorNames(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, moduleNamesForQuery);
+            return getAlternateIdsFromDataNodes(getCmHandleDataNodes(cmHandleIds));
+        } else {
+            return cpsAnchorService.queryAnchorNames(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, moduleNamesForQuery);
+        }
     }
 
     @Override
-    public boolean isExistingCmHandleId(final String cmHandleId) {
+    public Boolean isExistingCmHandleId(final String cmHandleId) {
         try {
             return  !getCmHandleDataNodeByCmHandleId(cmHandleId).isEmpty();
         } catch (final DataNodeNotFoundException exception) {
@@ -234,4 +241,9 @@
     private String createCmHandlesJsonData(final List<YangModelCmHandle> yangModelCmHandles) {
         return "{\"cm-handles\":" + jsonObjectMapper.asJsonString(yangModelCmHandles) + "}";
     }
+
+    private Collection<String> getAlternateIdsFromDataNodes(final Collection<DataNode> dataNodes) {
+        return dataNodes.stream().map(dataNode ->
+            (String) dataNode.getLeaves().get("alternate-id")).collect(Collectors.toSet());
+    }
 }
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryService.java
index e5848c0..8301579 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryService.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryService.java
@@ -26,19 +26,22 @@
 
 public interface ParameterizedCmHandleQueryService {
     /**
-     * Query and return cm handle ids that match the given query parameters.
+     * Query and return cm handle ids or alternate ids that match the given query parameters.
      * Supported query types:
      *      public properties
      *      modules
      *      cps-path
      *
      * @param cmHandleQueryServiceParameters the cm handle query parameters
-     * @return collection of cm handle ids
+     * @param outputAlternateId Boolean for cm handle reference type either
+     *                            cm handle id (false or null) or alternate id (true)
+     * @return collection of cm handle ids or alternate ids
      */
-    Collection<String> queryCmHandleIds(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
+    Collection<String> queryCmHandleReferenceIds(CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
+                                                 Boolean outputAlternateId);
 
     /**
-     * Query and return cm handle ids that match the given query parameters.
+     * Query and return cm handle ids or alternate ids that match the given query parameters.
      * Supported query types:
      *      public properties
      *      private (additional) properties
@@ -46,9 +49,12 @@
      * The inventory interface also allows conditions on private (additional) properties and dmi names
      *
      * @param cmHandleQueryServiceParameters the cm handle query parameters
+     * @param outputAlternateId Boolean for cm handle reference type either
+     *                            cm handle id (false or null) or alternate id (true)
      * @return collection of cm handle ids
      */
-    Collection<String> queryCmHandleIdsForInventory(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
+    Collection<String> queryCmHandleIdsForInventory(CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
+                                                    Boolean outputAlternateId);
 
     /**
      * Query and return cm handle objects that match the given query parameters.
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
index 34eeacc..bacbbe0 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceImpl.java
@@ -37,10 +37,9 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.function.Function;
+import java.util.function.BiFunction;
 import java.util.stream.Collectors;
 import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.cpspath.parser.PathParsingException;
 import org.onap.cps.ncmp.api.inventory.models.CmHandleQueryServiceParameters;
 import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle;
@@ -54,7 +53,6 @@
 import org.springframework.stereotype.Service;
 
 @Service
-@Slf4j
 @RequiredArgsConstructor
 public class ParameterizedCmHandleQueryServiceImpl implements ParameterizedCmHandleQueryService {
 
@@ -63,19 +61,21 @@
     private final InventoryPersistence inventoryPersistence;
 
     @Override
-    public Collection<String> queryCmHandleIds(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
-        return executeQueries(cmHandleQueryServiceParameters,
-                this::executeCpsPathQuery,
-                this::queryCmHandlesByPublicProperties,
-                this::executeModuleNameQuery,
-                this::queryCmHandlesByTrustLevel);
+    public Collection<String> queryCmHandleReferenceIds(
+        final CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
+        final Boolean outputAlternateId) {
+        return executeQueries(cmHandleQueryServiceParameters, outputAlternateId,
+            this::executeCpsPathQuery,
+            this::queryCmHandlesByPublicProperties,
+            this::executeModuleNameQuery,
+            this::queryCmHandlesByTrustLevel);
     }
 
     @Override
     public Collection<String> queryCmHandleIdsForInventory(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
-        return executeQueries(cmHandleQueryServiceParameters,
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
+            final Boolean outputAlternateId) {
+        return executeQueries(cmHandleQueryServiceParameters, outputAlternateId,
                 this::executeCpsPathQuery,
                 this::queryCmHandlesByPublicProperties,
                 this::queryCmHandlesByPrivateProperties,
@@ -90,7 +90,7 @@
             return getAllCmHandles();
         }
 
-        final Collection<String> cmHandleIds = queryCmHandleIds(cmHandleQueryServiceParameters);
+        final Collection<String> cmHandleIds = queryCmHandleReferenceIds(cmHandleQueryServiceParameters, false);
 
         return getNcmpServiceCmHandles(cmHandleIds);
     }
@@ -102,7 +102,7 @@
     }
 
     private Collection<String> queryCmHandlesByDmiPlugin(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
         final Map<String, String> dmiPropertyQueryPairs =
                 getPropertyPairs(cmHandleQueryServiceParameters.getCmHandleQueryParameters(),
                         InventoryQueryConditions.CM_HANDLE_WITH_DMI_PLUGIN.getName());
@@ -113,11 +113,15 @@
         final String dmiPluginIdentifierValue = dmiPropertyQueryPairs
             .get(PropertyType.DMI_PLUGIN.getYangContainerName());
 
-        return cmHandleQueryService.getCmHandleIdsByDmiPluginIdentifier(dmiPluginIdentifierValue);
+        if (Boolean.TRUE.equals(outputAlternateId)) {
+            return cmHandleQueryService.getCmHandleReferencesByDmiPluginIdentifier(dmiPluginIdentifierValue).values();
+        } else {
+            return cmHandleQueryService.getCmHandleIdsByDmiPluginIdentifier(dmiPluginIdentifierValue);
+        }
     }
 
     private Collection<String> queryCmHandlesByPrivateProperties(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
 
         final Map<String, String> privatePropertyQueryPairs =
                 getPropertyPairs(cmHandleQueryServiceParameters.getCmHandleQueryParameters(),
@@ -126,11 +130,11 @@
         if (privatePropertyQueryPairs.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return cmHandleQueryService.queryCmHandleAdditionalProperties(privatePropertyQueryPairs);
+        return cmHandleQueryService.queryCmHandleAdditionalProperties(privatePropertyQueryPairs, outputAlternateId);
     }
 
     private Collection<String> queryCmHandlesByPublicProperties(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
 
         final Map<String, String> publicPropertyQueryPairs =
                 getPropertyPairs(cmHandleQueryServiceParameters.getCmHandleQueryParameters(),
@@ -139,11 +143,12 @@
         if (publicPropertyQueryPairs.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return cmHandleQueryService.queryCmHandlePublicProperties(publicPropertyQueryPairs);
+        return cmHandleQueryService.queryCmHandlePublicProperties(publicPropertyQueryPairs, outputAlternateId);
     }
 
     private Collection<String> queryCmHandlesByTrustLevel(final CmHandleQueryServiceParameters
-                                                                  cmHandleQueryServiceParameters) {
+                                                                  cmHandleQueryServiceParameters,
+                                                          final Boolean outputAlternateId) {
 
         final Map<String, String> trustLevelPropertyQueryPairs =
                 getPropertyPairs(cmHandleQueryServiceParameters.getCmHandleQueryParameters(),
@@ -152,21 +157,21 @@
         if (trustLevelPropertyQueryPairs.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return cmHandleQueryService.queryCmHandlesByTrustLevel(trustLevelPropertyQueryPairs);
+        return cmHandleQueryService.queryCmHandlesByTrustLevel(trustLevelPropertyQueryPairs, outputAlternateId);
     }
 
     private Collection<String> executeModuleNameQuery(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
         final Collection<String> moduleNamesForQuery =
                 getModuleNamesForQuery(cmHandleQueryServiceParameters.getCmHandleQueryParameters());
         if (moduleNamesForQuery.isEmpty()) {
             return NO_QUERY_TO_EXECUTE;
         }
-        return inventoryPersistence.getCmHandleIdsWithGivenModules(moduleNamesForQuery);
+        return inventoryPersistence.getCmHandleReferencesWithGivenModules(moduleNamesForQuery, outputAlternateId);
     }
 
     private Collection<String> executeCpsPathQuery(
-            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
+            final CmHandleQueryServiceParameters cmHandleQueryServiceParameters, final Boolean outputAlternateId) {
         final Map<String, String> cpsPathCondition
             = getCpsPathCondition(cmHandleQueryServiceParameters.getCmHandleQueryParameters());
         if (!validateCpsPathConditionProperties(cpsPathCondition)) {
@@ -177,9 +182,9 @@
             return NO_QUERY_TO_EXECUTE;
         }
         try {
-            cpsPathQueryResult = collectCmHandleIdsFromDataNodes(
-                cmHandleQueryService.queryCmHandleAncestorsByCpsPath(
-                        cpsPathCondition.get("cpsPath"), OMIT_DESCENDANTS));
+            cpsPathQueryResult = collectCmHandleReferencesFromDataNodes(
+                cmHandleQueryService.queryCmHandleAncestorsByCpsPath(cpsPathCondition.get("cpsPath"), OMIT_DESCENDANTS),
+                outputAlternateId);
         } catch (final PathParsingException pathParsingException) {
             throw new DataValidationException(pathParsingException.getMessage(), pathParsingException.getDetails(),
                     pathParsingException);
@@ -220,10 +225,10 @@
         return Collections.emptyList();
     }
 
-    private Collection<String> getAllCmHandleIds() {
+    private Collection<String> getAllCmHandleReferences(final Boolean outputAlternateId) {
         final DataNode dataNode = inventoryPersistence.getDataNode(NCMP_DMI_REGISTRY_PARENT, DIRECT_CHILDREN_ONLY)
-                .iterator().next();
-        return collectCmHandleIdsFromDataNodes(dataNode.getChildDataNodes());
+            .iterator().next();
+        return collectCmHandleReferencesFromDataNodes(dataNode.getChildDataNodes(), outputAlternateId);
     }
 
     private Collection<NcmpServiceCmHandle> getNcmpServiceCmHandles(final Collection<String> cmHandleIds) {
@@ -243,14 +248,17 @@
     }
 
     private Collection<String> executeQueries(final CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
-                                              final Function<CmHandleQueryServiceParameters, Collection<String>>...
-                                                  queryFunctions) {
+                                              final Boolean outputAlternateId,
+                                              final BiFunction<CmHandleQueryServiceParameters, Boolean,
+                                                  Collection<String>>... queryFunctions) {
         if (cmHandleQueryServiceParameters.getCmHandleQueryParameters().isEmpty()) {
-            return getAllCmHandleIds();
+            return getAllCmHandleReferences(outputAlternateId);
         }
         Collection<String> combinedQueryResult = NO_QUERY_TO_EXECUTE;
-        for (final Function<CmHandleQueryServiceParameters, Collection<String>> queryFunction : queryFunctions) {
-            final Collection<String> queryResult = queryFunction.apply(cmHandleQueryServiceParameters);
+        for (final BiFunction<CmHandleQueryServiceParameters, Boolean,
+            Collection<String>> queryFunction : queryFunctions) {
+            final Collection<String> queryResult = queryFunction.apply(cmHandleQueryServiceParameters,
+                outputAlternateId);
             if (noEntriesFoundCanStopQuerying(queryResult)) {
                 return Collections.emptySet();
             }
@@ -277,8 +285,14 @@
         }
     }
 
-    private Collection<String> collectCmHandleIdsFromDataNodes(final Collection<DataNode> dataNodes) {
-        return dataNodes.stream().map(dataNode -> (String) dataNode.getLeaves().get("id")).collect(Collectors.toSet());
+    private Collection<String> collectCmHandleReferencesFromDataNodes(final Collection<DataNode> dataNodes,
+                                                               final Boolean outputAlternateId) {
+        if (Boolean.TRUE.equals(outputAlternateId)) {
+            return dataNodes.stream().map(dataNode ->
+                (String) dataNode.getLeaves().get("alternate-id")).collect(Collectors.toSet());
+        } else {
+            return dataNodes.stream().map(dataNode ->
+                (String) dataNode.getLeaves().get("id")).collect(Collectors.toSet());
+        }
     }
-
 }
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacadeSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacadeSpec.groovy
index 5f83ad5..c62e93c 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacadeSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/data/NetworkCmProxyFacadeSpec.groovy
@@ -42,9 +42,8 @@
     def mockDmiDataOperations = Mock(DmiDataOperations)
     def mockNcmpCachedResourceRequestHandler = Mock(NcmpCachedResourceRequestHandler)
     def mockNcmpPassthroughResourceRequestHandler = Mock(NcmpPassthroughResourceRequestHandler)
-    def mockAlternateIdMatcher =  Mock(AlternateIdMatcher)
 
-    def objectUnderTest = new NetworkCmProxyFacade(mockNcmpCachedResourceRequestHandler, mockNcmpPassthroughResourceRequestHandler, mockDmiDataOperations, mockAlternateIdMatcher)
+    def objectUnderTest = new NetworkCmProxyFacade(mockNcmpCachedResourceRequestHandler, mockNcmpPassthroughResourceRequestHandler, mockDmiDataOperations)
 
     def NO_TOPIC = null
 
@@ -89,7 +88,6 @@
         given: 'a cm resource address for datastore operational'
             def cmResourceAddress = new CmResourceAddress('ncmp-datastore:operational', 'some CM Handle', 'some resource Id')
         and: 'get resource data from DMI is called'
-            mockAlternateIdMatcher.getCmHandleId('some CM Handle') >> 'some CM Handle'
             mockNcmpCachedResourceRequestHandler.executeRequest(cmResourceAddress, 'options', NO_TOPIC, false, 'authorization') >>
                     Mono.just('dmi response')
         when: 'get resource data operational for the given cm resource address is called'
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImplSpec.groovy
index 7e34fe2..0c50e3d 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImplSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImplSpec.groovy
@@ -64,16 +64,16 @@
         given: 'the DataNodes queried for a given cpsPath are returned from the persistence service.'
             mockResponses()
         when: 'a query on cmhandle public properties is performed with a public property pair'
-            def result = objectUnderTest.queryCmHandlePublicProperties(publicPropertyPairs)
+            def result = objectUnderTest.queryCmHandlePublicProperties(publicPropertyPairs, outputAlternateId)
         then: 'the correct cm handle data objects are returned'
-            result.containsAll(expectedCmHandleIds)
-            result.size() == expectedCmHandleIds.size()
+            result.containsAll(expectedCmHandleReferences)
+            result.size() == expectedCmHandleReferences.size()
         where: 'the following data is used'
-            scenario                         | publicPropertyPairs                                                                      || expectedCmHandleIds
-            'single property matches'        | [Contact: 'newemailforstore@bookstore.com']                                              || ['PNFDemo', 'PNFDemo2', 'PNFDemo4']
-            'public property does not match' | [wont_match: 'wont_match']                                                               || []
-            '2 properties, only one match'   | [Contact: 'newemailforstore@bookstore.com', Contact2: 'newemailforstore2@bookstore.com'] || ['PNFDemo4']
-            '2 properties, no matches'       | [Contact: 'newemailforstore@bookstore.com', Contact2: '']                                || []
+            scenario                         | publicPropertyPairs                                                                      | outputAlternateId || expectedCmHandleReferences
+            'single property matches'        | [Contact: 'newemailforstore@bookstore.com']                                              | false             || ['PNFDemo', 'PNFDemo2', 'PNFDemo4']
+            'public property does not match' | [wont_match: 'wont_match']                                                               | false             || []
+            '2 properties, only one match'   | [Contact: 'newemailforstore@bookstore.com', Contact2: 'newemailforstore2@bookstore.com'] | true              || ['alt-PNFDemo4']
+            '2 properties, no matches'       | [Contact: 'newemailforstore@bookstore.com', Contact2: '']                                | false             || []
     }
 
     def 'Query cm handles on trust level'() {
@@ -84,22 +84,26 @@
         and: 'the DataNodes queried for a given cpsPath are returned from the persistence service'
             mockResponses()
         when: 'the query is run'
-            def result = objectUnderTest.queryCmHandlesByTrustLevel(trustLevelPropertyQueryPairs)
-        then: 'the result contain trusted PNFDemo'
+            def result = objectUnderTest.queryCmHandlesByTrustLevel(trustLevelPropertyQueryPairs, outputAlternateId)
+        then: 'the result contain trusted cmHandle reference'
             assert result.size() == 1
-            assert result[0] == 'PNFDemo'
+            assert result[0] == expectedCmHandleReference
+        where: 'the following data is used'
+            senario               | outputAlternateId | expectedCmHandleReference
+            'output cmHandleId'   |  false            | 'PNFDemo'
+            'output AlternateId'  |  true             | 'alt-PNFDemo'
     }
 
     def 'Query CmHandles using empty public properties query pair.'() {
         when: 'a query on CmHandle public properties is executed using an empty map'
-            def result = objectUnderTest.queryCmHandlePublicProperties([:])
+            def result = objectUnderTest.queryCmHandlePublicProperties([:], false)
         then: 'no cm handles are returned'
             result.size() == 0
     }
 
     def 'Query CmHandles using empty private properties query pair.'() {
         when: 'a query on CmHandle private properties is executed using an empty map'
-            def result = objectUnderTest.queryCmHandleAdditionalProperties([:])
+            def result = objectUnderTest.queryCmHandleAdditionalProperties([:], false)
         then: 'no cm handles are returned'
             result.size() == 0
     }
@@ -108,7 +112,7 @@
         given: 'a data node exists with a certain additional-property'
             mockCpsQueryService.queryDataNodes(_, _, dataNodeWithPrivateField, _) >> [pnfDemo5]
         when: 'a query on CmHandle private properties is executed using a map'
-            def result = objectUnderTest.queryCmHandleAdditionalProperties(['Contact3': 'newemailforstore3@bookstore.com'])
+            def result = objectUnderTest.queryCmHandleAdditionalProperties(['Contact3': 'newemailforstore3@bookstore.com'], false)
         then: 'one cm handle is returned'
             result.size() == 1
     }
@@ -206,6 +210,17 @@
             assert result.containsAll('PNFDemo', 'PNFDemo2', 'PNFDemo4')
     }
 
+    def 'Get all alternateIds by dmi plugin identifier'() {
+        given: 'the DataNodes queried for a given cpsPath are returned from the persistence service.'
+            mockResponses()
+        when: 'cm Handles are fetched for a given dmi plugin identifier'
+            def result = objectUnderTest.getCmHandleReferencesByDmiPluginIdentifier('my-dmi-plugin-identifier').values()
+        then: 'result is the correct size'
+            assert result.size() == 3
+        and: 'result contains the correct alternate Ids'
+            assert result.containsAll('alt-PNFDemo', 'alt-PNFDemo2', 'alt-PNFDemo4')
+    }
+
     void mockResponses() {
         mockCpsQueryService.queryDataNodes(_, _, '//public-properties[@name=\"Contact\" and @value=\"newemailforstore@bookstore.com\"]/ancestor::cm-handles', _) >> [pnfDemo, pnfDemo2, pnfDemo4]
         mockCpsQueryService.queryDataNodes(_, _, '//public-properties[@name=\"wont_match\" and @value=\"wont_match\"]/ancestor::cm-handles', _) >> []
@@ -219,6 +234,6 @@
     }
 
     def static createDataNode(dataNodeId) {
-        return new DataNode(xpath: '/dmi-registry/cm-handles[@id=\'' + dataNodeId + '\']', leaves: ['id':dataNodeId])
+        return new DataNode(xpath: '/dmi-registry/cm-handles[@id=\'' + dataNodeId + '\']', leaves: ['id':dataNodeId, 'alternate-id':'alt-' + dataNodeId])
     }
 }
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy
index 1830f13..e2261f4 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImplSpec.groovy
@@ -38,6 +38,7 @@
 import org.onap.cps.spi.model.ModuleReference
 import org.onap.cps.utils.ContentType
 import org.onap.cps.utils.JsonObjectMapper
+import org.testcontainers.shaded.com.fasterxml.jackson.databind.introspect.BasicClassIntrospector
 import spock.lang.Shared
 import spock.lang.Specification
 
@@ -332,13 +333,25 @@
             0 * mockCmHandleQueries.queryNcmpRegistryByCpsPath(_, _)
     }
 
-    def 'Get CM handles that has given module names'() {
+    def 'Get CM handle ids for CM Handles that has given module names'() {
         when: 'the method to get cm handles is called'
-            objectUnderTest.getCmHandleIdsWithGivenModules(['sample-module-name'])
+            objectUnderTest.getCmHandleReferencesWithGivenModules(['sample-module-name'], false)
         then: 'the admin persistence service method to query anchors is invoked once with the same parameter'
             1 * mockCpsAnchorService.queryAnchorNames(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, ['sample-module-name'])
     }
 
+    def 'Get Alternate Ids for CM Handles that has given module names'() {
+        given: 'A Collection of data nodes'
+            def dataNodes = [new DataNode(xpath: "/dmi-registry/cm-handles[@id='ch-1']", leaves: ['id': 'ch-1', 'alternate-id': 'alt-1'])]
+        when: 'the methods to get dataNodes is called and returns correct values'
+            mockCpsAnchorService.queryAnchorNames(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, ['sample-module-name']) >> ['ch-1']
+            mockCpsDataService.getDataNodesForMultipleXpaths(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, ["/dmi-registry/cm-handles[@id='ch-1']"], INCLUDE_ALL_DESCENDANTS) >> dataNodes
+        and: 'the method returns a result'
+            def result = objectUnderTest.getCmHandleReferencesWithGivenModules(['sample-module-name'], true)
+        then: 'the result contains the correct alternate Id'
+            assert result == ['alt-1'] as HashSet
+    }
+
     def 'Replace list content'() {
         when: 'replace list content method is called with xpath and data nodes collection'
             objectUnderTest.replaceListContent('sample xpath', [new DataNode()])
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
index a7dd38c..4c554c6 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy
@@ -61,7 +61,7 @@
             1 * mockCmHandleRegistrationService.updateDmiRegistration(dmiPluginRegistration)
     }
 
-    def 'Execute cm handle id search for inventory'() {
+    def 'Execute cm handle reference search for inventory'() {
         given: 'a ConditionApiProperties object'
             def conditionProperties = new ConditionProperties()
             conditionProperties.conditionName = 'hasAllProperties'
@@ -71,7 +71,7 @@
         and: 'the system returns an set of cmHandle ids'
             mockParameterizedCmHandleQueryService.queryCmHandleIdsForInventory(*_) >> [ 'cmHandle1', 'cmHandle2' ]
         when: 'executing the search'
-            def result = objectUnderTest.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters)
+            def result = objectUnderTest.executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters, false)
         then: 'the result returns the correct 2 elements'
             assert result.size() == 2
             assert result.contains('cmHandle1')
@@ -191,7 +191,7 @@
             'Cm Handle Reference as alternate-id' | 'some-alternate-id'
     }
 
-    def 'Execute cm handle id search'() {
+    def 'Execute cm handle reference search'() {
         given: 'valid CmHandleQueryApiParameters input'
             def cmHandleQueryApiParameters = new CmHandleQueryApiParameters()
             def conditionApiProperties = new ConditionApiProperties()
@@ -199,11 +199,11 @@
             conditionApiProperties.conditionParameters = [[moduleName: 'module-name-1']]
             cmHandleQueryApiParameters.cmHandleQueryParameters = [conditionApiProperties]
         and: 'query cm handle method return with a data node list'
-            mockParameterizedCmHandleQueryService.queryCmHandleIds(
-                spiedJsonObjectMapper.convertToValueType(cmHandleQueryApiParameters, CmHandleQueryServiceParameters.class))
+            mockParameterizedCmHandleQueryService.queryCmHandleReferenceIds(
+                spiedJsonObjectMapper.convertToValueType(cmHandleQueryApiParameters, CmHandleQueryServiceParameters.class), false)
                 >> ['cm-handle-id-1']
         when: 'execute cm handle search is called'
-            def result = objectUnderTest.executeCmHandleIdSearch(cmHandleQueryApiParameters)
+            def result = objectUnderTest.executeCmHandleIdSearch(cmHandleQueryApiParameters, false)
         then: 'result is the same collection as returned by the CPS Data Service'
             assert result == ['cm-handle-id-1']
     }
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy
index 013bace..9a81807 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/ParameterizedCmHandleQueryServiceSpec.groovy
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Nordix Foundation
+ *  Copyright (C) 2022-2024 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -50,11 +50,15 @@
             def conditionProperties = createConditionProperties('cmHandleWithCpsPath', [['cpsPath' : '/some/cps/path']])
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         and: 'the query get the cm handle datanodes excluding all descendants returns a datanode'
-            cmHandleQueries.queryCmHandleAncestorsByCpsPath('/some/cps/path', FetchDescendantsOption.OMIT_DESCENDANTS) >> [new DataNode(leaves: ['id':'some-cmhandle-id'])]
+            cmHandleQueries.queryCmHandleAncestorsByCpsPath('/some/cps/path', FetchDescendantsOption.OMIT_DESCENDANTS) >> [new DataNode(leaves: ['id':'some-cmhandle-id', 'alternate-id':'some-alternate-id'])]
         when: 'the query is executed for cm handle ids'
-            def result = objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
+            def result = objectUnderTest.queryCmHandleReferenceIds(cmHandleQueryParameters, outputAlternateId)
         then: 'the correct expected cm handles ids are returned'
-            assert result == ['some-cmhandle-id'] as Set
+            assert result == expectedCmhandleReference
+        where: 'the following data is used'
+            senario                   | outputAlternateId || expectedCmhandleReference
+            'output CmHandle Ids'     | false             || ['some-cmhandle-id'] as Set
+            'output Alternate Ids'    | true              || ['some-alternate-id'] as Set
     }
 
     def 'Query cm handle where  cps path itself is ancestor axis.'() {
@@ -63,11 +67,15 @@
             def conditionProperties = createConditionProperties('cmHandleWithCpsPath', [['cpsPath' : '/some/cps/path']])
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         and: 'the query get the cm handle data nodes excluding all descendants returns a datanode'
-            cmHandleQueries.queryCmHandleAncestorsByCpsPath('/some/cps/path', FetchDescendantsOption.OMIT_DESCENDANTS) >> [new DataNode(leaves: ['id':'some-cmhandle-id'])]
+            cmHandleQueries.queryCmHandleAncestorsByCpsPath('/some/cps/path', FetchDescendantsOption.OMIT_DESCENDANTS) >> [new DataNode(leaves: ['id':'some-cmhandle-id', 'alternate-id':'some-alternate-id'])]
         when: 'the query is executed for cm handle ids'
-            def result = objectUnderTest.queryCmHandleIdsForInventory(cmHandleQueryParameters)
+            def result = objectUnderTest.queryCmHandleIdsForInventory(cmHandleQueryParameters, outputAlternateId)
         then: 'the correct expected cm handles ids are returned'
-            assert result == ['some-cmhandle-id'] as Set
+            assert result == expectedCmhandleReference
+        where: 'the following data is used'
+            senario                    | outputAlternateId || expectedCmhandleReference
+            'outputAlternate is false' | false             || ['some-cmhandle-id'] as Set
+            'outputAlternate is true'  | true              || ['some-alternate-id'] as Set
     }
 
     def 'Cm handle ids query with error: #scenario.'() {
@@ -78,7 +86,7 @@
         and: 'cmHandleQueries throws a path parsing exception'
             cmHandleQueries.queryCmHandleAncestorsByCpsPath('/some/cps/path', FetchDescendantsOption.OMIT_DESCENDANTS) >> { throw thrownException }
         when: 'the query is executed for cm handle ids'
-            objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
+            objectUnderTest.queryCmHandleReferenceIds(cmHandleQueryParameters, false)
         then: 'a data validation exception is thrown'
             thrown(expectedException)
         where: 'the following data is used'
@@ -93,7 +101,7 @@
             def conditionProperties = createConditionProperties('cmHandleWithCpsPath', [['cpsPath' : '/additional-properties']])
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         when: 'the query is executed for cm handle ids'
-            def result = objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
+            def result = objectUnderTest.queryCmHandleReferenceIds(cmHandleQueryParameters, false)
         then: 'empty result is returned'
             assert result.isEmpty()
     }
@@ -104,9 +112,9 @@
             def conditionProperties = createConditionProperties('hasAllModules', [['moduleName': 'some-module-name']])
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         when: 'the query is executed for cm handle ids'
-            def result = objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
+            def result = objectUnderTest.queryCmHandleReferenceIds(cmHandleQueryParameters, false)
         then: 'the inventory service is called with the correct module names'
-            1 * mockInventoryPersistence.getCmHandleIdsWithGivenModules(['some-module-name']) >> cmHandleIdsFromService
+            1 * mockInventoryPersistence.getCmHandleReferencesWithGivenModules(['some-module-name'], false) >> cmHandleIdsFromService
         and: 'the correct expected cm handles ids are returned'
             assert result.size() == cmHandleIdsFromService.size()
             assert result.containsAll(cmHandleIdsFromService)
@@ -122,9 +130,9 @@
             def trustLevelConditionProperties = createConditionProperties('cmHandleWithTrustLevel', [['trustLevel': 'COMPLETE'] as Map])
             trustLevelQueryParameters.setCmHandleQueryParameters([trustLevelConditionProperties])
         when: 'the query is being executed'
-            objectUnderTest.queryCmHandleIds(trustLevelQueryParameters)
+            objectUnderTest.queryCmHandleReferenceIds(trustLevelQueryParameters, false)
         then: 'the query is being delegated to the cm handle query service with correct parameter'
-            1 * cmHandleQueries.queryCmHandlesByTrustLevel(['trustLevel': 'COMPLETE'] as Map)
+            1 * cmHandleQueries.queryCmHandlesByTrustLevel(['trustLevel': 'COMPLETE'] as Map, false)
     }
 
     def 'Query cm handle details with module names when #scenario from query.'() {
@@ -135,7 +143,7 @@
         when: 'the query is executed for cm handle ids'
             def result = objectUnderTest.queryCmHandles(cmHandleQueryParameters)
         then: 'the inventory service is called with the correct module names'
-            1 * mockInventoryPersistence.getCmHandleIdsWithGivenModules(['some-module-name']) >> ['ch1']
+            1 * mockInventoryPersistence.getCmHandleReferencesWithGivenModules(['some-module-name'], false) >> ['ch1']
         and: 'the inventory service is called with teh correct if and returns a yang model cm handle'
             1 * mockInventoryPersistence.getYangModelCmHandles(['ch1']) >>
                 [new YangModelCmHandle(id: 'abc', dmiProperties: [new YangModelCmHandle.Property('name','value')], publicProperties: [])]
@@ -145,15 +153,19 @@
             assert result[0].dmiProperties == [name:'value']
     }
 
-    def 'Query cm handle ids when the query is empty.'() {
+    def 'Query cm handle references when the query is empty.'() {
         given: 'We use an empty query'
             def cmHandleQueryParameters = new CmHandleQueryServiceParameters()
         and: 'the inventory persistence returns the dmi registry datanode with just ids'
             mockInventoryPersistence.getDataNode(NCMP_DMI_REGISTRY_PARENT, FetchDescendantsOption.DIRECT_CHILDREN_ONLY) >> [dmiRegistry]
         when: 'the query is executed for both cm handle ids'
-            def result = objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
+            def result = objectUnderTest.queryCmHandleReferenceIds(cmHandleQueryParameters, outputAlternateId)
         then: 'the correct expected cm handles are returned'
-            assert result.containsAll('PNFDemo1', 'PNFDemo2', 'PNFDemo3', 'PNFDemo4')
+            assert result.containsAll(expectedCmhandleReferences)
+        where: 'the following data is used'
+            senario                    | outputAlternateId || expectedCmhandleReferences
+            'outputAlternate is false' | false             || ['PNFDemo1', 'PNFDemo2', 'PNFDemo3', 'PNFDemo4']
+            'outputAlternate is true'  | true              || ['alt-PNFDemo1', 'alt-PNFDemo2', 'alt-PNFDemo3', 'alt-PNFDemo4']
     }
 
     def 'Query cm handle details when the query is empty.'() {
@@ -177,7 +189,7 @@
             partiallyMockedCmHandleQueries.queryCmHandlePublicProperties(*_) >> cmHandlesWithMatchingPublicProperties
             partiallyMockedCmHandleQueries.queryCmHandleAdditionalProperties(*_) >> cmHandlesWithMatchingPrivateProperties
         when: 'the query executed'
-            def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters)
+            def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters, false)
         then: 'the expected number of results are returned.'
             assert result.size() == expectedCmHandleIdsSize
         where: 'the following data is used'
@@ -195,14 +207,15 @@
             cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
         and: 'the inventoryPersistence returns different CmHandleIds'
             partiallyMockedCmHandleQueries.getCmHandleIdsByDmiPluginIdentifier(*_) >> cmHandleQueryResult
+            partiallyMockedCmHandleQueries.getCmHandleReferencesByDmiPluginIdentifier(*_) >> cmHandleQueryResult
         when: 'the query executed'
-            def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters)
+            def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters, outputAlternateId)
         then: 'the expected number of results are returned.'
             assert result.size() == expectedCmHandleIdsSize
         where: 'the following data is used'
-            scenario       | cmHandleQueryResult || expectedCmHandleIdsSize
-            'some matches' | ['h1','h2']         || 2
-            'no matches'   | []                  || 0
+            scenario       | cmHandleQueryResult | outputAlternateId || expectedCmHandleIdsSize
+            'some matches' | ['h1','h2']         | false             || 2
+            'no matches'   | [:]                  | true              || 0
     }
 
     def 'Combine two query results where #scenario.'() {
@@ -227,7 +240,7 @@
 
     def static createDataNodeList(dataNodeIds) {
         def dataNodes =[]
-        dataNodeIds.each{ dataNodes << new DataNode(xpath: "/dmi-registry/cm-handles[@id='${it}']", leaves: ['id':it]) }
+        dataNodeIds.each{ dataNodes << new DataNode(xpath: "/dmi-registry/cm-handles[@id='${it}']", leaves: ['id':it, 'alternate-id':'alt-' + it]) }
         return dataNodes
     }
 }
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/RestApiSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/RestApiSpec.groovy
index 2655628..7ce3cf5 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/RestApiSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/RestApiSpec.groovy
@@ -67,15 +67,20 @@
                     ]
                 }""".formatted(moduleName)
         expect: "a search for module ${moduleName} returns expected CM handles"
-            mvc.perform(post('/ncmp/v1/ch/id-searches').contentType(MediaType.APPLICATION_JSON).content(requestBodyWithModuleCondition))
+            mvc.perform(post('/ncmp/v1/ch/id-searches'+outputAlternateId).contentType(MediaType.APPLICATION_JSON).content(requestBodyWithModuleCondition))
                     .andExpect(status().is2xxSuccessful())
-                    .andExpect(jsonPath('$[*]', containsInAnyOrder(expectedCmHandles.toArray())))
-                    .andExpect(jsonPath('$', hasSize(expectedCmHandles.size())));
+                    .andExpect(jsonPath('$[*]', containsInAnyOrder(expectedCmHandleReferences.toArray())))
+                    .andExpect(jsonPath('$', hasSize(expectedCmHandleReferences.size())));
         where:
-            moduleName || expectedCmHandles
-            'M1'       || ['ch-1', 'ch-2', 'ch-3']
-            'M2'       || ['ch-1', 'ch-2']
-            'M3'       || ['ch-3']
+            moduleName | outputAlternateId           || expectedCmHandleReferences
+            'M1'       | '?outputAlternateId=false'  || ['ch-1', 'ch-2', 'ch-3']
+            'M2'       | '?outputAlternateId=false'  || ['ch-1', 'ch-2']
+            'M3'       | '?outputAlternateId=false'  || ['ch-3']
+            'M1'       | '?outputAlternateId=true'   || ['alt-1', 'alt-2', 'alt-3']
+            'M2'       | '?outputAlternateId=true'   || ['alt-1', 'alt-2']
+            'M3'       | '?outputAlternateId=true'   || ['alt-3']
+            'M1'       | ''                          || ['ch-1', 'ch-2', 'ch-3']
+
     }
 
     def 'Search for CM Handles using Cps Path Query.'() {