Skip to content

Commit aef263a

Browse files
authored
Merge pull request #37 from oracle/feature/region_codes_izq
New OCI region code: IZQ / OC31 / ap-hobsonville-1
2 parents a247f50 + 29a7a36 commit aef263a

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1313

1414
- Cloud only: new regions: sa-bogota-1, us-dcc-swjordan-1,
1515
us-dcc-swjordan-2, ap-dcc-tokyo-1, me-abudhabi-3,
16-
ap-dcc-gazipur-1, me-dcc-doha-1
16+
ap-dcc-gazipur-1, me-dcc-doha-1, ap-hobsonville-1
1717
- added support for array_collect() and count(distinct) in queries. These
1818
require server side support which is only available in Oracle NoSQL releases
1919
23.3 and higher and will not be immediately available in the cloud service

src/borneo/config.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ class Region(object):
256256
OC26_EP_BASE = 'https://nosql.{0}.oci.oraclecloud26.com'
257257
OC27_EP_BASE = 'https://nosql.{0}.oci.oraclecloud27.com'
258258
OC28_EP_BASE = 'https://nosql.{0}.oci.oraclecloud28.com'
259+
OC31_EP_BASE = 'https://nosql.{0}.oci.sovereigncloud.nz'
259260

260261
def __init__(self, region_id):
261262
self._region_id = region_id
@@ -312,6 +313,8 @@ def endpoint(self):
312313
return str.format(Region.OC27_EP_BASE, self._region_id)
313314
if self._is_oc28_region():
314315
return str.format(Region.OC28_EP_BASE, self._region_id)
316+
if self._is_oc31_region():
317+
return str.format(Region.OC31_EP_BASE, self._region_id)
315318
raise IllegalArgumentException(
316319
'Unable to find endpoint for unknown region ' + self._region_id)
317320

@@ -410,6 +413,10 @@ def _is_oc28_region(self):
410413
# Internal use only
411414
return Regions.OC28_REGIONS.get(self._region_id) is not None
412415

416+
def _is_oc31_region(self):
417+
# Internal use only
418+
return Regions.OC31_REGIONS.get(self._region_id) is not None
419+
413420

414421
class Regions(object):
415422
"""
@@ -641,6 +648,10 @@ class Regions(object):
641648
US_DCC_SWJORDAN_2 = Region('us-dcc-swjordan-2')
642649
"""Region Location: Utah, USA"""
643650

651+
# OC31
652+
AP_HOBSONVILLE_1 = Region('ap-hobsonville-1')
653+
"""Region Location: New Zealand"""
654+
644655
# OC1
645656
OC1_REGIONS = dict()
646657
"""A dict containing the OC1 regions."""
@@ -803,6 +814,11 @@ class Regions(object):
803814
"""A dict containing the OC28 regions."""
804815
OC28_REGIONS[US_DCC_SWJORDAN_2.get_region_id()] = US_DCC_SWJORDAN_2
805816

817+
# OC31
818+
OC31_REGIONS = dict()
819+
"""A dict containing the OC31 regions."""
820+
OC31_REGIONS[AP_HOBSONVILLE_1.get_region_id()] = AP_HOBSONVILLE_1
821+
806822
@staticmethod
807823
def get_oc1_regions():
808824
# Internal use only
@@ -908,6 +924,11 @@ def get_oc28_regions():
908924
# Internal use only
909925
return Regions.OC28_REGIONS.values()
910926

927+
@staticmethod
928+
def get_oc31_regions():
929+
# Internal use only
930+
return Regions.OC31_REGIONS.values()
931+
911932
@staticmethod
912933
def from_region_id(region_id):
913934
"""
@@ -964,6 +985,8 @@ def from_region_id(region_id):
964985
region = Regions.OC27_REGIONS.get(region_id)
965986
if region is None:
966987
region = Regions.OC28_REGIONS.get(region_id)
988+
if region is None:
989+
region = Regions.OC31_REGIONS.get(region_id)
967990
return region
968991

969992

0 commit comments

Comments
 (0)