Skip to content

Commit 446b3b9

Browse files
ianreehkantare
authored andcommitted
Add custom endpoints for Logs Routing
1 parent e50b298 commit 446b3b9

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

examples/ibm-logs-routing/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,28 @@ data "ibm_logs_router_targets" "logs_router_targets_instance" {
123123
| Name | Version |
124124
|------|---------|
125125
| ibm | 1.13.1 |
126+
127+
## Notes
128+
129+
### The Logs Routing URL can be set in endpoints.json
130+
131+
**Example**:
132+
133+
```json
134+
{
135+
"IBMCLOUD_LOGS_ROUTING_API_ENDPOINT":{
136+
"public":{
137+
"us-south":"<endpoint>",
138+
"us-east":"<endpoint>",
139+
"eu-gb":"<endpoint>",
140+
"eu-de":"<endpoint>"
141+
},
142+
"private":{
143+
"us-south":"<endpoint>",
144+
"us-east":"<endpoint>",
145+
"eu-gb":"<endpoint>",
146+
"eu-de":"<endpoint>"
147+
}
148+
}
149+
}
150+
```

ibm/conns/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,11 +1711,10 @@ func (c *Config) ClientSession() (interface{}, error) {
17111711
var logsrouterClientURL string
17121712
var logsrouterURLErr error
17131713

1714-
if c.Visibility == "private" || c.Visibility == "public-and-private" {
1714+
if fileMap != nil && c.Visibility != "public-and-private" {
1715+
logsrouterClientURL = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_LOGS_ROUTING_API_ENDPOINT", c.Region, ibmcloudlogsroutingv0.DefaultServiceURL)
1716+
} else if c.Visibility == "private" || c.Visibility == "public-and-private" {
17151717
logsrouterClientURL, logsrouterURLErr = ibmcloudlogsroutingv0.GetServiceURLForRegion("private." + c.Region)
1716-
if err != nil && c.Visibility == "public-and-private" {
1717-
logsrouterClientURL, logsrouterURLErr = ibmcloudlogsroutingv0.GetServiceURLForRegion(c.Region)
1718-
}
17191718
} else {
17201719
logsrouterClientURL, logsrouterURLErr = ibmcloudlogsroutingv0.GetServiceURLForRegion(c.Region)
17211720
}

website/docs/guides/custom-service-endpoints.html.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ provider "ibm" {
8585
|UAA|IBMCLOUD_UAA_ENDPOINT|
8686
|User Management|IBMCLOUD_USER_MANAGEMENT_ENDPOINT|
8787
|Event Notifications|IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT|
88+
|Logs Routing|IBMCLOUD_LOGS_ROUTING_API_ENDPOINT|
8889

8990
## File structure for endpoints file
9091

0 commit comments

Comments
 (0)