Connection module for Telemetry
2016.3.0 新版功能.
https://github.com/mongolab/mongolab-telemetry-api-docs/blob/master/alerts.md
configuration: | This module accepts explicit telemetry credentials or can also read api key credentials from a pillar. More Information available at: https://github.com/mongolab/mongolab-telemetry-api-docs/blob/master/alerts.md In the minion's config file: telemetry.telemetry_api_keys:
- abc123 # Key 1
- efg321 # Backup Key 1
telemetry_api_base_url: https://telemetry-api.mongolab.com/v0
|
---|---|
depends: | requests |
salt.modules.telemetry.
create_alarm
(deployment_id, metric_name, data, api_key=None, profile='telemetry')¶create an telemetry alarms.
data is a dict of alert configuration data.
Returns (bool success, str message) tuple.
CLI Example:
salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry
salt.modules.telemetry.
delete_alarms
(deployment_id, alert_id=None, metric_name=None, api_key=None, profile='telemetry')¶Returns (bool success, str message) tuple.
CLI Example:
salt myminion telemetry.delete_alarms rs-ds033197 profile=telemetry
salt.modules.telemetry.
get_alarms
(deployment_id, profile='telemetry')¶get all the alarms set up against the current deployment
Returns dictionary of alarm information
CLI Example:
salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry
salt.modules.telemetry.
get_alert_config
(deployment_id, metric_name=None, api_key=None, profile='telemetry')¶Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config
Returns dictionary or list of dictionaries.
CLI Example:
salt myminion telemetry.get_alert_config rs-ds033197 currentConnections profile=telemetry salt myminion telemetry.get_alert_config rs-ds033197 profile=telemetry
salt.modules.telemetry.
get_notification_channel_id
(notify_channel, profile='telemetry')¶Given an email address, creates a notification-channels if one is not found and also returns the corresponsing notification channel id.
CLI Example:
salt myminion telemetry.get_notification_channel_id userx@company.com profile=telemetry
salt.modules.telemetry.
update_alarm
(deployment_id, metric_name, data, api_key=None, profile='telemetry')¶update an telemetry alarms. data is a dict of alert configuration data.
Returns (bool success, str message) tuple.
CLI Example:
salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry