You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that parameters passed to ipPools get lost somehow. The parameters pass through the validation and the API call is executed, however I get "[400] Bad Request - Enter correct IP pool or IP pool can not be empty."
Expected behavior
LAN Automation session should be created properly
Screenshots
This is a sample task with parameters and the output:
TASK [lan_auto : Create LAN Automation] **********************************************************************************************************************************************************************
task path: /home/pod5/DCNDEV/Ansible_DNAC/roles/lan_auto/tasks/main.yml:105
The full traceback is:
Traceback (most recent call last):
File "/home/pod5/.ansible/collections/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py", line 231, in exec
response = func(**params)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/api/v2_3_5_3/lan_automation.py", line 132, in lan_automation_start
json_data = self._session.post(endpoint_full_url, params=_params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 619, in post
response = self.request('POST', url, erc, 0, params=params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 471, in request
check_response_code(response, erc)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/utils.py", line 209, in check_response_code
raise ApiError(response)
dnacentersdk.exceptions.ApiError: [400] Bad Request - Enter correct IP pool or IP pool can not be empty.
fatal: [pod5_dnac]: FAILED! => {
"changed": false,
"msg": "An error occured when executing operation. The error was: [400] Bad Request - Enter correct IP pool or IP pool can not be empty."
}
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> ?
Documented commands (type help ):
EOF c continue h help p pprint q quit r redo u update_task
Prerequisites
Describe the bug
It seems that parameters passed to ipPools get lost somehow. The parameters pass through the validation and the API call is executed, however I get "[400] Bad Request - Enter correct IP pool or IP pool can not be empty."
Expected behavior
LAN Automation session should be created properly
Screenshots
This is a sample task with parameters and the output:
cisco.dnac.lan_automation_create:
dnac_host: "{{ dnac_host }}"
dnac_verify: "{{ dnac_verify }}"
payload:
- discoveredDeviceSiteNameHierarchy: "Global/Poland/Warszawa/Hector"
- ipPools:
- ipPoolName: "UNDERLAY"
ipPoolRole: "MAIN_POOL"
#- isisDomainPwd: "{{ isis_password }}"
- mulitcastEnabled: true
- primaryDeviceManagmentIPAddress: "10.15.127.3"
- primaryDeviceInterfaceNames:
- "GigabitEthernet1/0/1"
- "GigabitEthernet1/0/2"
- "GigabitEthernet1/0/3"
- "GigabitEthernet1/0/4"
register: lan_auto_create_output
debugger: always
TASK [lan_auto : Create LAN Automation] **********************************************************************************************************************************************************************
task path: /home/pod5/DCNDEV/Ansible_DNAC/roles/lan_auto/tasks/main.yml:105
The full traceback is:
Traceback (most recent call last):
File "/home/pod5/.ansible/collections/ansible_collections/cisco/dnac/plugins/plugin_utils/dnac.py", line 231, in exec
response = func(**params)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/api/v2_3_5_3/lan_automation.py", line 132, in lan_automation_start
json_data = self._session.post(endpoint_full_url, params=_params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 619, in post
response = self.request('POST', url, erc, 0, params=params,
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/restsession.py", line 471, in request
check_response_code(response, erc)
File "/home/pod5/DCNDEV/Ansible_DNAC/v1/lib/python3.10/site-packages/dnacentersdk/utils.py", line 209, in check_response_code
raise ApiError(response)
dnacentersdk.exceptions.ApiError: [400] Bad Request - Enter correct IP pool or IP pool can not be empty.
fatal: [pod5_dnac]: FAILED! => {
"changed": false,
"msg": "An error occured when executing operation. The error was: [400] Bad Request - Enter correct IP pool or IP pool can not be empty."
}
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)>
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> ?
Documented commands (type help ):
EOF c continue h help p pprint q quit r redo u update_task
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> p
***SyntaxError:SyntaxError('invalid syntax', ('', 0, 0, '', 0, 0))
[pod5_dnac] TASK: lan_auto : Create LAN Automation (debug)> p task.args
{'dnac_debug': False,
'dnac_host': 'pod5-dnac.sdn.lab',
'dnac_password': 'Admeen5sisko',
'dnac_port': 443,
'dnac_username': 'admin',
'dnac_verify': False,
'dnac_version': '2.3.5.3',
'payload': [{'discoveredDeviceSiteNameHierarchy': 'Global/Poland/Warszawa/Hector'},
{'ipPools': [{'ipPoolName': 'UNDERLAY',
'ipPoolRole': 'MAIN_POOL'}]},
{'mulitcastEnabled': True},
{'primaryDeviceManagmentIPAddress': '10.15.127.3'},
{'primaryDeviceInterfaceNames': ['GigabitEthernet1/0/1',
'GigabitEthernet1/0/2',
'GigabitEthernet1/0/3',
'GigabitEthernet1/0/4']}],
'validate_response_schema': True}
When I run this call with the same parameters using SDK directly, it succeeds, a LAN Auto session is created:
def lan_auto_start(pod):
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: