The NetapiClient
class provides access to
Python API client interfaces when
developing netapi modules
Provide a uniform method of accessing the various client interfaces in Salt in the form of low-data data structures. For example:
>>> client = NetapiClient(__opts__)
>>> lowstate = {'client': 'local', 'tgt': '*', 'fun': 'test.ping', 'arg': ''}
>>> client.run(lowstate)
Run execution modules synchronously
See salt.client.LocalClient.cmd()
for all available
parameters.
Sends a command from the master to the targeted minions. This is the
same interface that Salt's own CLI uses. Note the arg
and kwarg
parameters are sent down to the minion(s) and the given function,
fun
, is called with those parameters.
Returns the result from the execution module
Run execution modules asynchronously
Wraps salt.client.LocalClient.run_job()
.
job ID
Run execution modules against subsets of minions
New in version 2016.3.0.
Execute the specified function in the specified client by passing the lowstate
Run runner modules <all-salt.runners> synchronously
Wraps salt.runner.RunnerClient.cmd_sync()
.
Note that runner functions must be called using keyword arguments. Positional arguments are not supported.
Returns the result from the runner module
Run runner modules <all-salt.runners> asynchronously
Wraps salt.runner.RunnerClient.cmd_async()
.
Note that runner functions must be called using keyword arguments. Positional arguments are not supported.
event data and a job ID for the executed function.
Run salt-ssh commands synchronously
Wraps salt.client.ssh.client.SSHClient.cmd_sync()
.
Returns the result from the salt-ssh command
Run wheel modules synchronously
Wraps salt.wheel.WheelClient.master_call()
.
Note that wheel functions must be called using keyword arguments. Positional arguments are not supported.
Returns the result from the wheel module
Run wheel modules asynchronously
Wraps salt.wheel.WheelClient.master_call()
.
Note that wheel functions must be called using keyword arguments. Positional arguments are not supported.
Returns the result from the wheel module