Query to list all Tags

Hello ALL

I search to create querry in order to do list all Tags

Do you know how I do ?

Best Regards

Anthony

What are you trying to do?

I’m in the process of creating a php router management page using the GenieACS API.
I’m looking to create a search box with a select to filter out routers with a specific tag.
I also need to retrieve the complete list of existing tags.

can you help me

Best Regards

Anthony

I don’t believe there is an existing mechanism to get a list of all the tags on devices.

There are two ways you can accomplish your goal. You can query the NBI for all devices, and use a projection to only return the tags, then do some filtering.

This curl command will show you whats possible: curl https://your-ip-or-fqdn:7557/devices?projection=_tags:

...
{"_id":"404A03-VMG4927%2DB50A-S200Z37001282","_tags":["BaseConfig","Managed","HasACLs","IsProvisioned","Provisioned","EnableOnboardWiFi"]},
{"_id":"404A03-EX5510%2DB0-S220Z41014080","_tags":["BaseConfig","HasACLs","Managed","Provisioned","IsProvisioned"]},
{"_id":"404A03-EX3510%2DB1-S223W40007106","_tags":["BaseConfig","Managed","HasACLs","IsProvisioned","Provisioned"]},
...

The other option is to connect to the MongoDB instance and do your querying/distinct/projection using MongoDB.

1 Like

Hello all,
Thank you

Its work

Best Regards

Anthony