Skip to content

Commit c1bfd4c

Browse files
Added GCP NA region support (#69)
* Removed empty package * Updated changelog file * Added GCP NA support (#68) * Added GCP NA support * Upgraded dependency packages * Updated License file (#72) --------- Co-authored-by: Abhinav Gupta <[email protected]> Co-authored-by: abhinav <[email protected]>
1 parent 44e8fcc commit c1bfd4c

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELOG
22

3+
## _v1.9.0_
4+
5+
### **Date: 14-MAY-2024**
6+
7+
- Added GCP NA Support
8+
9+
---
310
## _v1.8.2_
411

512
### **Date: 05-DECEMBER-2023**

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2012 - 2023 Contentstack. All rights reserved.
3+
Copyright (c) 2012 - 2024 Contentstack. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

contentstack/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
__title__ = 'contentstack-delivery-python'
2323
__author__ = 'contentstack'
2424
__status__ = 'debug'
25-
__version__ = 'v1.8.2'
25+
__version__ = 'v1.9.0'
2626
__endpoint__ = 'cdn.contentstack.io'
2727
__email__ = '[email protected]'
2828
__developer_email__ = '[email protected]'

contentstack/stack.py

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ContentstackRegion(enum.Enum):
2121
EU = 'eu'
2222
AZURE_NA = 'azure-na'
2323
AZURE_EU = 'azure-eu'
24+
GCP_NA = 'gcp-na'
2425

2526

2627
class Stack:
@@ -116,6 +117,8 @@ def _validate_stack(self):
116117
self.host = 'azure-na-cdn.contentstack.com'
117118
elif self.region.value == 'azure-eu' and self.host == DEFAULT_HOST:
118119
self.host = 'azure-eu-cdn.contentstack.com'
120+
elif self.region.value == 'gcp-na' and self.host == DEFAULT_HOST:
121+
self.host = 'gcp-na-cdn.contentstack.com'
119122
elif self.region.value != 'us':
120123
self.host = f'{self.region.value}-{DEFAULT_HOST}'
121124
self.endpoint = f'https://{self.host}/{self.version}'

requirements.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
twython==3.9.1
22
setuptools==67.8.0
3-
contentstack-utils==1.2.0
3+
contentstack-utils==1.3.0
44
python-dateutil==2.8.2
55
requests==2.31.0
66
coverage==7.2.6
@@ -33,26 +33,26 @@ pytz==2023.3
3333
Babel==2.12.1
3434
pep517==0.13.0
3535
tomli~=2.0.1
36-
Werkzeug==3.0.1
36+
Werkzeug==3.0.3
3737
Flask~=2.3.2
3838
click~=8.1.3
3939
MarkupSafe==2.1.2
4040
blinker~=1.6.2
4141
itsdangerous~=2.1.2
4242
isort==5.12.0
4343
pkginfo==1.9.6
44-
pylint==2.17.4
45-
astroid==2.15.5
44+
pylint==3.1.0
45+
astroid==3.1.0
4646
mccabe==0.7.0
4747
platformdirs==3.5.1
4848
imagesize==1.4.1
4949
snowballstemmer~=2.2.0
5050
Pygments~=2.15.1
5151
wrapt==1.15.0
52-
certifi==2023.7.22
52+
certifi==2024.2.2
5353
oauthlib==3.2.2
54-
idna==3.4
55-
chardet~=5.1.0
54+
idna==3.7
55+
chardet~=5.2.0
5656
alabaster==0.7.13
5757
zipp==3.15.0
5858
distlib~=0.3.6

tests/test_stack.py

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def test_02_stack_region(self):
2828
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.EU)
2929
self.assertEqual('eu-cdn.contentstack.com', stack_region.host)
3030

31+
def test_02_stack_gcp_na_region(self):
32+
stack_region = contentstack.Stack(
33+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.GCP_NA)
34+
self.assertEqual('gcp-na-cdn.contentstack.com', stack_region.host)
35+
3136
def test_03_stack_endpoint(self):
3237
self.assertEqual(f"https://{config.HOST}/v3",
3338
self.stack.endpoint)

0 commit comments

Comments
 (0)