Introduction to netapi modules

netapi modules generally bind to a port and start a service. They are purposefully open-ended. There could be multiple netapi modules that provide a REST interface, a module that provides an XMPP interface, or Websockets, or XMLRPC.

netapi modules are enabled by adding configuration to your master config file. Check the docs for each module to see external requirements and configuration settings.

Communication with Salt and Salt satellite projects is done by passing a list of lowstate dictionaries to a client interface. A list of available client interfaces is below. The lowstate dictionary items map to keyword arguments on the client interface.

See also

python-api

Client interfaces

class saltapi.APIClient(opts)

Provide a uniform method of accessing the various client interfaces in Salt in the form of low-data data structures. For example:

>>> client = APIClient(__opts__)
>>> lowstate = {'client': 'local', 'tgt': '*', 'fun': 'test.ping', 'arg': ''}
>>> client.run(lowstate)
local(*args, **kwargs)

Run execution modules syncronously

Wraps salt.client.LocalClient.cmd().

Returns:Returns the result from the execution module
local_async(*args, **kwargs)

Run execution modules asyncronously

Wraps salt.client.LocalClient.run_job().

Returns:job ID
local_batch(*args, **kwargs)

Run execution modules against batches of minions

New in version 0.8.4.

Wraps salt.client.LocalClient.cmd_batch()

Returns:Returns the result from the exeuction module for each batch of returns
runner(fun, **kwargs)

Run runner modules <all-salt.runners>

Wraps salt.runner.RunnerClient.low().

Returns:Returns the result from the runner module
wheel(fun, **kwargs)

Run wheel modules

Wraps salt.wheel.WheelClient.master_call().

Returns:Returns the result from the wheel module