Skip to content

Commit 495d915

Browse files
authored
Remove unsupported API example (#1939)
* Python API example is unsupported and difficult to maintain with each new release. Signed-off-by: Abhijeet Kasurde <[email protected]>
1 parent ac88861 commit 495d915

File tree

2 files changed

+1
-155
lines changed

2 files changed

+1
-155
lines changed

docs/docsite/rst/dev_guide/developing_api.rst

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,11 @@ Python API
66

77
.. contents:: Topics
88

9-
.. note:: This API is intended for internal Ansible use. Ansible may make changes to this API at any time that could break backward compatibility with older versions of the API. Because of this, external use is not supported by Ansible. If you want to use Python API only for executing playbooks or modules, consider `ansible-runner <https://ansible-runner.readthedocs.io/en/latest/>`_ first.
10-
11-
There are several ways to use Ansible from an API perspective. You can use
12-
the Ansible Python API to control nodes, you can extend Ansible to respond to various Python events, you can
13-
write plugins, and you can plug in inventory data from external data sources. This document
14-
gives a basic overview and examples of the Ansible execution and playbook API.
9+
.. attention:: The Ansible API is intended for internal Ansible use. Ansible may make changes to this API at any time that could break backward compatibility with older versions of the API. Because of this, external use is not supported by Ansible. If you want to use Python API only for executing playbooks or modules, consider `ansible-runner <https://ansible-runner.readthedocs.io/en/latest/>`_ first.
1510

1611
If you would like to use Ansible programmatically from a language other than Python, trigger events asynchronously,
1712
or have access control and logging demands, please see the `AWX project <https://github.com/ansible/awx/>`_.
1813

19-
.. note:: Because Ansible relies on forking processes, this API is not thread safe.
20-
21-
.. _python_api_example:
22-
23-
Python API example
24-
==================
25-
26-
This example is a simple demonstration that shows how to minimally run a couple of tasks:
27-
28-
.. literalinclude:: ../../../../examples/scripts/uptime.py
29-
:language: python
30-
31-
.. note:: Ansible emits warnings and errors through the display object, which prints directly to stdout, stderr and the Ansible log.
32-
33-
The source code for the ``ansible``
34-
command line tools (``lib/ansible/cli/``) is `available on GitHub <https://github.com/ansible/ansible/tree/devel/lib/ansible/cli>`_.
35-
3614
.. seealso::
3715

3816
:ref:`developing_inventory`

examples/scripts/uptime.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)