datadog: Add missing priority (#4311) (#4354)

* datadog: Add missing priority

* datadog: Add missing priority

* datadog: Add missing priority

* datadog: Add documentation and variable declaration

* datadog: Add documentation and variable declaration

* datadog: Add documentation and variable declaration

* Update plugins/modules/monitoring/datadog/datadog_monitor.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Fredrik Lysén <fredrik.lysen@klarna.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c40684db58)

Co-authored-by: Fredrik Lysén <flysen@users.noreply.github.com>
pull/4356/head
patchback[bot] 2022-03-14 07:29:18 +01:00 committed by GitHub
parent 7ddb2eb438
commit 7fb44b0643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,11 @@ options:
type: bool type: bool
default: yes default: yes
version_added: 1.3.0 version_added: 1.3.0
priority:
description:
- Integer from 1 (high) to 5 (low) indicating alert severity.
type: int
version_added: 4.6.0
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -239,6 +244,7 @@ def main():
evaluation_delay=dict(), evaluation_delay=dict(),
id=dict(), id=dict(),
include_tags=dict(required=False, default=True, type='bool'), include_tags=dict(required=False, default=True, type='bool'),
priority=dict(type='int'),
) )
) )
@ -298,6 +304,7 @@ def _post_monitor(module, options):
name=_fix_template_vars(module.params['name']), name=_fix_template_vars(module.params['name']),
message=_fix_template_vars(module.params['notification_message']), message=_fix_template_vars(module.params['notification_message']),
escalation_message=_fix_template_vars(module.params['escalation_message']), escalation_message=_fix_template_vars(module.params['escalation_message']),
priority=module.params['priority'],
options=options) options=options)
if module.params['tags'] is not None: if module.params['tags'] is not None:
kwargs['tags'] = module.params['tags'] kwargs['tags'] = module.params['tags']
@ -322,6 +329,7 @@ def _update_monitor(module, monitor, options):
name=_fix_template_vars(module.params['name']), name=_fix_template_vars(module.params['name']),
message=_fix_template_vars(module.params['notification_message']), message=_fix_template_vars(module.params['notification_message']),
escalation_message=_fix_template_vars(module.params['escalation_message']), escalation_message=_fix_template_vars(module.params['escalation_message']),
priority=module.params['priority'],
options=options) options=options)
if module.params['tags'] is not None: if module.params['tags'] is not None:
kwargs['tags'] = module.params['tags'] kwargs['tags'] = module.params['tags']