CiscoDevNet / python-viptela

Cisco Viptela vManage Python CLI/SDK
GNU General Public License v3.0
94 stars 63 forks source link

logout "method not allowed" #182

Open mccamicha opened 2 months ago

mccamicha commented 2 months ago

Ansible play each time running vmanage_device_attachment it fails even if the device is becomes attached to the correct device template.

Testing device attachment with Ansible, versions:

Every time running a simple playbook with device attachment it fails with "url": "https://"url"/logout", "msg": "method_not_allowed", but the device is attached to a device template in the controller.

looks like it is the logout method which is failing: ansible/module_utils/viptela/viptela.py - line 135. It is using the request method and the default is GET. Tried locally to add "self.request('/logout', method="POST") and I have not received the same error anymore. Only tested this controller version and for this playbook, but /logout might be a POST request regardless of controller version?

junkangli commented 2 months ago

Authentication in SD-WAN API, Release 20.11, the method is documented as GET https://{vmanage-ip-address}/logout, but in Release 20.12 it is changed to POST https://{vmanage-ip-address}/logout.