CiscoISE/ciscoisesdk

('/ers/config/networkdevice/name/{name}') endpoint is incorrect?

Closed this issue · 5 comments

Hello,

I was trying to use Ansible ISE module which is built on top of this SDK and I ran into an issue with the network device endpoint. From what I observed it looks like the endpoint is incorrect. I don't see Cisco ISE API allowing it.

ISE version used: 2.4 in the lab - also tested on 2.7 and 3.0 on Cisco dCloud.

Error from Ansible:

failed: [192.168.10.10] (item=swtest01) => { "ansible_loop_var": "item", "item": "al-wtc-sr01", "msg": "An error occured when executing operation. The error was: [405] Method Not Allowed - The requested Method is not supported for that resource!\n{\n \"ERSResponse\" : {\n \"operation\" : \"GET-get by name-networkdevice\",\n \"messages\" : [ {\n \"title\" : \"The requested Method is not supported for that resource!\",\n \"type\" : \"ERROR\",\n \"code\" : \"Unsupported method exception\"\n } ],\n \"link\" : {\n \"rel\" : \"related\",\n \"href\" : \"https://192.168.10.10:9060/ers/config/networkdevice/name/swtest01\",\n \"type\" : \"application/xml\"\n }\n }\n}" }

Error from direct API request:
{ "ERSResponse": { "operation": "GET-get by name-networkdevice", "messages": [ { "title": "The requested Method is not supported for that resource!", "type": "ERROR", "code": "Unsupported method exception" } ], "link": { "rel": "related", "href": "https://192.168.10.10:9060/ers/config/networkdevice/name/swtest01", "type": "application/xml" } } }

Reference:
https://developer.cisco.com/docs/identity-services-engine/3.0/#!network-device/resource-definition

I was only able to search devices by name using the filter: https://192.168.10.10:9060/ers/config/networkdevice?filter=name.Contains.swtest01

Hence why I think the endpoint should be updated to "/ers/config/networkdevice?filter=name.Contains.{name}"

Can you test with 3.1? That's the official minimum supported version.

I do see the endpoint on 3.1...

Any way I can override it?

No, sorry. The minimum supported version is 3.1. The Ansible collection and the Python SDK is somewhat backwards compatible as long as the API from 3.1 is the same as in previous versions, but both libraries were developed and tested with 3.1 in mind.

Ok, thanks. I'll close this.