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 monitor and monitor groups search API endpoints #299

Merged
merged 2 commits into from
Oct 16, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CHANGELOG
=========
# 0.23.0 / Unreleased

Add [monitor search](https://docs.datadoghq.com/api/?lang=python#monitors-search) and [monitor groups search](https://docs.datadoghq.com/api/?lang=python#monitors-group-search) API endpoints.

# 0.22.0 / 2018-06-27

Expand Down
18 changes: 18 additions & 0 deletions datadog/api/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,21 @@ def unmute_all(cls):
:returns: Dictionary representing the API's JSON response
"""
return super(Monitor, cls)._trigger_class_action('POST', 'unmute_all')

@classmethod
def search(cls, **params):
"""
Search monitors.

:returns: Dictionary representing the API's JSON response
"""
return super(Monitor, cls)._trigger_class_action('GET', 'search', params=params)

@classmethod
def search_groups(cls, **params):
"""
Search monitor groups.

:returns: Dictionary representing the API's JSON response
"""
return super(Monitor, cls)._trigger_class_action('GET', 'groups/search', params=params)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_readme_md_contents():

setup(
name="datadog",
version="0.22.0",
version="0.23.0",
install_requires=install_reqs,
tests_require=["nose", "mock"],
packages=[
Expand Down