Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dogwrap site option to send to US3 site #749

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
5 changes: 3 additions & 2 deletions datadog/dogshell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def main():

parser.add_argument(
"--api_host",
help="Datadog site to send data, us (datadoghq.com), eu (datadoghq.eu) or us3 (us3.datadoghq.com), default: us",
help="Datadog site to send data, us (datadoghq.com), eu (datadoghq.eu), us3 (us3.datadoghq.com), \
or us5 (us5.datadoghq.com), default: us",
dest="api_host",
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3"],
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
)

config = DogshellConfig()
Expand Down
2 changes: 2 additions & 0 deletions datadog/dogshell/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def load(self, config_file, api_key, app_key, api_host):
self["api_host"] = "https://datadoghq.eu"
elif api_host in ("us3.datadoghq.com", "us3"):
self["api_host"] = "https://us3.datadoghq.com"
elif api_host in ("us5.datadoghq.com", "us5"):
self["api_host"] = "https://us5.datadoghq.com"

if api_key is not None and app_key is not None:
self["api_key"] = api_key
Expand Down
10 changes: 7 additions & 3 deletions datadog/dogshell/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ def parse_options(raw_args=None):
action="store",
type="choice",
default="datadoghq.com",
choices=["datadoghq.com", "us", "datadoghq.eu", "eu"],
help="The site \
to send data, us (datadoghq.com) or eu (datadoghq.eu), default: us",
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
help="The site to send data. Accepts us (datadoghq.com), eu (datadoghq.eu), \
us3 (us3.datadoghq.com), or us5 (us5.datadoghq.com), default: us",
)
parser.add_option(
"-m",
Expand Down Expand Up @@ -421,6 +421,10 @@ def main():

if options.site in ("datadoghq.eu", "eu"):
api_host = "https://api.datadoghq.eu"
elif options.site in ("us3.datadoghq.com", "us3"):
api_host = "https://api.us3.datadoghq.com"
elif options.site in ("us5.datadoghq.com", "us5"):
api_host = "https://api.us5.datadoghq.com"
else:
api_host = "https://api.datadoghq.com"

Expand Down