kaisero / fireREST

Python library for interacting with Cisco Firepower Management Center REST API
GNU General Public License v3.0
70 stars 49 forks source link

API Limit/Offset #1

Closed Grems0203 closed 6 years ago

Grems0203 commented 6 years ago

Hi Kaisero, Great work, this helped me out in a time of need! I needed to update 8000 AC Rules to include Syslog after a migration from ASA. The current "limit" is set to 50 in fireREST.py on line 70. The FirePower API Token is only valid for 30 minutes, and the script took a while to get through all 8000 Rules, so i had to increase the "limit" to 1000 (which is the API limit itself). This meant that the script collected the data much quicker. It may be worth increasing this limit in the production code to prevent this issue occurring going forwards. Also, it might be worth investigating whether there is a way to utilise the X-authentication-refresh-token if the script runs over 30 minutes. I have a couple of API scripts myself which ill do a bit of testing with around this and report back if i find anything.

kaisero commented 6 years ago

Hi,

sorry for the late reply, I havent checked my GitHub in a while. I have added support for authentication refresh for up to 3 times (api max) in the v1 branch and did some editing considering the limit, will push to master soon.

kaisero commented 6 years ago

Fixed in version 1.0