Closed AaronFoley closed 1 year ago
Confirm, in case if the "destination" parameter is the last parameter in the URL "api/v2/monitor/router/lookup" Fortigate will return the following error: {'error_message': 'Failed to resolve FQDN'} instead of interested data. As a temporary solution, do not put the "destination" parameter as the last parameter in the URL
fixed in v1.2.4
Hi,
I am trying to access a REST endpoint that needs to be supplied a query parameter, but due the the URL formatting I am not able to do this.
Example:
Will return an error
"{'error_message': 'Failed to resolve FQDN'}"
because the URL is formatted to be:api/v2/monitor/router/lookup?destination=0.0.0.0/
The
_valid_url
function does this: https://github.com/vladimirs-git/fortigate-api/blob/b19f7bd94f152b422323b096b7115ed7ba3192ad/fortigate_api/fortigate.py#L430Will probably either need to remove the trailing
/
from the url, or may extend the get function to also accept parameters. Happy to raise a PR for this, just not sure which solution you would have preferred.A hacky workaround I've found is to add an additional query parameter to the URL so that the
/
ends up as part of that:Thanks, Aaron