Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cbn_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# URLs for Chronicle CBN API endpoints.
CHRONICLE_API_V1_URL = 'https://backstory.googleapis.com/v1'
CHRONICLE_API_EUROPE_V1_URL = 'https://europe-backstory.googleapis.com/v1'
CHRONICLE_API_UK_V1_URL = 'https://europe-west2-backstory.googleapis.com/v1'
CHRONICLE_API_ASIA_URL = 'https://asia-southeast1-backstory.googleapis.com/v1'

# HTTP Request related constants.
Expand All @@ -54,6 +55,8 @@ def get_connecting_url(args):
url = CHRONICLE_API_EUROPE_V1_URL
elif args.region == 'ASIA':
url = CHRONICLE_API_ASIA_URL
elif args.region == 'UK':
url = CHRONICLE_API_UK_V1_URL

return url

Expand Down Expand Up @@ -427,7 +430,7 @@ def arg_parser():
'--region',
type=str,
default='US',
choices=['US', 'EUROPE', 'ASIA'],
choices=['US', 'EUROPE', 'ASIA', 'UK'],
help="""Optionally specify
the region for API calls""")
parser.add_argument(
Expand Down
1 change: 1 addition & 0 deletions cbn_cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def tearDown(self):
('', cbn_cli.CHRONICLE_API_V1_URL),
('EUROPE', cbn_cli.CHRONICLE_API_EUROPE_V1_URL),
('ASIA', cbn_cli.CHRONICLE_API_ASIA_URL),
('UK', cbn_cli.CHRONICLE_API_UK_V1_URL),
])
def test_get_connecting_url(self, region, expected_url):
args = cbn_cli.arg_parser().parse_args()
Expand Down