@@ -256,6 +256,7 @@ class Region(object):
256
256
OC26_EP_BASE = 'https://nosql.{0}.oci.oraclecloud26.com'
257
257
OC27_EP_BASE = 'https://nosql.{0}.oci.oraclecloud27.com'
258
258
OC28_EP_BASE = 'https://nosql.{0}.oci.oraclecloud28.com'
259
+ OC31_EP_BASE = 'https://nosql.{0}.oci.sovereigncloud.nz'
259
260
260
261
def __init__ (self , region_id ):
261
262
self ._region_id = region_id
@@ -312,6 +313,8 @@ def endpoint(self):
312
313
return str .format (Region .OC27_EP_BASE , self ._region_id )
313
314
if self ._is_oc28_region ():
314
315
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 )
315
318
raise IllegalArgumentException (
316
319
'Unable to find endpoint for unknown region ' + self ._region_id )
317
320
@@ -410,6 +413,10 @@ def _is_oc28_region(self):
410
413
# Internal use only
411
414
return Regions .OC28_REGIONS .get (self ._region_id ) is not None
412
415
416
+ def _is_oc31_region (self ):
417
+ # Internal use only
418
+ return Regions .OC31_REGIONS .get (self ._region_id ) is not None
419
+
413
420
414
421
class Regions (object ):
415
422
"""
@@ -641,6 +648,10 @@ class Regions(object):
641
648
US_DCC_SWJORDAN_2 = Region ('us-dcc-swjordan-2' )
642
649
"""Region Location: Utah, USA"""
643
650
651
+ # OC31
652
+ AP_HOBSONVILLE_1 = Region ('ap-hobsonville-1' )
653
+ """Region Location: New Zealand"""
654
+
644
655
# OC1
645
656
OC1_REGIONS = dict ()
646
657
"""A dict containing the OC1 regions."""
@@ -803,6 +814,11 @@ class Regions(object):
803
814
"""A dict containing the OC28 regions."""
804
815
OC28_REGIONS [US_DCC_SWJORDAN_2 .get_region_id ()] = US_DCC_SWJORDAN_2
805
816
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
+
806
822
@staticmethod
807
823
def get_oc1_regions ():
808
824
# Internal use only
@@ -908,6 +924,11 @@ def get_oc28_regions():
908
924
# Internal use only
909
925
return Regions .OC28_REGIONS .values ()
910
926
927
+ @staticmethod
928
+ def get_oc31_regions ():
929
+ # Internal use only
930
+ return Regions .OC31_REGIONS .values ()
931
+
911
932
@staticmethod
912
933
def from_region_id (region_id ):
913
934
"""
@@ -964,6 +985,8 @@ def from_region_id(region_id):
964
985
region = Regions .OC27_REGIONS .get (region_id )
965
986
if region is None :
966
987
region = Regions .OC28_REGIONS .get (region_id )
988
+ if region is None :
989
+ region = Regions .OC31_REGIONS .get (region_id )
967
990
return region
968
991
969
992
0 commit comments