- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-12-2018 04:04 AM
Hi,
i want to query Mineneld using the API, in order to get indicators or information about the tool, to automate some reports.
For example, i need to know how many indicatores we have added in the last X days, or last month..., how many indicators are in some feed...
I know that Minemeld has an API, but I have not found documentation about it.
Thanks for your help.
Best regards.
M.
07-23-2018 02:57 AM
Hi @miguel.tubia,
I'm afraid such a documentation for the API does not exist yet. Your best choice as of today is to deep dive into the source code.
For example, the code at /flask/metricsapi.py contains the implementation of the "/metrics" entry point. Just perform a basic auth HTTPS call like the following one I did to get metrics for my node named "dshield_blocklist"
GET /metrics/dshield_blocklist HTTP/1.1 Host: myminemeld:8443 Authorization: Basic YWRtaW46bWluZW1lbGQ=
You'll get a response like:
{ "result": [ { "metric": "length", "values": [ [ 1532251260, null ], [ 1532253120, null ], [ 1532254980, null ], [ 1532256840, null ], ... ] }, { "metric": "update.tx", "values": [ [ 1532253120, null ], [ 1532254980, null ], [ 1532256840, null ], [ 1532258700, null ], ... ] } ] }
It contains samples with a timestamp and a difference from the previous sample.
Another chance (if you feel comfortable with UX development) is to deep dive into the minemeld-webui project and learn how these metrics are polled from the API and shown in the WebUI dashboard.
07-23-2018 02:57 AM
Hi @miguel.tubia,
I'm afraid such a documentation for the API does not exist yet. Your best choice as of today is to deep dive into the source code.
For example, the code at /flask/metricsapi.py contains the implementation of the "/metrics" entry point. Just perform a basic auth HTTPS call like the following one I did to get metrics for my node named "dshield_blocklist"
GET /metrics/dshield_blocklist HTTP/1.1 Host: myminemeld:8443 Authorization: Basic YWRtaW46bWluZW1lbGQ=
You'll get a response like:
{ "result": [ { "metric": "length", "values": [ [ 1532251260, null ], [ 1532253120, null ], [ 1532254980, null ], [ 1532256840, null ], ... ] }, { "metric": "update.tx", "values": [ [ 1532253120, null ], [ 1532254980, null ], [ 1532256840, null ], [ 1532258700, null ], ... ] } ] }
It contains samples with a timestamp and a difference from the previous sample.
Another chance (if you feel comfortable with UX development) is to deep dive into the minemeld-webui project and learn how these metrics are polled from the API and shown in the WebUI dashboard.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!