API response format for Nexus/MIM API endpoints
-
Hey guys
I was able to figure out how to update the monitor IP of a gateway usingPUTdirected at the/system/gateways/{id}endpoint. It works!The response I get is shaped like this
{ "msg": "Gateway updated", "alrt": false, "sb": false, "alrtoln": false, "alrtclr": "", "auth": false, "status": "", "result": "" }My question is: how do we interpret these keys/values?
I assume
Gateway updatedindicates success. But a boolean is more typical for an API "success" response.Do any of those bools (
sb,alrt,alrtolnetc) mean the op was successful ? -
I peeked in at
pfsense_result.pyon the pfsense-api GitHub repo, which seems to be where the result class is defined. But, it didn't reveal anything further. -
They're mainly there for some GUI compatibility; it may get updated in the future. E.g. the
alrtattributes are meant to be alert outline and color. Go off of whatmsgsays. -
Thanks. If the API is still being worked on, it would be nicer to have a strict
success: true | falsebool for automation vs parsing a text field. -
Any new developments here for API response formats?
I was working with the
/aliasesendpoint today and notice its response has this shape:{ "msg": "alias updated successful", "alrt": false, "sb": false, "alrtoln": false, "alrtclr": "", "auth": false, "status": "", "result": "" }The suggestion to use the
msgto determine success/failure still feels odd to me, especially in light that the wording is not even proper English (should say either "alias update successful" or "alias updated successfully")
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy