and as illustrated above (exceptions obtained from successful requests), for these 2 API functions the normal behaviour if the request is processed successfully is to return a non-empty dictionary with some info.
So it seems that api_call should not be checked to be an empty dictionary here ; instead, for instance, a copy of it from which the regular key,value pairs returned upon successful operation are removed could be, but other possibilities exist.
In a few locations in the alerting.py code, for instance here (there may be more I did not check)
https://github.com/ZPascal/grafana_api_sdk/blob/main/grafana_api/alerting.py#L99-L101 and https://github.com/ZPascal/grafana_api_sdk/blob/main/grafana_api/alerting.py#L164-L166
the return object from the api_call is checked to be an empty dictionary, and if it is not then an exception is raised.
However according to the Grafana API documentation: https://editor.swagger.io/?url=https://raw.githubusercontent.com/grafana/grafana/main/pkg/services/ngalert/api/tooling/post.json
and as illustrated above (exceptions obtained from successful requests), for these 2 API functions the normal behaviour if the request is processed successfully is to return a non-empty dictionary with some info.
So it seems that
api_call
should not be checked to be an empty dictionary here ; instead, for instance, a copy of it from which the regular key,value pairs returned upon successful operation are removed could be, but other possibilities exist.