Skip to content

Commit

Permalink
Add region-specific host constants.
Browse files Browse the repository at this point in the history
Some users need to log in to specific regions only.  This PR exposes
host constants that make this easier, like so:

    import tiledb.cloud
    from tiledb.cloud.region import AWS
    tiledb.cloud.login(host=AWS.US_EAST_1)

As of today, we support five AWS regions.
  • Loading branch information
NullHypothesis committed Jun 14, 2024
1 parent 41adb97 commit 53ce099
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tiledb/cloud/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def login(
:param token: api token for login
:param username: username for login
:param password: password for login
:param host: host to login to
:param host: host to login to. the tiledb.cloud.regions module contains
region-specific host constants.
:param verify_ssl: Enable strict SSL verification
:param no_session: don't create a session token on login,
store instead username/password
Expand Down
19 changes: 19 additions & 0 deletions src/tiledb/cloud/region/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class AWS:
"""
The AWS cloud regions that are currently supported.
US_EAST_1 = North America, United States (Virginia)
US_WEST_1 = North America, United States (California)
EU_WEST_1 = Europe, Ireland
EU_WEST_2 = Europe, London
AP_SOUTHEAST_1 = Asia, Singapore
"""

US_EAST_1 = "https://us-east-1.aws.api.tiledb.com"
US_WEST_1 = "https://us-west-1.aws.api.tiledb.com"
EU_WEST_1 = "https://eu-west-1.aws.api.tiledb.com"
EU_WEST_2 = "https://eu-west-2.aws.api.tiledb.com"
AP_SOUTHEAST_1 = "https://ap-southeast-1.aws.api.tiledb.com"


__all__ = ("AWS",)

0 comments on commit 53ce099

Please sign in to comment.