Skip to content

Commit 3b807e2

Browse files
authored
Add new regions eu-dcc-rome-1, eu-dcc-zurich-1, us-saltlake-2, sa-valparaiso-1
1 parent 21e8393 commit 3b807e2

File tree

2 files changed

+60
-6
lines changed

2 files changed

+60
-6
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
88
Unpublished
99
====================
1010

11-
NOTE: will be 5.4.x -- drop Python 2.7 support
11+
IMPORTANT: This release drops support for Python 2 and supports only Python
12+
3.5 and higher
1213

1314
Added
1415
_____
1516
* Cloud only: New regions: mx-monterrey-1, eu-frankfurt-2,
16-
eu-madrid-2, eu-jovanovac-1, us-dcc-phoenix-4
17+
eu-madrid-2, eu-jovanovac-1, eu-dcc-rome-1, eu-dcc-zurich-1, us-dcc-phoenix-4,
18+
us-saltlake-2, sa-valparaiso-1
1719
* Support for new, flexible wire protocol (V4) has been added. The previous protocol
1820
is still supported for communication with servers that do not yet support V4. The
1921
version negotation is internal and automatic; however, use of V4 features will fail

src/borneo/config.py

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ class Region(object):
248248
OC17_EP_BASE = 'https://nosql.{0}.oci.oraclecloud17.com'
249249
OC19_EP_BASE = 'https://nosql.{0}.oci.oraclecloud.eu'
250250
OC20_EP_BASE = 'https://nosql.{0}.oci.oraclecloud20.com'
251+
OC22_EP_BASE = 'https://nosql.{0}.oci.oraclecloud22.com'
252+
OC24_EP_BASE = 'https://nosql.{0}.oci.oraclecloud24.com'
251253

252254
def __init__(self, region_id):
253255
self._region_id = region_id
@@ -288,6 +290,10 @@ def endpoint(self):
288290
return str.format(Region.OC19_EP_BASE, self._region_id)
289291
if self._is_oc20_region():
290292
return str.format(Region.OC20_EP_BASE, self._region_id)
293+
if self._is_oc22_region():
294+
return str.format(Region.OC22_EP_BASE, self._region_id)
295+
if self._is_oc24_region():
296+
return str.format(Region.OC24_EP_BASE, self._region_id)
291297
raise IllegalArgumentException(
292298
'Unable to find endpoint for unknown region ' + self._region_id)
293299

@@ -354,6 +360,14 @@ def _is_oc20_region(self):
354360
# Internal use only
355361
return Regions.OC20_REGIONS.get(self._region_id) is not None
356362

363+
def _is_oc22_region(self):
364+
# Internal use only
365+
return Regions.OC22_REGIONS.get(self._region_id) is not None
366+
367+
def _is_oc24_region(self):
368+
# Internal use only
369+
return Regions.OC24_REGIONS.get(self._region_id) is not None
370+
357371

358372
class Regions(object):
359373
"""
@@ -455,12 +469,14 @@ class Regions(object):
455469

456470
US_ASHBURN_1 = Region('us-ashburn-1')
457471
"""Region Location: Ashburn, VA"""
472+
US_CHICAGO_1 = Region('us-chicago-1')
473+
"""Region Location: Chicago, IL """
458474
US_PHOENIX_1 = Region('us-phoenix-1')
459475
"""Region Location: Phoenix, AZ"""
476+
US_SALTLAKE_2 = Region('us-saltlake-2')
477+
"""Region Location: Salt Lake City, UT """
460478
US_SANJOSE_1 = Region('us-sanjose-1')
461-
"""Region Location: Phoenix, AZ """
462-
US_CHICAGO_1 = Region('us-chicago-1')
463-
"""Region Location: Chicago, IL """
479+
"""Region Location: San Jose, CA, AZ """
464480
CA_MONTREAL_1 = Region('ca-montreal-1')
465481
"""Region Location: Montreal, Canada"""
466482
CA_TORONTO_1 = Region('ca-toronto-1')
@@ -470,6 +486,8 @@ class Regions(object):
470486
"""Region Location: Santiago, Chile"""
471487
SA_SAOPAULO_1 = Region('sa-saopaulo-1')
472488
"""Region Location: Sao Paulo, Brazil"""
489+
SA_VALPARAISO_1 = Region('sa-valparaiso-1')
490+
"""Region Location: Valparaiso, Chile"""
473491
SA_VINHEDO_1 = Region('sa-vinhedo-1')
474492
"""Region Location: Vinhedo, Brazil"""
475493

@@ -547,6 +565,14 @@ class Regions(object):
547565
EU_JOVANOVAC_1 = Region('eu-jovanovac-1')
548566
"""Region Location: Serbia"""
549567

568+
# OC22
569+
EU_DCC_ROME_1 = Region('eu-dcc-rome-1')
570+
"""Region Location: Rome, Italy"""
571+
572+
# OC24
573+
EU_DCC_ZURICH_1 = Region('eu-dcc-zurich-1')
574+
"""Region Location: Zurich, Switzerland"""
575+
550576
# OC1
551577
OC1_REGIONS = dict()
552578
"""A dict containing the OC1 regions."""
@@ -581,14 +607,16 @@ class Regions(object):
581607
# LAD
582608
OC1_REGIONS[SA_SANTIAGO_1.get_region_id()] = SA_SANTIAGO_1
583609
OC1_REGIONS[SA_SAOPAULO_1.get_region_id()] = SA_SAOPAULO_1
610+
OC1_REGIONS[SA_VALPARAISO_1.get_region_id()] = SA_VALPARAISO_1
584611
OC1_REGIONS[SA_VINHEDO_1.get_region_id()] = SA_VINHEDO_1
585612

586613
# North America
587614
OC1_REGIONS[US_ASHBURN_1.get_region_id()] = US_ASHBURN_1
588615
OC1_REGIONS[CA_MONTREAL_1.get_region_id()] = CA_MONTREAL_1
616+
OC1_REGIONS[US_CHICAGO_1.get_region_id()] = US_CHICAGO_1
589617
OC1_REGIONS[US_PHOENIX_1.get_region_id()] = US_PHOENIX_1
590618
OC1_REGIONS[US_SANJOSE_1.get_region_id()] = US_SANJOSE_1
591-
OC1_REGIONS[US_CHICAGO_1.get_region_id()] = US_CHICAGO_1
619+
OC1_REGIONS[US_SALTLAKE_2.get_region_id()] = US_SALTLAKE_2
592620
OC1_REGIONS[CA_TORONTO_1.get_region_id()] = CA_TORONTO_1
593621
OC1_REGIONS[MX_QUERETARO_1.get_region_id()] = MX_QUERETARO_1
594622
OC1_REGIONS[MX_MONTERREY_1.get_region_id()] = MX_MONTERREY_1
@@ -666,6 +694,16 @@ class Regions(object):
666694
"""A dict containing the OC20 regions."""
667695
OC20_REGIONS[EU_JOVANOVAC_1.get_region_id()] = EU_JOVANOVAC_1
668696

697+
# OC22
698+
OC22_REGIONS = dict()
699+
"""A dict containing the OC22 regions."""
700+
OC22_REGIONS[EU_DCC_ROME_1.get_region_id()] = EU_DCC_ROME_1
701+
702+
# OC24
703+
OC24_REGIONS = dict()
704+
"""A dict containing the OC22 regions."""
705+
OC24_REGIONS[EU_DCC_ZURICH_1.get_region_id()] = EU_DCC_ZURICH_1
706+
669707
@staticmethod
670708
def get_oc1_regions():
671709
# Internal use only
@@ -731,6 +769,16 @@ def get_oc20_regions():
731769
# Internal use only
732770
return Regions.OC20_REGIONS.values()
733771

772+
@staticmethod
773+
def get_oc22_regions():
774+
# Internal use only
775+
return Regions.OC22_REGIONS.values()
776+
777+
@staticmethod
778+
def get_oc24_regions():
779+
# Internal use only
780+
return Regions.OC24_REGIONS.values()
781+
734782
@staticmethod
735783
def from_region_id(region_id):
736784
"""
@@ -771,6 +819,10 @@ def from_region_id(region_id):
771819
region = Regions.OC19_REGIONS.get(region_id)
772820
if region is None:
773821
region = Regions.OC20_REGIONS.get(region_id)
822+
if region is None:
823+
region = Regions.OC22_REGIONS.get(region_id)
824+
if region is None:
825+
region = Regions.OC24_REGIONS.get(region_id)
774826
return region
775827

776828

0 commit comments

Comments
 (0)