aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
diff options
context:
space:
mode:
authormalar <malarvizhi.44@wipro.com>2022-11-09 11:21:02 +0000
committermalar <malarvizhi.44@wipro.com>2022-11-22 06:22:25 +0000
commit4949855dff35b340038bffc489b1e68f340cf5ce (patch)
tree566a3f7e0bf019f25c6c24c04a9e1ebdccb5975a /src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
parent55659eb8915a9107a55fc4ef56399734340a7a1a (diff)
Modify ANR Payload aligned to A1 schema in SDNR2.1.11-son-handler
Issue-ID: DCAEGEN2-3311 Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com> Change-Id: I809f59972b207b1a9e68f0a2339514b6c7761bb7
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
index caf94f1..2fa9514 100644
--- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
+++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java
@@ -139,14 +139,20 @@ public class CpsClient extends ConfigInterface {
public static String getRicId(String cellId) throws CpsNotFoundException {
Configuration configuration = Configuration.getInstance();
+ String responseObject = "";
String requestUrl = configuration.getCpsServiceUrl() + "/" + configuration.getGetRicIdUrl();
JSONObject inputparam = new JSONObject();
JSONObject reqbody = new JSONObject();
inputparam.put("cellId", cellId);
reqbody.put("inputParameters", inputparam);
String response = sendRequest(requestUrl, reqbody);
- JSONObject responseObject = new JSONObject(response);
- return responseObject.getString("idNearRTRIC");
+ log.info("Response from CPS is : " + response);
+ JSONArray requestArray = new JSONArray(response);
+ for (int i=0;i<requestArray.length();i++) {
+ String ricId = requestArray.getJSONObject(i).optString("idNearRTRIC");
+ responseObject = ricId;
+ }
+ return responseObject;
}
/**