Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "wherobots-python-dbapi"

[tool.poetry]
name = "wherobots-python-dbapi"
version = "0.13.0"
version = "0.14.0"
description = "Python DB-API driver for Wherobots DB"
authors = ["Maxime Petazzoni <max@wherobots.com>"]
license = "Apache 2.0"
Expand Down
7 changes: 7 additions & 0 deletions wherobots/db/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
class Region(Enum):
AWS_US_WEST_2 = "aws-us-west-2"
AWS_EU_WEST_1 = "aws-eu-west-1"


_NAME_TO_ENUM = {region.value: region for region in Region}


def from_name(region: str) -> Region:
return _NAME_TO_ENUM[region]
24 changes: 6 additions & 18 deletions wherobots/db/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,9 @@ class Runtime(Enum):
SMALL_A10_GPU = "small-a10-gpu"
MEDIUM_A10_GPU = "medium-a10-gpu"

# Deprecated names; will be removed in a later major version.
SEDONA = "tiny"
SAN_FRANCISCO = "small"
NEW_YORK = "medium"
CAIRO = "large"
DELHI = "x-large"
TOKYO = "2x-large"
ATLANTIS = "4x-large"

NEW_YORK_HIMEM = "medium-himem"
CAIRO_HIMEM = "large-himem"
DELHI_HIMEM = "x-large-himem"
TOKYO_HIMEM = "2x-large-himem"
ATLANTIS_HIMEM = "4x-large-himem"

SEDONA_GPU = "tiny-a10-gpu"
SAN_FRANCISCO_GPU = "small-a10-gpu"
NEW_YORK_GPU = "medium-a10-gpu"

_NAME_TO_ENUM = {runtime.value: runtime for runtime in Runtime}


def from_name(runtime: str) -> Runtime:
return _NAME_TO_ENUM[runtime]