Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Sumo Logic, how do I get a list of folders off the root folder?

Tags:

sumologic

Using the Sumo Logic API, /api/v2/content/folders/{id} works and gives me the parentId. hitting the same endpoint for a folder off the root folder gives a parentId. however hitting the same endpoint with that id errors with "Content with the given ID does not exist."

When I hit /api/v2/folders/global it returns an id. every time I hit the endpoint it gives me a different id. trying to use any of those ids at /api/v2/content/folders/{id} also gives the error "Content with the given ID does not exist."

I'm trying to write a script that will return the Sumo Logic ID of a folder from a user-defined path. e.g. get_sumo_id -p "/products/someapp/monitoring"

like image 704
aquaone Avatar asked Sep 03 '25 15:09

aquaone


1 Answers

Figured it out. I hadn’t read the docs well enough. The id returned from /api/v2/folders/global is a job id, not a folder id. You wait until it's done and check for success using /api/v2/folders/global/<job id>/status. if successful you can retrieve /api/v2/folders/global/<job id>/result.

like image 192
aquaone Avatar answered Sep 05 '25 16:09

aquaone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!