datadog_monitor: Fix docs with datatypes of params (#58371)

* datadog_monitor: Fix docs with datatypes of params

Fixes: #58342

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* indentation and other minor fixes
pull/58406/head
Abhijeet Kasurde 5 years ago committed by Alicia Cozine
parent db0fe4b188
commit bc3c90f2f1

@ -18,91 +18,126 @@ DOCUMENTATION = '''
module: datadog_monitor module: datadog_monitor
short_description: Manages Datadog monitors short_description: Manages Datadog monitors
description: description:
- "Manages monitors within Datadog" - Manages monitors within Datadog.
- "Options like described on http://docs.datadoghq.com/api/" - Options as described on https://docs.datadoghq.com/api/.
version_added: "2.0" version_added: "2.0"
author: "Sebastian Kornehl (@skornehl)" author: Sebastian Kornehl (@skornehl)
requirements: [datadog] requirements: [datadog]
options: options:
api_key: api_key:
description: ["Your DataDog API key."] description:
- Your Datadog API key.
required: true required: true
type: str
app_key: app_key:
description: ["Your DataDog app key."] description:
- Your Datadog app key.
required: true required: true
type: str
state: state:
description: ["The designated state of the monitor."] description:
- The designated state of the monitor.
required: true required: true
choices: ['present', 'absent', 'mute', 'unmute'] choices: ['present', 'absent', 'mute', 'unmute']
type: str
tags: tags:
description: ["A list of tags to associate with your monitor when creating or updating. This can help you categorize and filter monitors."] description:
- A list of tags to associate with your monitor when creating or updating.
- This can help you categorize and filter monitors.
version_added: "2.2" version_added: "2.2"
type: list
type: type:
description: description:
- "The type of the monitor." - The type of the monitor.
- The 'event alert'is available starting at Ansible 2.1
choices: ['metric alert', 'service check', 'event alert'] choices: ['metric alert', 'service check', 'event alert']
type: str
query: query:
description: ["The monitor query to notify on with syntax varying depending on what type of monitor you are creating."] description:
- The monitor query to notify on.
- Syntax varies depending on what type of monitor you are creating.
type: str
name: name:
description: ["The name of the alert."] description:
- The name of the alert.
required: true required: true
type: str
message: message:
description: description:
- A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same - A message to include with notifications for this monitor.
'@username' notation as events. Monitor message template variables can be accessed by using double square brackets, i.e '[[' and ']]'. - Email notifications can be sent to specific users by using the same '@username' notation as events.
- Monitor message template variables can be accessed by using double square brackets, i.e '[[' and ']]'.
type: str
silenced: silenced:
description: ["Dictionary of scopes to timestamps or None. Each scope will be muted until the given POSIX timestamp or forever if the value is None. "] description:
- Dictionary of scopes to silence, with timestamps or None.
- Each scope will be muted until the given POSIX timestamp or forever if the value is None.
default: "" default: ""
notify_no_data: notify_no_data:
description: ["A boolean indicating whether this monitor will notify when data stops reporting.."] description:
- Whether this monitor will notify when data stops reporting.
type: bool type: bool
default: 'no' default: 'no'
no_data_timeframe: no_data_timeframe:
description: description:
- The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric - The number of minutes before a monitor will notify when data stops reporting.
alerts or 2 minutes for service checks. - Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks.
default: 2x timeframe for metric, 2 minutes for service default: 2x timeframe for metric, 2 minutes for service
type: str
timeout_h: timeout_h:
description: ["The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state."] description:
- The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state.
type: str
renotify_interval: renotify_interval:
description: description:
- The number of minutes after the last notification before a monitor will re-notify on the current status. It will only re-notify if it's - The number of minutes after the last notification before a monitor will re-notify on the current status.
not resolved. - It will only re-notify if it is not resolved.
type: str
escalation_message: escalation_message:
description: description:
- A message to include with a re-notification. Supports the '@username' notification we allow elsewhere. Not applicable if renotify_interval - A message to include with a re-notification. Supports the '@username' notification we allow elsewhere.
is None - Not applicable if I(renotify_interval=None).
type: str
notify_audit: notify_audit:
description: ["A boolean indicating whether tagged users will be notified on changes to this monitor."] description:
- Whether tagged users will be notified on changes to this monitor.
type: bool type: bool
default: 'no' default: 'no'
thresholds: thresholds:
description: description:
- A dictionary of thresholds by status. This option is only available for service checks and metric alerts. Because each of them can have - A dictionary of thresholds by status.
multiple thresholds, we don't define them directly in the query."] - Only available for service checks and metric alerts.
- Because each of them can have multiple thresholds, we do not define them directly in the query.
default: {'ok': 1, 'critical': 1, 'warning': 1} default: {'ok': 1, 'critical': 1, 'warning': 1}
locked: locked:
description: ["A boolean indicating whether changes to this monitor should be restricted to the creator or admins."] description:
- Whether changes to this monitor should be restricted to the creator or admins.
type: bool type: bool
default: 'no' default: 'no'
version_added: "2.2" version_added: "2.2"
require_full_window: require_full_window:
description: description:
- A boolean indicating whether this monitor needs a full window of data before it's evaluated. We highly recommend you set this to False for - Whether this monitor needs a full window of data before it gets evaluated.
sparse metrics, otherwise some evaluations will be skipped. - We highly recommend you set this to False for sparse metrics, otherwise some evaluations will be skipped.
version_added: "2.3" version_added: "2.3"
type: bool type: bool
new_host_delay: new_host_delay:
description: ["A positive integer representing the number of seconds to wait before evaluating the monitor for new hosts. description:
This gives the host time to fully initialize."] - A positive integer representing the number of seconds to wait before evaluating the monitor for new hosts.
- This gives the host time to fully initialize.
version_added: "2.4" version_added: "2.4"
type: str
evaluation_delay: evaluation_delay:
description: ["Time to delay evaluation (in seconds). It is effective for sparse values."] description:
- Time to delay evaluation (in seconds).
- Effective for sparse values.
version_added: "2.7" version_added: "2.7"
type: str
id: id:
description: ["The id of the alert. If set, will be used instead of the name to locate the alert."] description:
- The ID of the alert.
- If set, will be used instead of the name to locate the alert.
version_added: "2.3" version_added: "2.3"
type: str
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -158,8 +193,8 @@ def main():
argument_spec=dict( argument_spec=dict(
api_key=dict(required=True, no_log=True), api_key=dict(required=True, no_log=True),
app_key=dict(required=True, no_log=True), app_key=dict(required=True, no_log=True),
state=dict(required=True, choises=['present', 'absent', 'mute', 'unmute']), state=dict(required=True, choices=['present', 'absent', 'mute', 'unmute']),
type=dict(required=False, choises=['metric alert', 'service check', 'event alert']), type=dict(required=False, choices=['metric alert', 'service check', 'event alert']),
name=dict(required=True), name=dict(required=True),
query=dict(required=False), query=dict(required=False),
message=dict(required=False, default=None), message=dict(required=False, default=None),

@ -1521,9 +1521,7 @@ lib/ansible/modules/monitoring/datadog_event.py E327
lib/ansible/modules/monitoring/datadog_event.py E337 lib/ansible/modules/monitoring/datadog_event.py E337
lib/ansible/modules/monitoring/datadog_event.py E338 lib/ansible/modules/monitoring/datadog_event.py E338
lib/ansible/modules/monitoring/datadog_monitor.py E324 lib/ansible/modules/monitoring/datadog_monitor.py E324
lib/ansible/modules/monitoring/datadog_monitor.py E326
lib/ansible/modules/monitoring/datadog_monitor.py E337 lib/ansible/modules/monitoring/datadog_monitor.py E337
lib/ansible/modules/monitoring/datadog_monitor.py E338
lib/ansible/modules/monitoring/grafana_dashboard.py E337 lib/ansible/modules/monitoring/grafana_dashboard.py E337
lib/ansible/modules/monitoring/grafana_dashboard.py E338 lib/ansible/modules/monitoring/grafana_dashboard.py E338
lib/ansible/modules/monitoring/grafana_datasource.py E324 lib/ansible/modules/monitoring/grafana_datasource.py E324

Loading…
Cancel
Save