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

169 lines
5.5 KiB
Python
Raw Normal View History

2020-03-09 10:11:07 +01:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) Seth Edwards, 2014
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
2020-03-09 10:11:07 +01:00
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: librato_annotation
short_description: create an annotation in librato
description:
- Create an annotation event on the given annotation stream :name. If the annotation stream does not exist, it will be created automatically
author: "Seth Edwards (@Sedward)"
requirements: []
options:
user:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- Librato account username
required: true
api_key:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- Librato account api key
required: true
name:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- The annotation stream name
- If the annotation stream does not exist, it will be created automatically
required: false
title:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- The title of an annotation is a string and may contain spaces
- The title should be a short, high-level summary of the annotation e.g. v45 Deployment
required: true
source:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- A string which describes the originating source of an annotation when that annotation is tracked across multiple members of a population
required: false
description:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- The description contains extra metadata about a particular annotation
- The description should contain specifics on the individual annotation e.g. Deployed 9b562b2 shipped new feature foo!
required: false
start_time:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: int
2020-03-09 10:11:07 +01:00
description:
- The unix timestamp indicating the time at which the event referenced by this annotation started
required: false
end_time:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: int
2020-03-09 10:11:07 +01:00
description:
- The unix timestamp indicating the time at which the event referenced by this annotation ended
- For events that have a duration, this is a useful way to annotate the duration of the event
required: false
links:
Tidy up validate-modules ignores for monitoring modules (#1350) * fixed validation-modules for plugins/modules/monitoring/bigpanda.py * fixed validation-modules for plugins/modules/monitoring/circonus_annotation.py * fixed validation-modules for plugins/modules/monitoring/honeybadger_deployment.py * fixed validation-modules for plugins/modules/monitoring/icinga2_feature.py * fixed validation-modules for plugins/modules/monitoring/icinga2_host.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/monitoring/logentries.py * fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py * fixed validation-modules for plugins/modules/monitoring/newrelic_deployment.py * fixed validation-modules for plugins/modules/monitoring/pagerduty_alert.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/pingdom.py * fixed validation-modules for plugins/modules/monitoring/rollbar_deployment.py * fixed validation-modules for plugins/modules/monitoring/spectrum_device.py * fixed validation-modules for plugins/modules/monitoring/stackdriver.py * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * fixed validation-modules for plugins/modules/monitoring/uptimerobot.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_event.py * fixed validation-modules for plugins/modules/monitoring/datadog/datadog_monitor.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_check.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_client.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_handler.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_silence.py * fixed validation-modules for plugins/modules/monitoring/sensu/sensu_subscription.py * fixed trailing space * Enabling validation-modules for monitoring modules * Added line for 2.9 * Update plugins/modules/monitoring/icinga2_host.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> * Suggestion from PR * oops, missed the 2.11 ignore file * Update plugins/modules/monitoring/icinga2_host.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-23 22:07:03 +01:00
type: list
Tidy up validate-modules:parameter-list-no-elements (batch 1) (#1795) * fixed validation-modules for plugins/modules/storage/netapp/na_ontap_gather_facts.py * fixed validation-modules for plugins/modules/source_control/gitlab/gitlab_runner.py * fixed validation-modules for plugins/modules/packaging/os/redhat_subscription.py * fixed validation-modules for plugins/modules/notification/twilio.py * fixed validation-modules for plugins/modules/notification/slack.py * fixed validation-modules for plugins/modules/notification/sendgrid.py * fixed validation-modules for plugins/modules/notification/rocketchat.py * fixed validation-modules for plugins/modules/notification/office_365_connector_card.py * fixed validation-modules for plugins/modules/notification/nexmo.py * fixed validation-modules for plugins/modules/notification/mail.py * fixed validation-modules for plugins/modules/net_tools/omapi_host.py * fixed validation-modules for plugins/modules/net_tools/nsupdate.py * fixed validation-modules for plugins/modules/net_tools/dnsimple.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/identity/onepassword_info.py * fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py * fixed validation-modules for plugins/modules/files/xml.py * fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py * fixed validation-modules for plugins/modules/cloud/smartos/vmadm.py * fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py * fixed validation-modules for plugins/modules/cloud/packet/packet_device.py * fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py * fixed validation-modules for plugins/module_utils/oracle/oci_utils.py * fixed validation-modules for plugins/doc_fragments/oracle_creatable_resource.py * Tidy up validate-modules:parameter-list-no-elements for some modules * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * Fixed pending issues from CI validation * Fixed xml module elements for add_children & set_children * added changelog fragment * typo * fix wording in changelog frag
2021-02-16 07:11:37 +01:00
elements: dict
2020-03-09 10:11:07 +01:00
description:
- See examples
'''
EXAMPLES = '''
- name: Create a simple annotation event with a source
community.general.librato_annotation:
2020-03-09 10:11:07 +01:00
user: user@example.com
api_key: XXXXXXXXXXXXXXXXX
title: App Config Change
source: foo.bar
description: This is a detailed description of the config change
- name: Create an annotation that includes a link
community.general.librato_annotation:
2020-03-09 10:11:07 +01:00
user: user@example.com
api_key: XXXXXXXXXXXXXXXXXX
name: code.deploy
title: app code deploy
description: this is a detailed description of a deployment
links:
- rel: example
href: http://www.example.com/deploy
- name: Create an annotation with a start_time and end_time
community.general.librato_annotation:
2020-03-09 10:11:07 +01:00
user: user@example.com
api_key: XXXXXXXXXXXXXXXXXX
name: maintenance
title: Maintenance window
description: This is a detailed description of maintenance
start_time: 1395940006
end_time: 1395954406
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url
def post_annotation(module):
user = module.params['user']
api_key = module.params['api_key']
name = module.params['name']
title = module.params['title']
url = 'https://metrics-api.librato.com/v1/annotations/%s' % name
params = {}
params['title'] = title
if module.params['source'] is not None:
params['source'] = module.params['source']
if module.params['description'] is not None:
params['description'] = module.params['description']
if module.params['start_time'] is not None:
params['start_time'] = module.params['start_time']
if module.params['end_time'] is not None:
params['end_time'] = module.params['end_time']
if module.params['links'] is not None:
params['links'] = module.params['links']
json_body = module.jsonify(params)
headers = {}
headers['Content-Type'] = 'application/json'
# Hack send parameters the way fetch_url wants them
module.params['url_username'] = user
module.params['url_password'] = api_key
response, info = fetch_url(module, url, data=json_body, headers=headers)
response_code = str(info['status'])
response_body = info['body']
if info['status'] != 201:
if info['status'] >= 400:
module.fail_json(msg="Request Failed. Response code: " + response_code + " Response body: " + response_body)
else:
module.fail_json(msg="Request Failed. Response code: " + response_code)
response = response.read()
module.exit_json(changed=True, annotation=response)
def main():
module = AnsibleModule(
argument_spec=dict(
user=dict(required=True),
api_key=dict(required=True, no_log=True),
2020-03-09 10:11:07 +01:00
name=dict(required=False),
title=dict(required=True),
source=dict(required=False),
description=dict(required=False),
start_time=dict(required=False, default=None, type='int'),
end_time=dict(required=False, default=None, type='int'),
Tidy up validate-modules:parameter-list-no-elements (batch 1) (#1795) * fixed validation-modules for plugins/modules/storage/netapp/na_ontap_gather_facts.py * fixed validation-modules for plugins/modules/source_control/gitlab/gitlab_runner.py * fixed validation-modules for plugins/modules/packaging/os/redhat_subscription.py * fixed validation-modules for plugins/modules/notification/twilio.py * fixed validation-modules for plugins/modules/notification/slack.py * fixed validation-modules for plugins/modules/notification/sendgrid.py * fixed validation-modules for plugins/modules/notification/rocketchat.py * fixed validation-modules for plugins/modules/notification/office_365_connector_card.py * fixed validation-modules for plugins/modules/notification/nexmo.py * fixed validation-modules for plugins/modules/notification/mail.py * fixed validation-modules for plugins/modules/net_tools/omapi_host.py * fixed validation-modules for plugins/modules/net_tools/nsupdate.py * fixed validation-modules for plugins/modules/net_tools/dnsimple.py * fixed validation-modules for plugins/modules/monitoring/pagerduty.py * fixed validation-modules for plugins/modules/monitoring/librato_annotation.py * fixed validation-modules for plugins/modules/identity/onepassword_info.py * fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py * fixed validation-modules for plugins/modules/files/xml.py * fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py * fixed validation-modules for plugins/modules/cloud/smartos/vmadm.py * fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py * fixed validation-modules for plugins/modules/cloud/packet/packet_device.py * fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py * fixed validation-modules for plugins/module_utils/oracle/oci_utils.py * fixed validation-modules for plugins/doc_fragments/oracle_creatable_resource.py * Tidy up validate-modules:parameter-list-no-elements for some modules * fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py * Fixed pending issues from CI validation * Fixed xml module elements for add_children & set_children * added changelog fragment * typo * fix wording in changelog frag
2021-02-16 07:11:37 +01:00
links=dict(type='list', elements='dict')
2020-03-09 10:11:07 +01:00
)
)
post_annotation(module)
if __name__ == '__main__':
main()