Filtering UAPI Responses
Working on the command line, I am using the following:
For *any* user I test against, regardless of their suspension status (0/1), I get a complete JSON response. Suspended is a numeric bool so I believe to be using the proper term and type? I just want to know if the user I pass is suspended or not. Reference Docs (could use some examples):
uapi --output=jsonpretty --user=$user Variables get_user_information api.filter=1 api.filter_column=suspended api.filter_term=1 api.filter_type=eq
For *any* user I test against, regardless of their suspension status (0/1), I get a complete JSON response. Suspended is a numeric bool so I believe to be using the proper term and type? I just want to know if the user I pass is suspended or not. Reference Docs (could use some examples):
-
Rex, That certainly works, however, any reason why filtering wouldn't be working on UAPI? 0 -
I'll do some testing with this and let you know! 0 -
At this point, I'm not able to get it working on my end either. I've reached out to the development team although I haven't heard back just yet. Once I have an update I'll be sure to let you know. 0 -
I heard back from the developers and they let me know the following information: "The filtering functionality requires an API output that lists multiple sets of data. That is not the case for Variables::get_user_information. These two options work for filtering if you want to see that in action: whmapi1 listaccts api.filter.enable=1 api.filter.a.field=suspended api.filter.a.arg0=1 api.filter.a.type=eq whmapi1 listaccts api.columns.enable=1 api.columns.a=user api.columns.b=suspended" Does that help to clear things up? 0
Please sign in to leave a comment.
Comments
5 comments