aboutsummaryrefslogtreecommitdiff
path: root/lib/exdatadog/search.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exdatadog/search.ex')
-rw-r--r--lib/exdatadog/search.ex23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/exdatadog/search.ex b/lib/exdatadog/search.ex
new file mode 100644
index 0000000..23e6fd6
--- /dev/null
+++ b/lib/exdatadog/search.ex
@@ -0,0 +1,23 @@
+defmodule Exdatadog.Search do
+ @moduledoc """
+ Search for metrics or hosts in DataDog
+ """
+
+ import Exdatadog
+
+ @doc """
+ Search for entities in the last 24 hours in DataDog
+
+ Available entities to search for are:
+
+ * `hosts`
+
+ * `metrics`
+
+ """
+ @spec search(binary, Exdatadog.Client.t) :: Exdatadog.response
+ def search(query, client) do
+ get("api/v1/search", client, [q: query])
+ end
+
+end