Create a GROUP with a ROLE assigned via REST API


#1

Hi,

I am able to create a group but i cannot create it with a role assigned.
I can create roles, in another program.

On this one, i check for the role to exists before, and if the group does not exists, i try to create it.

My script output:

INFO: Role “1000000000018” exists.
INFO: Group name “bbbd” will be created.

ERROR: bad_request [ApiController::BadRequestError]
ERROR: Missing Role identifier href, id or name

{u’error’: {u’kind’: u’bad_request’,
u’klass’: u’ApiController::BadRequestError’,
u’message’: u’Missing Role identifier href, id or name’}}

{‘action’: ‘create’,
‘resource’: {‘description’: ‘bbbd’, ‘role’: ‘1000000000018’}}

In this case, the role does exists and the group does not.
If i remove the ‘role’ from the json, it does work. (but i want to assign a role).

Cheers.


#2

Hi,

I noticed that i can create the group with a role assigned, but only when using ‘href’ or ‘name’ as the identifier.
Use of the identifier ‘id’ for specifying roles seems broken.

So i opened a BZ for that.

https://bugzilla.redhat.com/show_bug.cgi?id=1394207