2012-11-16 18:18:22 +00:00
|
|
|
.. _netapi-introduction:
|
|
|
|
|
2014-06-19 19:22:57 +00:00
|
|
|
==================
|
|
|
|
``netapi`` modules
|
|
|
|
==================
|
|
|
|
|
2012-11-16 17:41:06 +00:00
|
|
|
Introduction to netapi modules
|
|
|
|
==============================
|
|
|
|
|
2014-06-19 02:16:20 +00:00
|
|
|
netapi modules provide API-centric access to Salt. Usually externally-facing
|
|
|
|
services such as REST or WebSockets, XMPP, XMLRPC, etc.
|
2013-03-20 15:36:59 +00:00
|
|
|
|
2014-06-19 02:16:20 +00:00
|
|
|
In general netapi modules bind to a port and start a service. They are
|
|
|
|
purposefully open-ended. A single module can be configured to run as well as
|
|
|
|
multiple modules simultaneously.
|
2012-11-16 17:41:06 +00:00
|
|
|
|
2014-06-19 02:16:20 +00:00
|
|
|
netapi modules are enabled by adding configuration to your Salt Master config
|
|
|
|
file and then starting the :command:`salt-api` daemon. Check the docs for each
|
|
|
|
module to see external requirements and configuration settings.
|
2013-03-20 15:36:59 +00:00
|
|
|
|
2014-06-19 02:16:20 +00:00
|
|
|
Communication with Salt and Salt satellite projects is done using Salt's own
|
|
|
|
:ref:`Python API <python-api>`. A list of available client interfaces is below.
|
|
|
|
|
|
|
|
.. admonition:: salt-api
|
|
|
|
|
2014-07-15 23:02:19 +00:00
|
|
|
Prior to Salt's 2014.7.0 release, netapi modules lived in the separate sister
|
2014-06-19 02:16:20 +00:00
|
|
|
projected ``salt-api``. That project has been merged into the main Salt
|
|
|
|
project.
|
2012-11-16 17:41:06 +00:00
|
|
|
|
2014-06-19 19:22:57 +00:00
|
|
|
.. seealso:: :ref:`The full list of netapi modules <all-netapi-modules>`
|
|
|
|
|
2012-11-16 17:41:06 +00:00
|
|
|
Client interfaces
|
|
|
|
=================
|
|
|
|
|
2014-06-19 02:16:20 +00:00
|
|
|
Salt's client interfaces expose executing functions by crafting a dictionary of
|
|
|
|
values that are mapped to function arguments. This allows calling functions
|
|
|
|
simply by creating a data structure. (And this is exactly how much of Salt's
|
|
|
|
own internals work!)
|
|
|
|
|
2014-06-19 19:01:37 +00:00
|
|
|
.. autoclass:: salt.netapi.NetapiClient
|
2017-01-15 23:07:55 +00:00
|
|
|
:members: local, local_async, local_subset, ssh, ssh_async,
|
2016-02-20 19:27:41 +00:00
|
|
|
runner, runner_async, wheel, wheel_async
|
2016-02-01 03:10:02 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
|
|
|
../tutorials/http
|
|
|
|
writing
|
2016-02-20 19:27:41 +00:00
|
|
|
|