def send_message(name,
                 room_id,
                 from_name,
                 message,
                 api_url=None,
                 api_key=None,
                 api_version=None,
                 message_color='yellow',
                 notify=False):
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'The following message is to be sent to Hipchat: {0}'.format(message)
        ret['result'] = None
        return ret

    if not room_id:
        ret['comment'] = 'Hipchat room id is missing: {0}'.format(name)
        return ret

    if not from_name:
        ret['comment'] = 'Hipchat from name is missing: {0}'.format(name)
        return ret

    if not message:
        ret['comment'] = 'Hipchat message is missing: {0}'.format(name)
        return ret

    ret['result'] = __salt__['hipchat.send_message'](
        room_id=room_id,
        message=message,
        from_name=from_name,
        api_url=api_url,
        api_key=api_key,
        api_version=api_version,
        color=message_color,
        notify=notify,
    )

    if ret and ret['result']:
        ret['comment'] = 'Sent message: {0}'.format(name)
    else:
        ret['comment'] = 'Failed to send message: {0}'.format(name)

    return ret
Send a message to a Hipchat room.
dataset/ETHPy150Open saltstack/salt/salt/states/hipchat.py/send_message