Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias TryExcept body Import alias Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Import alias Import alias Import alias Import alias Import alias Import alias Import alias FunctionDef arguments args defaults body If UnaryOpNot NameLoad body Return NameLoad orelse Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Str keyword NameLoad keyword NameLoad Assign NameStore Dict If CompareIn Str NameLoad body For NameStore SubscriptLoad NameLoad Index Str body If UnaryOpNot SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad Str Str body Expr Str If CompareEq Call AttributeLoad NameLoad attr Str Str body Assign NameStore AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad SubscriptLoad NameLoad Index Str attr orelse Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body If NameLoad body Expr Call NameLoad NameLoad NameLoad orelse Expr Call SubscriptLoad NameLoad Index Str NameLoad NameLoad decorator_list If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Return Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr If NameLoad body While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body If CompareIn Str NameLoad body If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr SubscriptLoad NameLoad Index Str Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Dict attr Str NameLoad If NameLoad body If BoolOpAnd Call AttributeLoad NameLoad attr NameLoad NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad SubscriptLoad NameLoad Index Str If BoolOpAnd CompareNotIn SubscriptLoad NameLoad Index Str NameLoad CompareNotIn Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Str Return Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore ListLoad Assign NameStore Dict If NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return If CompareGt Call NameLoad NameLoad Num body For NameStore SubscriptLoad NameLoad Slice Num body If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Assign NameStore Str orelse Assign NameStore SubscriptLoad NameLoad Index Str Delete SubscriptDel NameLoad Index Str Assign NameStore Dict If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad CompareIn NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str If CompareIn Str SubscriptLoad NameLoad Index NameLoad body If CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad NameLoad NameLoad orelse If CompareIn NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str keyword SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIn Str NameLoad CompareIs SubscriptLoad NameLoad Index Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str orelse Expr Call NameLoad Call AttributeLoad Str attr NameLoad SubscriptLoad NameLoad Index Str NameLoad orelse Expr Call NameLoad Call AttributeLoad Str attr NameLoad SubscriptLoad NameLoad Index Str NameLoad decorator_list
N/A N/A 
An engine that reads messages from Slack and sends them to the Salt
event bus.  Alternatively Salt commands can be sent to the Salt master
via Slack by setting the control paramter to True and using command
prefaced with a !.

.. versionadded: 2016.3.0

:configuration:

    Example configuration
        engines:
            slack:
               token: 'xoxb-xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx'
               control: True
               valid_users:
                   - garethgreenaway
               valid_commands:
                   - test.ping
                   - cmd.run
               aliases:
                   list_jobs:
                       type: runner
                       cmd: jobs.list_jobs

:depends: slackclient
 __future__ absolute_import N/A datetime N/A json N/A logging N/A pprint N/A time N/A N/A N/A slackclient N/A HAS_SLACKCLIENT True N/A N/A N/A ImportError N/A N/A HAS_SLACKCLIENT False N/A salt.client N/A salt.loader N/A salt.runner N/A salt.utils N/A salt.utils.event N/A salt.utils.http N/A salt.utils.slack __virtual__ N/A N/A N/A N/A N/A N/A HAS_SLACKCLIENT N/A N/A False N/A N/A True N/A N/A log N/A N/A logging getLogger __name__ _get_users N/A N/A token N/A N/A N/A 
    Get all users from Slack
     N/A N/A N/A log debug running _get_users N/A ret N/A N/A N/A N/A salt utils slack query function users api_key token opts __opts__ N/A users N/A N/A N/A message ret N/A N/A item N/A ret N/A message N/A N/A N/A N/A item N/A is_bot N/A N/A N/A users N/A N/A item N/A name N/A item N/A id N/A N/A users N/A N/A item N/A id N/A item N/A name N/A users N/A start N/A N/A token aliases valid_users valid_commands control trigger tag N/A None None None False ! salt/engines/slack N/A N/A 
    Listen to Slack events and forward them to Salt
     N/A N/A N/A N/A __opts__ get __role master N/A N/A fire_master N/A N/A N/A N/A N/A salt utils event get_master_event __opts__ N/A __opts__ N/A sock_dir fire_event N/A N/A fire_master None fire N/A N/A tag msg N/A N/A N/A fire_master N/A N/A N/A fire_master msg tag N/A N/A N/A N/A __salt__ N/A event.send tag msg N/A N/A N/A token N/A N/A N/A N/A log debug Slack Bot token not found N/A N/A all_users N/A _get_users token N/A sc N/A N/A slackclient SlackClient token N/A slack_connect N/A N/A sc rtm_connect N/A runner_functions N/A sorted N/A N/A N/A N/A salt runner Runner __opts__ functions N/A slack_connect N/A N/A True N/A N/A _msg N/A N/A sc rtm_read N/A _m _msg N/A N/A N/A type _m N/A N/A N/A N/A _m N/A type message N/A N/A channel N/A N/A N/A N/A sc server channels find N/A _m N/A channel N/A _text N/A N/A N/A _m get text None N/A N/A N/A N/A _m get message N/A get text None N/A _text N/A N/A N/A N/A N/A _text startswith trigger control N/A N/A valid_users N/A N/A N/A N/A log debug N/A N/A {0} {1} format all_users N/A _m N/A user N/A N/A N/A N/A _m N/A user valid_users N/A N/A N/A all_users get N/A _m N/A user None valid_users N/A N/A N/A N/A channel send_message N/A N/A {0} not authorized to run Salt commands format N/A all_users N/A N/A _m N/A user N/A N/A cmdline N/A N/A N/A salt utils shlex_split N/A _text N/A N/A len trigger N/A cmd N/A cmdline N/A 0 N/A args N/A N/A kwargs N/A N/A valid_commands N/A N/A N/A cmd valid_commands N/A N/A N/A N/A channel send_message N/A N/A Using {0} is not allowed. format cmd N/A N/A N/A N/A len cmdline 1 N/A N/A item N/A cmdline N/A 1 N/A N/A N/A = item N/A N/A N/A key value N/A N/A item split = 1 N/A N/A kwargs N/A key value N/A N/A N/A N/A args append item N/A N/A target kwargs N/A N/A target * N/A N/A target N/A kwargs N/A target N/A N/A kwargs N/A target N/A ret N/A N/A N/A aliases N/A isinstance aliases dict N/A cmd N/A N/A aliases keys N/A N/A salt_cmd N/A N/A N/A aliases N/A cmd get cmd N/A N/A type N/A aliases N/A cmd N/A N/A N/A N/A N/A aliases N/A cmd N/A type runner N/A N/A runner N/A N/A N/A salt runner RunnerClient __opts__ N/A ret N/A N/A runner cmd salt_cmd arg args kwarg kwargs N/A N/A local N/A N/A N/A salt client LocalClient N/A ret N/A N/A local cmd N/A N/A {0} format target salt_cmd args kwargs N/A N/A N/A cmd runner_functions N/A N/A runner N/A N/A N/A salt runner RunnerClient __opts__ N/A ret N/A N/A runner cmd cmd arg args kwarg kwargs N/A N/A local N/A N/A N/A salt client LocalClient N/A ret N/A N/A local cmd N/A N/A {0} format target cmd args kwargs N/A ret N/A N/A pp N/A N/A pprint PrettyPrinter width 1 N/A return_text N/A N/A pp pformat ret N/A ts N/A N/A time time N/A st N/A N/A N/A N/A N/A datetime datetime fromtimestamp ts strftime %Y%m%d%H%M%S%f N/A filename N/A N/A salt-results-{0}.yaml format st N/A result N/A N/A sc api_call files.upload channels N/A _m N/A channel filename filename content return_text N/A _result N/A N/A json loads result N/A N/A N/A ok _result N/A N/A _result N/A ok False N/A N/A N/A N/A channel send_message N/A N/A Error: {0} format N/A _result N/A error N/A N/A N/A fire N/A N/A {0}/{1} format tag N/A _m N/A type _m N/A N/A N/A fire N/A N/A {0}/{1} format tag N/A _m N/A type _m N/A