Creating Groups via REST API

Setting up new tenants is getting to be a really tedious chore, and I’d love to be able to automate it by setting up as much of the necessary CloudForms bits as possible programatically … like groups & role mappings.

I can find documentation for creating roles, and even tenants, in the REST API docs, but nothing about groups, and when I try some stab-in-the-dark approaches I get knocked back with an error that suggests the POST method is unsupported on the /api/groups collection.

It seems odd that roles can be created but not groups. Is this by design, or am I doing something wrong and just haven’t found the right documentary guidance yet?

I just pulled the latest and it appears groups is in the Rest api.


Unfortunately, since the MIQ EVM was originally engineered before the days of “APIs first” architecture, the APIs that are available are created as needed. I recently had a need for creating roles programmatically and, consequently, submitted a patch and pull request to have this added :slightly_smiling: As for groups, while it appears that the REST API should allow for POSTing new groups, it seems that the underlying implementation is not yet complete (no specific API controller exists to handle the POST operation… thus your error during your creation attempts).

In any case, I may have found my next API to contribute… unless, of course, you’d like to try your hand at it?

Hi Josh

That looks better than what I have at the moment. Is this the nightly build?

Also, I notice there isn’t a “create” action, yet.

Yeah, I’d like to try but I’m still too n00b at this ruby on rails stuff :slight_smile: Getting there …

Users and Group CRUD was merged in early December with PRs and for Darga release, so v2.2.0-pre of API. sorry no doc update yet for those in (v.2.1.0). So with these 2 PRs merge, you now have CRUD on users, groups and roles.