Skip to content

Commit

Permalink
Removed the region variable from tagging and search private api const…
Browse files Browse the repository at this point in the history
…ruction
  • Loading branch information
ujjwal-ibm committed Dec 3, 2024
1 parent 8e5251c commit 0b1868c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ibm/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,13 @@ func (c *Config) ClientSession() (interface{}, error) {
// GLOBAL TAGGING Service
globalTaggingEndpoint := "https://tags.global-search-tagging.cloud.ibm.com"
if c.Visibility == "private" || c.Visibility == "public-and-private" {
globalTaggingEndpoint = ContructEndpoint("tags.private.", fmt.Sprintf("global-search-tagging.%s", cloudEndpoint))
var globalTaggingRegion string
if c.Region != "us-south" && c.Region != "us-east" {
globalTaggingRegion = "us-south"
} else {
globalTaggingRegion = c.Region
}
globalTaggingEndpoint = ContructEndpoint(fmt.Sprintf("tags.private.%s", globalTaggingRegion), fmt.Sprintf("global-search-tagging.%s", cloudEndpoint))
}
if fileMap != nil && c.Visibility != "public-and-private" {
globalTaggingEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_GT_API_ENDPOINT", c.Region, globalTaggingEndpoint)
Expand All @@ -2159,7 +2165,13 @@ func (c *Config) ClientSession() (interface{}, error) {
// GLOBAL TAGGING Service
globalSearchEndpoint := "https://api.global-search-tagging.cloud.ibm.com"
if c.Visibility == "private" || c.Visibility == "public-and-private" {
globalSearchEndpoint = ContructEndpoint("api.private.", fmt.Sprintf("global-search-tagging.%s", cloudEndpoint))
var globalSearchRegion string
if c.Region != "us-south" && c.Region != "au-syd" && c.Region != "eu-gb" {
globalSearchRegion = "us-south"
} else {
globalSearchRegion = c.Region
}
globalSearchEndpoint = ContructEndpoint(fmt.Sprintf("api.private.%s", globalSearchRegion), fmt.Sprintf("global-search-tagging.%s", cloudEndpoint))
}
if fileMap != nil && c.Visibility != "public-and-private" {
globalSearchEndpoint = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_GS_API_ENDPOINT", c.Region, searchv2.DefaultServiceURL)
Expand Down

0 comments on commit 0b1868c

Please sign in to comment.