| :mod:`airflow.contrib.operators.hipchat_operator` |
| ================================================= |
| |
| .. py:module:: airflow.contrib.operators.hipchat_operator |
| |
| |
| Module Contents |
| --------------- |
| |
| .. py:class:: HipChatAPIOperator(token, base_url='https://api.hipchat.com/v2', *args, **kwargs) |
| |
| Bases: :class:`airflow.models.BaseOperator` |
| |
| Base HipChat Operator. |
| All derived HipChat operators reference from HipChat's official REST API documentation |
| at https://www.hipchat.com/docs/apiv2. Before using any HipChat API operators you need |
| to get an authentication token at https://www.hipchat.com/docs/apiv2/auth. |
| In the future additional HipChat operators will be derived from this class as well. |
| |
| :param token: HipChat REST API authentication token |
| :type token: str |
| :param base_url: HipChat REST API base url. |
| :type base_url: str |
| |
| |
| .. method:: prepare_request(self) |
| |
| Used by the execute function. Set the request method, url, and body of HipChat's |
| REST API call. |
| Override in child class. Each HipChatAPI child operator is responsible for having |
| a prepare_request method call which sets self.method, self.url, and self.body. |
| |
| |
| |
| |
| .. method:: execute(self, context) |
| |
| |
| |
| |
| .. py:class:: HipChatAPISendRoomNotificationOperator(room_id, message, *args, **kwargs) |
| |
| Bases: :class:`airflow.contrib.operators.hipchat_operator.HipChatAPIOperator` |
| |
| Send notification to a specific HipChat room. |
| More info: https://www.hipchat.com/docs/apiv2/method/send_room_notification |
| |
| :param room_id: Room in which to send notification on HipChat. (templated) |
| :type room_id: str |
| :param message: The message body. (templated) |
| :type message: str |
| :param frm: Label to be shown in addition to sender's name |
| :type frm: str |
| :param message_format: How the notification is rendered: html or text |
| :type message_format: str |
| :param color: Background color of the msg: yellow, green, red, purple, gray, or random |
| :type color: str |
| :param attach_to: The message id to attach this notification to |
| :type attach_to: str |
| :param notify: Whether this message should trigger a user notification |
| :type notify: bool |
| :param card: HipChat-defined card object |
| :type card: dict |
| |
| .. attribute:: template_fields |
| :annotation: = ['token', 'room_id', 'message'] |
| |
| |
| |
| .. attribute:: ui_color |
| :annotation: = #2980b9 |
| |
| |
| |
| |
| .. method:: prepare_request(self) |
| |
| |
| |
| |