From 4b36613c35c3ad37a8b796d8104a0e3b953c0ebc Mon Sep 17 00:00:00 2001 From: Anjanaa Date: Mon, 6 Mar 2023 14:54:35 +0530 Subject: [PATCH 1/2] eliminate storageSystemID API and get storageName from the request --- .../gimel/common/gimelservices/GimelServiceUtilities.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala b/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala index 6fcdc360..cffbcf3d 100644 --- a/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala +++ b/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala @@ -898,10 +898,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] val storageType = dataset.split('.').head val storageSystemTypeName: String = storageType + "." + dataset.split('.').tail.mkString(".").split('.').head val storageSystemProps = getSystemAttributesMapByName(storageSystemTypeName) - val storageSystemID = storageSystemProps(PCatalogPayloadConstants.STORAGE_SYSTEM_ID).toInt - val storage = getStorageSystem(storageSystemID) - val storageTypeName = storage.storageType.storageTypeName - val objProps: scala.collection.mutable.Map[String, String] = getObjectPropertiesForSystem(storageTypeName, dataset) + val objProps: scala.collection.mutable.Map[String, String] = getObjectPropertiesForSystem(storageType, dataset) val allProps: Map[String, String] = { storageSystemProps ++ objProps }.map { From 41a6cdee9bc2798d0ed025ef2bd2e131800a2f81 Mon Sep 17 00:00:00 2001 From: Anjanaa Date: Tue, 7 Mar 2023 14:19:37 +0530 Subject: [PATCH 2/2] added clientid header to track request --- .../gimel/common/gimelservices/GimelServiceUtilities.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala b/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala index cffbcf3d..8896f07f 100644 --- a/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala +++ b/gimel-dataapi/gimel-common/src/main/scala/com/paypal/gimel/common/gimelservices/GimelServiceUtilities.scala @@ -215,6 +215,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) val requesting: HttpGet = new HttpGet(url) + requesting.setHeader("clientId", "gimel") headerMap.foreach(x => requesting.addHeader(x._1, x._2)) val httpResponse: CloseableHttpResponse = client.execute(requesting) val resStream: InputStream = httpResponse.getEntity.getContent @@ -254,6 +255,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) val requesting: HttpGet = new HttpGet(url) + requesting.setHeader("clientId", "gimel") headerMap.foreach(x => requesting.addHeader(x._1, x._2)) val httpResponse: CloseableHttpResponse = client.execute(requesting) val resStream: InputStream = httpResponse.getEntity.getContent @@ -285,6 +287,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, GimelConstants.CONNECTION_TIMEOUT * 1000) val requesting: HttpGet = new HttpGet(url) + requesting.setHeader("clientId", "gimel") headerMap.foreach(x => requesting.addHeader(x._1, x._2)) val httpResponse: CloseableHttpResponse = client.execute(requesting) status = httpResponse.getStatusLine.getStatusCode @@ -1066,6 +1069,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] try { val post = new HttpPost(url) post.addHeader("Content-type", "application/json") + post.setHeader("clientId", "gimel") headerMap.foreach(x => post.addHeader(x._1, x._2)) post.setEntity(new StringEntity(payload)) val httpResponse = client.execute(post) @@ -1119,6 +1123,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] try { val post = new HttpPost(url) post.addHeader("Content-type", "application/json") + post.setHeader("clientId", "gimel") headerMap.foreach(x => post.addHeader(x._1, x._2)) post.setEntity(new StringEntity(payload)) val httpResponse = client.execute(post) @@ -1164,6 +1169,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] try { val put = new HttpPut(url) put.addHeader("Content-type", "application/json") + put.setHeader("clientId", "gimel") headerMap.foreach(x => put.addHeader(x._1, x._2)) put.setEntity(new StringEntity(payload)) val httpResponse = client.execute(put) @@ -1215,6 +1221,7 @@ class GimelServiceUtilities(userProps: Map[String, String] = Map[String, String] try { val put = new HttpPut(url) put.addHeader("Content-type", "application/json") + put.setHeader("clientId", "gimel") headerMap.foreach(x => put.addHeader(x._1, x._2)) put.setEntity(new StringEntity(payload)) val httpResponse = client.execute(put)