salt.engines.hipchat module

An engine that reads messages from Hipchat and sends them to the Salt event bus. Alternatively Salt commands can be sent to the Salt master via Hipchat by setting the control parameter to True and using command prefaced with a !. Only token key is required, but room and control keys make the engine interactive.

depends:

hypchat

configuration:

Example configuration

engines:
    - hipchat:
        api_url: http://api.hipchat.myteam.com
        token: 'XXXXXX'
        room: 'salt'
        control: True
        valid_users:
            - SomeUser
        valid_commands:
            - test.ping
            - cmd.run
            - list_jobs
            - list_commands
        aliases:
            list_jobs:
                cmd: jobs.list_jobs
            list_commands:
                cmd: pillar.get salt:engines:hipchat:valid_commands target=saltmaster
        max_rooms: 0
        wait_time: 1
salt.engines.hipchat.start(token, room='salt', aliases=None, valid_users=None, valid_commands=None, control=False, trigger='!', tag='salt/engines/hipchat/incoming', api_key=None, api_url=None, max_rooms=None, wait_time=None, output_type='file', outputter='nested')

Listen to Hipchat messages and forward them to Salt.

token
The HipChat API key. It requires a key for global usgae, assigned per user, rather than room.
room
The HipChat room name.
aliases
Define custom aliases.
valid_users
Restrict access only to certain users.
valid_commands
Restrict the execution to a limited set of commands.
control
Send commands to the master.
trigger: !
Special character that triggers the execution of salt commands.
tag: salt/engines/hipchat/incoming
The event tag on the Salt bus.
api_url: https://api.hipchat.com

The URL to the HipChat API.

New in version 2017.7.0.

max_rooms: 1000
Maximum number of rooms allowed to fetch. If set to 0, it is able to retrieve the entire list of rooms.
wait_time: 5
Maximum wait time, in seconds.
output_type: file

The type of the output. Choose bewteen:

  • file: save the output into a temporary file and upload
  • html: send the output as HTML
  • code: send the output as code

This can be overriden when executing a command, using the --out-type argument.

New in version 2017.7.0.

outputter: nested

The format to display the data, using the outputters available on the CLI. This argument can also be overriden when executing a command, using the --out option.

New in version 2017.7.0.

HipChat Example:

! test.ping
! test.ping target=minion1
! test.ping --out=nested
! test.ping --out-type=code --out=table