API's: Do you need more examples?
I am reaching out to you on behalf of our shy developers! A few of them "feel" the API capability of the MSP will be useful for advanced users. And want to know if you (MSP or not) will want more examples of how that works? (This may be an advanced topic for some)
Introduction:
Firewalla MSP is a Managed Security Portal designed for security and infosec professionals to manage multiple Firewalla boxes remotely. As a cloud-based management system, each management portal is an isolated container within the Firewalla Cloud, managed instance data will be fully isolated within this container. (Our developers feel strongly this is also useful to single users)
MSP: https://help.firewalla.com/hc/en-us/articles/4409866753427
API: https://help.firewalla.com/hc/en-us/articles/5345330648083-MSP-API-Getting-Started-
Our developers are thinking of investing in a common GitHub repo, and having that host examples of what the API's can do. They have lots of ideas, but ... they want to know what you want them to do
For example:
-
example of streaming alarms data using the API
-
web hook example of getting alarms
-
get a list of devices ...
What other examples do you want our developers to make?
-
@Brazuc1331 I'm not seeing ts being the api call time. If I query the last say, 10 minutes I get
1662144594.688
1662144594.686
1662144594.685
1662144592.667Alarm list can be filtered already. There are some examples https://help.firewalla.com/hc/en-us/articles/5345330648083-MSP-API-Getting-Started-#filterbytime
-
Thanks, you're right..it's not the API call timestamp, however it's also not the flow timestamp which I imagine is what it should be.
In regards to the alarm list filtering, that's done after the call. I was looking for something to add to the API call to filter on the spot rather than piping to jq to do it.
-
Yup, not a big deal for the API filter. I can do the filtering from the calling app like you mentioned. The TS on the other hand is not the flow's timestamp...that's what I'm trying to say. Converting the epoch TS you'll see that they all are a few seconds from when the API call was executed.
-
@Brazuca1331 So here is what the problem is.
Something like the following will work as expected:
curl --request POST \
--url 'https://woodstock.firewalla.net/v1/flows/query' \
--header 'Authorization: Token [redacted]' \
--header 'Content-Type: application/json' \
--data '{
"start":1662418680,
"end":1662418740,
"limit":200,
"filters": [
{
"key": "device",
"values": [
"BigMac Ethernet 🖥"
]
}
]
}'However, if you leave out the header:
--header 'Content-Type: application/json' \
as I did initially, you will get a result, but it will be wrong. Anytime there is a filter or time range that header must be included. This was a pilot error on my part nothing wrong with the API. Sorry about that.
Please sign in to leave a comment.
Comments
10 comments