Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminate storageSystemID API and get storageName from the request #283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -898,10 +901,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 {
Expand Down Expand Up @@ -1069,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)
Expand Down Expand Up @@ -1122,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)
Expand Down Expand Up @@ -1167,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)
Expand Down Expand Up @@ -1218,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)
Expand Down