Skip to content

Commit c7a4484

Browse files
mksyed-googlecopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 526802402
1 parent 3ca804d commit c7a4484

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

common/options.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,33 @@
1919
from common import chronicle_auth
2020

2121
verbose_option = click.option(
22-
"--verbose", is_flag=True, help="Prints verbose output to the console.")
22+
"--verbose", is_flag=True, help="Prints verbose output to the console."
23+
)
2324

2425
credential_file_option = click.option(
2526
"-c",
2627
"--credential_file",
27-
help=f"Path of Service Account JSON. Default: {chronicle_auth.default_cred_file_path}"
28+
help=(
29+
"Path of Service Account JSON. Default:"
30+
f" {chronicle_auth.default_cred_file_path}"
31+
),
2832
)
2933

3034
region_option = click.option(
3135
"--region",
32-
type=click.Choice(["US", "ASIA-SOUTHEAST1", "EUROPE"],
33-
case_sensitive=False),
36+
type=click.Choice(
37+
[
38+
"US",
39+
"ASIA-SOUTHEAST1",
40+
"EUROPE",
41+
"EUROPE-WEST2",
42+
"AUSTRALIA-SOUTHEAST1",
43+
],
44+
case_sensitive=False,
45+
),
3446
default="US",
35-
help="Select region")
47+
help="Select region",
48+
)
3649

3750
url_option = click.option("--url", help="Base URL to be used for API calls")
3851

@@ -41,7 +54,9 @@
4154
type=click.Choice(["prod", "test"], case_sensitive=False),
4255
default="prod",
4356
help="""Optionally specify
44-
the environment for API calls""")
57+
the environment for API calls""",
58+
)
4559

4660
export_option = click.option(
47-
"--export", help="Export output to specified file path")
61+
"--export", help="Export output to specified file path"
62+
)

common/uri.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616

1717
REGION_EUROPE = "europe"
1818
REGION_ASIA_SOUTHEAST1 = "asia-southeast1"
19+
REGION_EUROPE_WEST2 = "europe-west2"
20+
REGION_AUSTRALIA_SOUTHEAST1 = "australia-southeast1"
1921
BASE_URL = "https://backstory.googleapis.com"
2022
BASE_URL_EUROPE = "https://europe-backstory.googleapis.com"
2123
BASE_URL_ASIA_SOUTHEAST1 = "https://asia-southeast1-backstory.googleapis.com"
24+
BASE_URL_EUROPE_WEST2 = "https://europe-west2-backstory.googleapis.com"
25+
BASE_URL_AUSTRALIA_SOUTHEAST1 = "https://australia-southeast1-backstory.googleapis.com"
2226
CHRONICLE_TEST_API_URL = "https://test-backstory.sandbox.googleapis.com"
2327

2428

@@ -40,6 +44,10 @@ def get_base_url(region: str, custom_url: str, env: str = "prod") -> str:
4044
return BASE_URL_EUROPE
4145
if region == REGION_ASIA_SOUTHEAST1:
4246
return BASE_URL_ASIA_SOUTHEAST1
47+
if region == REGION_EUROPE_WEST2:
48+
return BASE_URL_EUROPE_WEST2
49+
if region == REGION_AUSTRALIA_SOUTHEAST1:
50+
return BASE_URL_AUSTRALIA_SOUTHEAST1
4351
if env == "test":
4452
return CHRONICLE_TEST_API_URL
4553
return BASE_URL

0 commit comments

Comments
 (0)