airflow.contrib.operators.hipchat_operator

Module Contents

class airflow.contrib.operators.hipchat_operator.HipChatAPIOperator(token, base_url='https://api.hipchat.com/v2', *args, **kwargs)[source]

Bases: 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.

Parameters
  • token (str) – HipChat REST API authentication token

  • base_url (str) – HipChat REST API base url.

prepare_request(self)[source]

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.

execute(self, context)[source]
class airflow.contrib.operators.hipchat_operator.HipChatAPISendRoomNotificationOperator(room_id, message, *args, **kwargs)[source]

Bases: 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

Parameters
  • room_id (str) – Room in which to send notification on HipChat. (templated)

  • message (str) – The message body. (templated)

  • frm (str) – Label to be shown in addition to sender’s name

  • message_format (str) – How the notification is rendered: html or text

  • color (str) – Background color of the msg: yellow, green, red, purple, gray, or random

  • attach_to (str) – The message id to attach this notification to

  • notify (bool) – Whether this message should trigger a user notification

  • card (dict) – HipChat-defined card object

template_fields = ['token', 'room_id', 'message'][source]
ui_color = #2980b9[source]
prepare_request(self)[source]

Was this entry helpful?