Skip to content

Commit 099a094

Browse files
authored
Add AP1 Datacenter (#779)
* Add AP1 to api_host checks * format arrays
1 parent 7966f3e commit 099a094

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

datadog/dogshell/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,20 @@ def main():
7474
parser.add_argument(
7575
"--api_host",
7676
help="Datadog site to send data, us (datadoghq.com), eu (datadoghq.eu), us3 (us3.datadoghq.com), \
77-
or us5 (us5.datadoghq.com), default: us",
77+
us5 (us5.datadoghq.com), or ap1 (ap1.datadoghq.com). default: us",
7878
dest="api_host",
79-
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
79+
choices=[
80+
"datadoghq.com",
81+
"us",
82+
"datadoghq.eu",
83+
"eu",
84+
"us3.datadoghq.com",
85+
"us3",
86+
"us5.datadoghq.com",
87+
"us5",
88+
"ap1.datadoghq.com",
89+
"ap1"
90+
],
8091
)
8192

8293
config = DogshellConfig()

datadog/dogshell/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def load(self, config_file, api_key, app_key, api_host):
5555
self["api_host"] = "https://us3.datadoghq.com"
5656
elif api_host in ("us5.datadoghq.com", "us5"):
5757
self["api_host"] = "https://us5.datadoghq.com"
58+
elif api_host in ("ap1.datadoghq.com", "ap1"):
59+
self["api_host"] = "https://ap1.datadoghq.com"
5860

5961
if api_key is not None and app_key is not None:
6062
self["api_key"] = api_key

datadog/dogshell/wrap.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,20 @@ def parse_options(raw_args=None):
286286
action="store",
287287
type="choice",
288288
default="datadoghq.com",
289-
choices=["datadoghq.com", "us", "datadoghq.eu", "eu", "us3.datadoghq.com", "us3", "us5.datadoghq.com", "us5"],
289+
choices=[
290+
"datadoghq.com",
291+
"us",
292+
"datadoghq.eu",
293+
"eu",
294+
"us3.datadoghq.com",
295+
"us3",
296+
"us5.datadoghq.com",
297+
"us5",
298+
"ap1.datadoghq.com",
299+
"ap1"
300+
],
290301
help="The site to send data. Accepts us (datadoghq.com), eu (datadoghq.eu), \
291-
us3 (us3.datadoghq.com), or us5 (us5.datadoghq.com), default: us",
302+
us3 (us3.datadoghq.com), us5 (us5.datadoghq.com), or ap1 (ap1.datadoghq.com). default: us",
292303
)
293304
parser.add_option(
294305
"-m",
@@ -425,6 +436,8 @@ def main():
425436
api_host = "https://api.us3.datadoghq.com"
426437
elif options.site in ("us5.datadoghq.com", "us5"):
427438
api_host = "https://api.us5.datadoghq.com"
439+
elif options.site in ("ap1.datadoghq.com", "ap1"):
440+
api_host = "https://api.ap1.datadoghq.com"
428441
else:
429442
api_host = "https://api.datadoghq.com"
430443

0 commit comments

Comments
 (0)