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

The API endpoint for `auditrecords` is incorrect #67

Closed pakudev closed 4 months ago

pakudev commented 2 years ago

The api call for getting all audit records is

/api/fmc_platform/v1/domain/{domainUUID}/audit/auditrecords

But when I implement this using this library, I get a 404 error. When I dig into the error, I see the API endpoint the library querying is

/api/fmc_config/v1/domain/{domainUUID}/audit/auditrecords

The source code I used to produce this problem

import fireREST as fr
from ..config import HOSTNAME, USERNAME, PASSWORD, DOMAIN

# Try establishing a connection and exit out if the credentials
# are not correct
try:
    fmc = fr.FMC(hostname=HOSTNAME, username=USERNAME, password=PASSWORD, domain=DOMAIN)
except fr.exceptions.AuthError:
    print('Auth error, check your credentials')
    exit(0)

all_audits =  fmc.audit.auditrecords.get()

Traceback

Traceback (most recent call last):
  File "C:\Users\User\Python\Python310\lib\site-packages\fireREST\utils.py", line 190, in wrapper
    response.raise_for_status()
  File "C:\Users\User\Python\Python310\lib\site-packages\requests\models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: 404 for url: https://10.106.38.119/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/audit/auditrecords?limit=1000&expanded=True
kaisero commented 2 years ago

Thanks for the report - will be fixed in v.1.0.11

rchrabas commented 4 months ago

Fix implemented in development branch.