cisco-en-programmability / dnacentersdk

Cisco DNA Center Python SDK
https://dnacentersdk.readthedocs.io/en/latest/
MIT License
70 stars 33 forks source link

Dict_of_str not used in custom_caller #74

Closed erraa closed 1 year ago

erraa commented 1 year ago

Prerequisites

Describe the bug When adding a custom api caller the headers aren't processed through the dict_of_str function https://github.com/cisco-en-programmability/dnacentersdk/blob/495bffcf4848dbaa7eaf9889e7ae33456b5c127c/dnacentersdk/api/custom_caller.py#L149

Expected behavior Expecting the same behaviour as in the non custom modules. Example: https://github.com/cisco-en-programmability/dnacentersdk/blob/495bffcf4848dbaa7eaf9889e7ae33456b5c127c/dnacentersdk/api/v2_2_3_3/sda.py#L117

Environment (please complete the following information):

Additional context Workaround is to import it on your own.

from dnacentersdk.utils import dict_of_str

dnac.custom_caller.add_api("get_vns", lambda headers: dnac.custom_caller.call_api("GET", "api/v1/aca-controller-service/getAcaVnSummary", headers=dict_of_str(headers)))
bvargasre commented 1 year ago

Hi @erraa dnacentersdk v2.5.5 is available. Feel free to test it and close or comment if necessary.

https://github.com/cisco-en-programmability/dnacentersdk/blob/925e40e52f5f4da567d6ece9904560f88c8d18a3/dnacentersdk/api/custom_caller.py#L150

bvargasre commented 1 year ago

Hi @erraa Gently reminder to comment if there is any problem or doubt. If there are no comments, I will close this topic for inactivity this Wednesday.