Hi there,
I'm trying to filter services using the "tag" field in a List call, but I'm encountering a 400 error. The response from a List call indicates that "tag" is a filterable field.
I've tried the following syntax:
{{MgmtUrl}}/services?filter=tag = "device"
However, filtering by "name" or "createdAt" works as expected:
{{MgmtUrl}}/services?filter=name = "ayush-test2"
Can someone please confirm if the syntax for filtering by "tag" is correct?
Hi @ayushhsinghh, welcome to the community and to OpenZiti!
You're looking for:
ziti edge list services 'tags.tagNameHere= "tagValueHere"'
or
/edge/management/v1/services?filter=tags.tagNameHere+%3D+%22tagValueHere%22
Cheers
1 Like
Thanks @TheLumberjack,
Is there any documentation on how to use filters for other filterable fields? Or can you provide the general syntax for applying filters?
I don't believe there's any comprehensive doc for it yet, no. I may just not know it's there though...
Generally speaking you can apply filters like:
ziti edge list identity 'name = "name"'
ziti edge list identity 'name contains "name"'
ziti edge list identity 'name not contains "name"'
ziti edge list identities 'anyOf(roleAttributes) = "client"'
ziti edge list identities 'isEmpty(roleAttributes)'
ziti edge list identities 'count(roleAttributes)=2'
ziti edge list identities 'anyOf(roleAttributes) contains "sdk"'
ziti edge list identities 'allOf(roleAttributes) contains "s"'
Hope that helps ?
1 Like
There's also some relevant doc here: Shared API Capabilities | OpenZiti
1 Like