feat: enhance admin api filter#12291
Merged
bzp2010 merged 14 commits intoJun 11, 2025
Merged
Conversation
bzp2010
requested review from
Revolyssup,
SkyeYoung,
juzhiyuan,
kayx23,
membphis and
nic-6443
June 6, 2025 09:10
bzp2010
marked this pull request as ready for review
June 6, 2025 09:10
kayx23
reviewed
Jun 6, 2025
Co-authored-by: Traky Deng <[email protected]>
SkyeYoung
previously approved these changes
Jun 9, 2025
AlinsRan
previously approved these changes
Jun 9, 2025
nic-6443
reviewed
Jun 9, 2025
kayx23
reviewed
Jun 9, 2025
membphis
reviewed
Jun 10, 2025
SkyeYoung
reviewed
Jun 10, 2025
| The following example filters routes using `service_id`. Applying multiple filters simultaneously will return results that match all filter conditions. | ||
|
|
||
| ```shell | ||
| curl 'http://127.0.0.1:9180/apisix/admin/routes?filter=service_id%3D1' \ |
Member
There was a problem hiding this comment.
one question: can we adjust to use the format a[b]=c&a[d]=e? It seems more common. https://www.npmjs.com/package/qs
Contributor
Author
There was a problem hiding this comment.
There is no existing API for parsing query strings for such objects in OpenResty, so it may have to use regular expressions to do so.
I don't want to do that right now. The existing format can be implemented in any language client, it's nothing more than a URI-encoded string.
ngx.log(ngx.ERR, require("cjson").encode(ngx.decode_args("filter%5Bservice_id%5D=a&filter%5Bservice_id%5D=b&b=c&c=c")))[lua] test.lua:1: {"filter[service_id]":["a","b"],"b":"c","c":"c"}
Contributor
Author
This was referenced Jun 10, 2025
SkyeYoung
previously approved these changes
Jun 11, 2025
nic-6443
previously approved these changes
Jun 11, 2025
juzhiyuan
reviewed
Jun 11, 2025
membphis
approved these changes
Jun 11, 2025
kayx23
approved these changes
Jun 11, 2025
SkyeYoung
approved these changes
Jun 11, 2025
nic-6443
approved these changes
Jun 11, 2025
AlinsRan
approved these changes
Jun 11, 2025
laz-xyr
pushed a commit
to laz-xyr/apisix
that referenced
this pull request
Jun 19, 2025
Co-authored-by: Traky Deng <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Added filter enhancements to the Admin API, allowing routes and stream routes to be filtered by
service_idandupstream_id.This is mainly used to enhance the APISIX dashboard.
Checklist