diff --git a/common/options.py b/common/options.py index 4e03ce5..a95bb0d 100644 --- a/common/options.py +++ b/common/options.py @@ -19,20 +19,33 @@ from common import chronicle_auth verbose_option = click.option( - "--verbose", is_flag=True, help="Prints verbose output to the console.") + "--verbose", is_flag=True, help="Prints verbose output to the console." +) credential_file_option = click.option( "-c", "--credential_file", - help=f"Path of Service Account JSON. Default: {chronicle_auth.default_cred_file_path}" + help=( + "Path of Service Account JSON. Default:" + f" {chronicle_auth.default_cred_file_path}" + ), ) region_option = click.option( "--region", - type=click.Choice(["US", "ASIA-SOUTHEAST1", "EUROPE"], - case_sensitive=False), + type=click.Choice( + [ + "US", + "ASIA-SOUTHEAST1", + "EUROPE", + "EUROPE-WEST2", + "AUSTRALIA-SOUTHEAST1", + ], + case_sensitive=False, + ), default="US", - help="Select region") + help="Select region", +) url_option = click.option("--url", help="Base URL to be used for API calls") @@ -41,7 +54,9 @@ type=click.Choice(["prod", "test"], case_sensitive=False), default="prod", help="""Optionally specify - the environment for API calls""") + the environment for API calls""", +) export_option = click.option( - "--export", help="Export output to specified file path") + "--export", help="Export output to specified file path" +) diff --git a/common/uri.py b/common/uri.py index 81ea70d..b52d7c4 100644 --- a/common/uri.py +++ b/common/uri.py @@ -16,9 +16,13 @@ REGION_EUROPE = "europe" REGION_ASIA_SOUTHEAST1 = "asia-southeast1" +REGION_EUROPE_WEST2 = "europe-west2" +REGION_AUSTRALIA_SOUTHEAST1 = "australia-southeast1" BASE_URL = "https://backstory.googleapis.com" BASE_URL_EUROPE = "https://europe-backstory.googleapis.com" BASE_URL_ASIA_SOUTHEAST1 = "https://asia-southeast1-backstory.googleapis.com" +BASE_URL_EUROPE_WEST2 = "https://europe-west2-backstory.googleapis.com" +BASE_URL_AUSTRALIA_SOUTHEAST1 = "https://australia-southeast1-backstory.googleapis.com" CHRONICLE_TEST_API_URL = "https://test-backstory.sandbox.googleapis.com" @@ -40,6 +44,10 @@ def get_base_url(region: str, custom_url: str, env: str = "prod") -> str: return BASE_URL_EUROPE if region == REGION_ASIA_SOUTHEAST1: return BASE_URL_ASIA_SOUTHEAST1 + if region == REGION_EUROPE_WEST2: + return BASE_URL_EUROPE_WEST2 + if region == REGION_AUSTRALIA_SOUTHEAST1: + return BASE_URL_AUSTRALIA_SOUTHEAST1 if env == "test": return CHRONICLE_TEST_API_URL return BASE_URL