You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/docs/docsite/rst/reference_appendices/module_utils.rst

75 lines
1.7 KiB
ReStructuredText

.. _ansible.module_utils:
.. _module_utils:
***************************************************************
Ansible Reference: Module Utilities
***************************************************************
This page documents utilities intended to be helpful when writing
Ansible modules in Python.
AnsibleModule
--------------
To use this functionality, include ``from ansible.module_utils.basic import AnsibleModule`` in your module.
.. autoclass:: ansible.module_utils.basic.AnsibleModule
:members:
:noindex:
Basic
------
To use this functionality, include ``import ansible.module_utils.basic`` in your module.
.. automodule:: ansible.module_utils.basic
:members:
Argument Spec
---------------------
Classes and functions for validating parameters against an argument spec.
ArgumentSpecValidator
=====================
.. autoclass:: ansible.module_utils.common.arg_spec.ArgumentSpecValidator
:members:
ValidationResult
================
.. autoclass:: ansible.module_utils.common.arg_spec.ValidationResult
:members:
:member-order: bysource
:private-members: _no_log_values # This only works in sphinx >= 3.2. Otherwise it shows all private members with doc strings.
Parameters
==========
.. automodule:: ansible.module_utils.common.parameters
:members:
.. py:data:: DEFAULT_TYPE_VALIDATORS
:class:`dict` of type names, such as ``'str'``, and the default function
used to check that type, :func:`~ansible.module_utils.common.validation.check_type_str` in this case.
Validation
==========
Standalone functions for validating various parameter types.
.. automodule:: ansible.module_utils.common.validation
:members:
Errors
------
.. automodule:: ansible.module_utils.errors
:members:
:member-order: bysource