ona icon indicating copy to clipboard operation
ona copied to clipboard

Wildcard support

Open rouba002 opened this issue 5 years ago • 1 comments

This is more of a feature request.

It would be handy for some cases to support wildcard searches. Using the SQL LIKE syntax ./dcm.pl -r vlan_campus_display campus='%East%'

As I went through the code it looks like adjustments are needed in 'ona/www/include/functions_db.inc.php, function db_get_record' but I am not really good at PHP to get this done, sorry.

rouba002 avatar May 05 '19 18:05 rouba002

In general the system should support % and _ sql constructs.. however many of the dcm options such as this are specifically meant to operate on a single entry. I.e this could possibly return many vlan campus matches but the code does not support that as it is unable to determine the ONE match. There is of course more to it than that but simply put, to do a display like this you would need it to match a single entry.

Now I will mention that I have worked on a true rest api endpoint that would replace the dcm.pl construct and it is able to do what you are talking about. It is not yet fully released however. You can play with it here if you want tho it is not ready for real use: https://github.com/opennetadmin/ona-core

mattpascoe avatar May 13 '19 23:05 mattpascoe