%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/victorops.pyc |
�
���^c @@ s; d Z d d l m Z m Z m Z d � Z d d � Z d S( u�
Create an Event in VictorOps
============================
.. versionadded:: 2015.8.0
This state is useful for creating events on the
VictorOps service during state runs.
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
- state_message: 'Webserver diskspace is low.'
i ( t absolute_importt print_functiont unicode_literalsc C@ s d t k r d St S( uD
Only load if the victorops module is available in __salt__
u victorops.create_eventu victorops( t __salt__t False( ( ( s9 /usr/lib/python2.7/site-packages/salt/states/victorops.pyt __virtual__ s u everyonec K@ s� i | d 6i d 6d d 6d d 6} t d rC d j | � | d <| St d d | d
| | � } | d d k r� t | d <d j | | d
� | d <n! t | d <d j | d � | d <| S( u
Create an event on the VictorOps service
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
- state_message: 'Webserver diskspace is low.'
database-server-warning-message:
victorops.create_event:
- message_type: 'WARNING'
- entity_id: 'db_server/load'
- state_message: 'Database Server load is high.'
- entity_is_host: True
- entity_display_name: 'dbdserver.example.com'
The following parameters are required:
name
This is a short description of the event.
message_type
One of the following values: INFO, WARNING, ACKNOWLEDGEMENT, CRITICAL, RECOVERY.
The following parameters are optional:
routing_key
The key for where messages should be routed. By default, sent to 'everyone' route.
entity_id
The name of alerting entity. If not provided, a random name will be assigned.
timestamp
Timestamp of the alert in seconds since epoch. Defaults to the time the alert is received at VictorOps.
timestamp_fmt
The date format for the timestamp parameter. Defaults to ''%Y-%m-%dT%H:%M:%S'.
state_start_time
The time this entity entered its current state (seconds since epoch). Defaults to the time alert is received.
state_start_time_fmt
The date format for the timestamp parameter. Defaults to '%Y-%m-%dT%H:%M:%S'.
state_message
Any additional status information from the alert item.
entity_is_host
Used within VictorOps to select the appropriate display format for the incident.
entity_display_name
Used within VictorOps to display a human-readable name for the entity.
ack_message
A user entered comment for the acknowledgment.
ack_author
The user that acknowledged the incident.
u nameu changesu resultu u commentu testu Need to create event: {0}u victorops.create_eventt message_typet routing_keyu successu! Created event: {0} for entity {1}u entity_idu Failed to create event: {0}u messageN( t Nonet __opts__t formatR t TrueR ( t nameR R t kwargst rett res( ( s9 /usr/lib/python2.7/site-packages/salt/states/victorops.pyt create_event s"