Skip to content

Commit

Permalink
Merge pull request #1393 from ish-hcc/ibm_fix_region_info
Browse files Browse the repository at this point in the history
IBM: Show display names of regions
  • Loading branch information
powerkimhub authored Dec 5, 2024
2 parents 22a046a + 57d55c4 commit cf991a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
return nil, getErr
}

regionDisplayNames := map[string]string{
"au-syd": "Sydney",
"br-sao": "Sao Paulo",
"ca-tor": "Toronto",
"eu-de": "Frankfurt",
"eu-gb": "London",
"eu-es": "Madrid",
"in-che": "Chennai",
"jp-osa": "Osaka",
"jp-tok": "Tokyo",
"us-east": "Washington DC",
"us-south": "Dallas",
}

var regionZoneInfo []*irs.RegionZoneInfo

var routineMax = 20
Expand Down Expand Up @@ -62,6 +76,9 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
return
}

regionName := *reg.Name
regionDisplayName := regionDisplayNames[regionName]

for _, zone := range zones.Zones {
var status = irs.ZoneAvailable

Expand All @@ -70,7 +87,7 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
}
zoneList = append(zoneList, irs.ZoneInfo{
Name: *zone.Name,
DisplayName: *zone.Name,
DisplayName: regionDisplayName,
Status: status,
KeyValueList: []irs.KeyValue{},
})
Expand All @@ -79,7 +96,7 @@ func (regionZoneHandler *IbmRegionZoneHandler) ListRegionZone() ([]*irs.RegionZo
mutex.Lock()
regionZoneInfo = append(regionZoneInfo, &irs.RegionZoneInfo{
Name: *reg.Name,
DisplayName: *reg.Name,
DisplayName: regionDisplayName,
ZoneList: zoneList,
KeyValueList: []irs.KeyValue{},
})
Expand Down
Empty file.

0 comments on commit cf991a0

Please sign in to comment.