salt.modules.hipchat

Module for sending messages to hipchat.

New in version 2015.5.0.

configuration:

This module can be used by either passing an api key and version directly or by specifying both in a configuration profile in the salt master/minion config.

It is possible to use a different API than http://api.hipchat.com, by specifying the API URL in config as api_url, or by passing the value directly.

For example:

hipchat:
  api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
  api_version: v1

Custom API Example:

hipchat:
  api_url: http://api.hipchat.myteam.com
  api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
  api_version: v2
salt.modules.hipchat.find_room(name, api_url=None, api_key=None, api_version=None)

Find a room by name and return it.

Parameters:
  • name -- The room name.
  • api_url -- The HipChat API URL, if not specified in the configuration.
  • api_key -- The HipChat admin api key.
  • api_version -- The HipChat api version, if not specified in the configuration.
Returns:

The room object.

CLI Example:

salt '*' hipchat.find_room name="Development Room"

salt '*' hipchat.find_room name="Development Room" api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_version=v1
salt.modules.hipchat.find_user(name, api_url=None, api_key=None, api_version=None)

Find a user by name and return it.

Parameters:
  • name -- The user name.
  • api_url -- The HipChat API URL, if not specified in the configuration.
  • api_key -- The HipChat admin api key.
  • api_version -- The HipChat api version, if not specified in the configuration.
Returns:

The user object.

CLI Example:

salt '*' hipchat.find_user name="Thomas Hatch"

salt '*' hipchat.find_user name="Thomas Hatch" api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_version=v1
salt.modules.hipchat.list_rooms(api_url=None, api_key=None, api_version=None)

List all HipChat rooms.

Parameters:
  • api_url -- The HipChat API URL, if not specified in the configuration.
  • api_key -- The HipChat admin api key.
  • api_version -- The HipChat api version, if not specified in the configuration.
Returns:

The room list.

CLI Example:

salt '*' hipchat.list_rooms

salt '*' hipchat.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_version=v1
salt.modules.hipchat.list_users(api_url=None, api_key=None, api_version=None)

List all HipChat users.

Parameters:
  • api_url -- The HipChat API URL, if not specified in the configuration.
  • api_key -- The HipChat admin api key.
  • api_version -- The HipChat api version, if not specified in the configuration.
Returns:

The user list.

CLI Example:

salt '*' hipchat.list_users

salt '*' hipchat.list_users api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_version=v1
salt.modules.hipchat.send_message(room_id, message, from_name, api_url=None, api_key=None, api_version=None, color='yellow', notify=False)

Send a message to a HipChat room.

Parameters:
  • room_id -- The room id or room name, either will work.
  • message -- The message to send to the HipChat room.
  • from_name -- Specify who the message is from.
  • api_url -- The HipChat api URL, if not specified in the configuration.
  • api_key -- The HipChat api key, if not specified in the configuration.
  • api_version -- The HipChat api version, if not specified in the configuration.
  • color -- The color for the message, default: yellow.
  • notify -- Whether to notify the room, default: False.
Returns:

Boolean if message was sent successfully.

CLI Example:

salt '*' hipchat.send_message room_id="Development Room" message="Build is done" from_name="Build Server"

salt '*' hipchat.send_message room_id="Development Room" message="Build failed" from_name="Build Server" color="red" notify=True