1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

datadog_event : Adding api_host as an optional parameter (#2775)

* 2774 Module datadog_event _ Adding api_host as an optional parameter

* Update changelogs/fragments/2774-datadog_event_api_parameter.yml

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

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

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

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

* Update datadog_event.py

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

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

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

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

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

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

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

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

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

Co-authored-by: Amin Vakil <info@aminvakil.com>

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

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Anas Hamadeh <anas.hamadeh@klarna.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
This commit is contained in:
Anas 2021-06-17 19:05:35 +02:00 committed by GitHub
parent e9f3455b62
commit c9cf641188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- "datadog_event - adding parameter ``api_host`` to allow selecting a datadog API endpoint instead of using the default one (https://github.com/ansible-collections/community.general/issues/2774, https://github.com/ansible-collections/community.general/pull/2775)."

View file

@ -54,6 +54,11 @@ options:
description:
- Host name to associate with the event.
- If not specified, it defaults to the remote system's hostname.
api_host:
type: str
description:
- DataDog API endpoint URL.
version_added: '3.3.0'
tags:
type: list
elements: str
@ -90,6 +95,19 @@ EXAMPLES = '''
api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
tags: 'aa,bb,#host:{{ inventory_hostname }}'
- name: Post an event with several tags to another endpoint
community.general.datadog_event:
title: Testing from ansible
text: Test
api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
api_host: 'https://example.datadoghq.eu'
tags:
- aa
- b
- '#host:{{ inventory_hostname }}'
'''
import platform
@ -113,6 +131,7 @@ def main():
argument_spec=dict(
api_key=dict(required=True, no_log=True),
app_key=dict(required=True, no_log=True),
api_host=dict(type='str'),
title=dict(required=True),
text=dict(required=True),
date_happened=dict(type='int'),
@ -131,8 +150,10 @@ def main():
options = {
'api_key': module.params['api_key'],
'app_key': module.params['app_key']
'app_key': module.params['app_key'],
}
if module.params['api_host'] is not None:
options['api_host'] = module.params['api_host']
initialize(**options)