How to list vmware folders using API

Hello,

I’am struggling to list the vmware folders using the ManageIQ API.

I can use http://miq-server/api/v1/providers/id/folders.

But using this method, I have 2 more challenges :

  • iterate over the full list of folders which is quite long even when using only a few folders. This will not hold when I will have several dozens of folders.

  • find the full path of the folders which is not natively exposed. The folders exposed are only folder names without full path and moreover without any clue on the parent folder.

Is there any native API to get the vmware full paths?

Shall I use a generic_object to expose the informations from Ruby code?

Thx
Regards
Remi

@Remi_Colinet I don’t believe we expose the fully qualified path of a folder, but that seems like a reasonable enhancement.

We have the backend code to generate the path so we can probably expose it via a virtual attribute. My only concern is performance since we’d have to calculate it. Alternately, we should probably add a new column to ems_folders and have the precalculated fully qualified path in there as we have already mentioned in a TODO.

@agrare What do you think?
@Remi_Colinet Can you open an enhancement request at github.com/ManageIQ/manageiq/issues?

Only issue with setting the full path in refresh is we won’t be able to until the full is completed so we’d have to cache all of the folders which we’re trying to get away from.