summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2018-02-03 00:41:56 +0100
committerGitHub <noreply@github.com>2018-02-03 00:41:56 +0100
commitbee765fa6b065b7a85a73057415cb3264592c2e4 (patch)
tree701a2c858790c4344de1563f0bb49c7800dde8cc /lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py
parent685dd5e8b4f0462571e2a8eabf367da694935178 (diff)
downloadansible-bee765fa6b065b7a85a73057415cb3264592c2e4.tar.gz
ACI: Change RETURN output as discussed (#35617)
* ACI: Change result output as discussed * Update all modules to use new aci.exit_json() * Update output_level spec and docs * Fix integration tests * Small PEP8 fix * Asorted fixes to tests and aci_rest * More test fixes and support for ANSIBLE_DEBUG * Fix another PEP8 issues * Move response handling inside ACI module * Reform of ACI error handling and error output * Diff multiline json output * Fix a few more tests * Revert aci_bd tests * Small correction * UI change: existing->current, original->previous * UI change: config->sent * Update all modules with RETURN values * Fix a few more tests * Improve docstring and add 'raw' return value * Fix thinko * Fix sanity/pep8 issues * Rewrite unit tests to comply with new design
Diffstat (limited to 'lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py')
-rwxr-xr-xlib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py107
1 files changed, 105 insertions, 2 deletions
diff --git a/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py b/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py
index 980fc41d94..b1a6f61ee8 100755
--- a/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py
+++ b/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py
@@ -125,7 +125,110 @@ EXAMPLES = r'''
state: query
'''
-RETURN = ''' # '''
+RETURN = r'''
+current:
+ description: The existing configuration from the APIC after the module has finished
+ returned: success
+ type: list
+ sample:
+ [
+ {
+ "fvTenant": {
+ "attributes": {
+ "descr": "Production environment",
+ "dn": "uni/tn-production",
+ "name": "production",
+ "nameAlias": "",
+ "ownerKey": "",
+ "ownerTag": ""
+ }
+ }
+ }
+ ]
+error:
+ description: The error information as returned from the APIC
+ returned: failure
+ type: dict
+ sample:
+ {
+ "code": "122",
+ "text": "unknown managed object class foo"
+ }
+raw:
+ description: The raw output returned by the APIC REST API (xml or json)
+ returned: parse error
+ type: string
+ sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>'
+sent:
+ description: The actual/minimal configuration pushed to the APIC
+ returned: info
+ type: list
+ sample:
+ {
+ "fvTenant": {
+ "attributes": {
+ "descr": "Production environment"
+ }
+ }
+ }
+previous:
+ description: The original configuration from the APIC before the module has started
+ returned: info
+ type: list
+ sample:
+ [
+ {
+ "fvTenant": {
+ "attributes": {
+ "descr": "Production",
+ "dn": "uni/tn-production",
+ "name": "production",
+ "nameAlias": "",
+ "ownerKey": "",
+ "ownerTag": ""
+ }
+ }
+ }
+ ]
+proposed:
+ description: The assembled configuration from the user-provided parameters
+ returned: info
+ type: dict
+ sample:
+ {
+ "fvTenant": {
+ "attributes": {
+ "descr": "Production environment",
+ "name": "production"
+ }
+ }
+ }
+filter_string:
+ description: The filter string used for the request
+ returned: failure or debug
+ type: string
+ sample: ?rsp-prop-include=config-only
+method:
+ description: The HTTP method used for the request to the APIC
+ returned: failure or debug
+ type: string
+ sample: POST
+response:
+ description: The HTTP response from the APIC
+ returned: failure or debug
+ type: string
+ sample: OK (30 bytes)
+status:
+ description: The HTTP status from the APIC
+ returned: failure or debug
+ type: int
+ sample: 200
+url:
+ description: The HTTP url used for the request to the APIC
+ returned: failure or debug
+ type: string
+ sample: https://10.11.12.13/api/mo/uni/tn-production.json
+'''
from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec
from ansible.module_utils.basic import AnsibleModule
@@ -231,7 +334,7 @@ def main():
elif state == 'absent':
aci.delete_config()
- module.exit_json(**aci.result)
+ aci.exit_json()
if __name__ == "__main__":