Skip to content

Commit

Permalink
Add AP1 Datacenter (#779)
Browse files Browse the repository at this point in the history
* Add AP1 to api_host checks

* format arrays
  • Loading branch information
nkzou authored Jul 7, 2023
1 parent 7966f3e commit 099a094
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
15 changes: 13 additions & 2 deletions datadog/dogshell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,20 @@ def main():
parser.add_argument(
"--api_host",
help="Datadog site to send data, us (datadoghq.com), eu (datadoghq.eu), us3 (us3.datadoghq.com), \
or us5 (us5.datadoghq.com), default: us",
us5 (us5.datadoghq.com), or ap1 (ap1.datadoghq.com). default: us",
dest="api_host",
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
choices=[
"datadoghq.com",
"us",
"datadoghq.eu",
"eu",
"us3.datadoghq.com",
"us3",
"us5.datadoghq.com",
"us5",
"ap1.datadoghq.com",
"ap1"
],
)

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 @@ -55,6 +55,8 @@ def load(self, config_file, api_key, app_key, api_host):
self["api_host"] = "https://us3.datadoghq.com"
elif api_host in ("us5.datadoghq.com", "us5"):
self["api_host"] = "https://us5.datadoghq.com"
elif api_host in ("ap1.datadoghq.com", "ap1"):
self["api_host"] = "https://ap1.datadoghq.com"

if api_key is not None and app_key is not None:
self["api_key"] = api_key
Expand Down
17 changes: 15 additions & 2 deletions datadog/dogshell/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,20 @@ def parse_options(raw_args=None):
action="store",
type="choice",
default="datadoghq.com",
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
choices=[
"datadoghq.com",
"us",
"datadoghq.eu",
"eu",
"us3.datadoghq.com",
"us3",
"us5.datadoghq.com",
"us5",
"ap1.datadoghq.com",
"ap1"
],
help="The site to send data. Accepts us (datadoghq.com), eu (datadoghq.eu), \
us3 (us3.datadoghq.com), or us5 (us5.datadoghq.com), default: us",
us3 (us3.datadoghq.com), us5 (us5.datadoghq.com), or ap1 (ap1.datadoghq.com). default: us",
)
parser.add_option(
"-m",
Expand Down Expand Up @@ -425,6 +436,8 @@ def main():
api_host = "https://api.us3.datadoghq.com"
elif options.site in ("us5.datadoghq.com", "us5"):
api_host = "https://api.us5.datadoghq.com"
elif options.site in ("ap1.datadoghq.com", "ap1"):
api_host = "https://api.ap1.datadoghq.com"
else:
api_host = "https://api.datadoghq.com"

Expand Down

0 comments on commit 099a094

Please sign in to comment.