API product features categories


#1

Hello.

I am trying to get the features tree form the API. It seems I don’t have the top level category (Cloud Intelligence / Categories / Clouds / Infrastructures …). And I can’t find an attribute that could give this information.

Am I missing something ? Is this even possible in the API ?

Thanks


#2

@romaintb,

The ManageIQ REST API can be “walked” similar to any other REST API. The initial entry point (/api) gives you all the currently available/addressable collections. From there, using tools like curl or RESTClient (Firefox browser plugin) to load specific resources within collections will show you the various resource details that you can develop API calls against.

These collections and resources don’t map to the UI hierarchy. However, most resources have a “type” attribute with values like “ManageIQ::Providers::Vmware::InfraManager” to let you know what type of provider you’re looking at.

Hope this helps.


#3

Hello @ptavares_rh,

thank you for the quick answer. However we already parse the API quite heavily (with great success so far), but it seems I am missing some sort of category over features (that I can see in webui but not API).

To be clear : I am trying to get the same tree of features we have when editing a role in the UI, but from the API, and I am missing the top level “category” (Cloud Intelligence …). See attached screenshot.

I hope I am clear enough with my explainations :slightly_smiling:

Thanks a lot for your time.


#4

@romaintb,

It looks like that UI category mapping to first level product features is located outside the db (and API) in app/presenters/menu/default_menu.rb. It looks like you may have to maintain a mapping, matching this file, for whatever API-based coding project you and your team are working on. After this, you should be able to leverage the parent_id’s to build out the rest of the product feature tree structure.

Hope this helps!


#5

OK, thanks, that is exactly the information I needed :slightly_smiling:
Can’t say I am really happy to maintain a mapping on our side, but now I can go forward (plus I can benefit from a custom mapping, so that is ok).

Thanks a lot !