summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
authorniamhcore <niamh.core@est.tech>2021-09-29 16:43:35 +0100
committerniamhcore <niamh.core@est.tech>2021-10-06 10:03:15 +0100
commitfd2e6ddde2c2260951e2dfd5e3fd7f4bd04976e1 (patch)
tree1ba737d69631d3ab620c90e99964b68d72fd1317 /cps-ncmp-service/src/main
parentfdcb36fa9db642df3c47637d32f4e7ac5dd347e8 (diff)
Changing resource identifier to a query param
*Update dmi operations to build dmi url using query param Issue-ID: CPS-679 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I2292507c5057837932f8e21f1a8e80721066b336
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
index 71af3d4cfe..c295e0328e 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operation/DmiOperations.java
@@ -52,6 +52,8 @@ public class DmiOperations {
private static final String DMI_CM_HANDLE_PATH = "/v1/ch/{cmHandle}";
private static final String DMI_CM_HANDLE_DATASTORE_PATH = DMI_CM_HANDLE_PATH + "/data/ds";
private static final String URL_SEPARATOR = "/";
+ private static final String RESOURCE_IDENTIFIER = "resourceIdentifier";
+
/**
* Constructor for {@code DmiOperations}. This method also manipulates url properties.
@@ -199,7 +201,7 @@ public class DmiOperations {
stringBuilder.append(DMI_API_PATH);
stringBuilder.append(DMI_CM_HANDLE_DATASTORE_PATH.replace("{cmHandle}", cmHandle));
stringBuilder.append(URL_SEPARATOR + dataStoreEnum.getValue());
- stringBuilder.append(URL_SEPARATOR + resourceId);
+ stringBuilder.append("?" + RESOURCE_IDENTIFIER + "=" + resourceId);
return stringBuilder;
}
@@ -208,15 +210,10 @@ public class DmiOperations {
final Integer depthQuery) {
final var doesFieldExists = (fieldsQuery != null && !fieldsQuery.isEmpty());
if (doesFieldExists) {
- stringBuilder.append("?").append("fields=").append(fieldsQuery);
+ stringBuilder.append("&").append("fields=").append(fieldsQuery);
}
if (depthQuery != null) {
- if (doesFieldExists) {
- stringBuilder.append("&");
- } else {
- stringBuilder.append("?");
- }
- stringBuilder.append("depth=").append(depthQuery);
+ stringBuilder.append("&").append("depth=").append(depthQuery);
}
}