clarify httpapi with an example (#65083)

pull/65273/head
Sandra McCann 5 years ago committed by Alicia Cozine
parent b2fc12a29f
commit 7084dd727a

@ -27,6 +27,9 @@ Because network modules execute on the control node instead of on the managed no
"httpapi", "API over HTTP/HTTPS", "network_os setting", "yes" "httpapi", "API over HTTP/HTTPS", "network_os setting", "yes"
"local", "depends on provider", "provider setting", "no" "local", "depends on provider", "provider setting", "no"
.. note::
``httpapi`` deprecates ``eos_eapi`` and ``nxos_nxapi``. See :ref:`httpapi_plugins` for details and an example.
Beginning with Ansible 2.6, we recommend using one of the persistent connection types listed above instead of ``local``. With persistent connections, you can define the hosts and credentials only once, rather than in every task. For more details on using each connection type on various platforms, see the :ref:`platform-specific <platform_options>` pages. Beginning with Ansible 2.6, we recommend using one of the persistent connection types listed above instead of ``local``. With persistent connections, you can define the hosts and credentials only once, rather than in every task. For more details on using each connection type on various platforms, see the :ref:`platform-specific <platform_options>` pages.

@ -32,6 +32,27 @@ Most httpapi plugins can operate without configuration. Additional options may b
Plugins are self-documenting. Each plugin should document its configuration options. Plugins are self-documenting. Each plugin should document its configuration options.
The following sample playbook shows the httpapi plugin for an Arista network device, assuming an inventory variable set as ``ansible_network_os=eos`` for the httpapi plugin to trigger off:
.. code-block:: yaml
- hosts: leaf01
connection: httpapi
gather_facts: false
tasks:
- name: type a simple arista command
eos_command:
commands:
- show version | json
register: command_output
- name: print command output to terminal window
debug:
var: command_output.stdout[0]["version"]
See the full working example at https://github.com/network-automation/httpapi.
.. _httpapi_plugin_list: .. _httpapi_plugin_list:
Plugin List Plugin List

Loading…
Cancel
Save