unit icon indicating copy to clipboard operation
unit copied to clipboard

Unit: Filter / Search applications by name

Open smtalk opened this issue 5 years ago • 5 comments

Hello,

I was unable to find a way to request a response with a specific application match. For example, I'd like to know all the applications that start with domain.com_.

I cannot do something like: curl --unix-socket /path/to/control.unit.sock http://localhost/config/applications/domain.com_%

I guess it's not possible yet?

Only 'applications' names list as an array might also be fine, if that's possible. We'd parse it in our control panel then.

Thank you!

smtalk avatar Mar 20 '20 21:03 smtalk

You can use jq for any JSON transformations: https://stedolan.github.io/jq/

VBart avatar Mar 21 '20 18:03 VBart

@VBart we use parsing directly in C. The question is if it’s possible to get just the elements we need, as it’d be way faster, than listing thousands of json objects and then filtering the ones needed. I think there is no way to so this currently. Are there any plans for this?

smtalk avatar Mar 21 '20 19:03 smtalk

@VBart we use parsing directly in C. The question is if it’s possible to get just the elements we need, as it’d be way faster, than listing thousands of json objects and then filtering the ones needed. I think there is no way to so this currently. Are there any plans for this?

I agree, that it's something nice to have. There are many ways how we can make configuration API more friendly, but it's not our top priority right now as Unit lacks many essential functionality related to applications, static files serving and proxying. So, I can't name any ETA for this feature to appear.

VBart avatar Mar 23 '20 10:03 VBart

Sure! I totally agree on this :) just have the issue open for the future versions.

Thank you!

smtalk avatar Mar 23 '20 16:03 smtalk

Hi @smtalk I know it is a while since the last update of this issue but a quick question from my side. Would it be possible for you to run an application in any language we support on Unit doing the filtering for you? We are working on this style of features adding to Unit in a more "plug-iny" way. Let me know your thoughts.

tippexs avatar Sep 20 '22 10:09 tippexs