Hello !
In the following documentation Triggering a user-defined API | DataMiner Docs, there is a note:
"We recommend that API maintainers return errors in the same format for the sake of consistency ."
My first question is how to get the DataMiner ID of the DMA that executed the trigger for setting the "FaultingNode" property. (See my code below)
My second question is : What are your recommendations for managing api failure logging?
Thanks
Regards
Hi kévin,
To get the DataMiner ID of the DMA your script is running on, you can use the Engine object in your API script, see following question: Automation – How to get the ID from the Agent running the automation script?
To answer your second question, the User-defined APIs logic will log failing API requests in one of the logfiles mentioned in here: Troubleshooting User-Defined APIs | DataMiner Docs depending on where it fails. Note that these logfiles aren't permanent and can be overwritten due to restarts or when a certain filesize is reached.
You could also log failures in your script yourself using the LogHelper | DataMiner Docs. If you use this approach, note that if you e.g. try to trigger an API using a wrong token, you won't be able to log this, as in this case your API script will never be started. For these kind of fails, you will always have to look at the logfiles mentioned earlier.
Hi Wouter,
Thanks for your answer!
Regards.