Bug 882710

Summary: [RESTAPI] Add group doesn't work.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ondra Machacek <omachace>
Component: ovirt-engine-restapiAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Ondra Machacek <omachace>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, ecohen, iheim, mkenneth, mpastern, oramraz, Rhev-m-bugs, sgrinber, ykaul, yzaslavs
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: SF3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 915537    

Description Ondra Machacek 2012-12-02 20:28:09 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Try add group via API.
  
Actual results:
status: 404
reason: Not Found
detail: HTTP Status 404

Expected results:
Group is added.

Additional info:
API:
POST /api/groups <group><name>domain.com/Users/Group</name></group>

SDK:
g = API.groups.get('Everyone')
API.groups.add(g)

Comment 1 Ravi Nori 2012-12-04 08:38:25 UTC
Works for me when I add a group that exists in the active directory

curl -X POST -d @14_addGroup.xml -u vdcadmin.tlv.redhat.com:123456 -H "Accept: application/xml" -H "Content-Type: application/xml" http://127.0.0.1:8700/api/groups

Where the contents of the file 14_addGroup.xml is
<group><name>qa.lab.tlv.redhat.com/Users/HelpServicesGroup</name></group>




When I add a group that does not exist, the api throws a 404 error. This is the intended behaviour.

curl -X POST -d @14_addGroup2.xml -u vdcadmin.tlv.redhat.com:123456 -H "Accept: application/xml" -H "Content-Type: application/xml" http://127.0.0.1:8700/api/groups

Where the contents of the file 14_addGroup2.xml is
<group><name>qa.lab.tlv.redhat.com/Users/DoesNotExist</name></group>

Comment 2 Ondra Machacek 2012-12-04 09:09:30 UTC
Yes thats true, but also don't work when I try to add group that exists in AD, when user is admin@internal, so when the user is in different AD.

When try to add group as a user in same AD, it works.

Comment 3 Michael Pasternak 2012-12-04 09:20:24 UTC
(In reply to comment #2)
> Yes thats true, but also don't work when I try to add group that exists in
> AD, when user is admin@internal, so when the user is in different AD.
> 
> When try to add group as a user in same AD, it works.

not sure this is a bug cause you did not authenticated to this AD...,

Miki?

Comment 4 Yaniv Kaul 2012-12-04 09:31:43 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Yes thats true, but also don't work when I try to add group that exists in
> > AD, when user is admin@internal, so when the user is in different AD.
> > 
> > When try to add group as a user in same AD, it works.
> 
> not sure this is a bug cause you did not authenticated to this AD...,

RHEV is supposed to do it, using the credentials stored when that domain was added.

> 
> Miki?

Comment 5 Ravi Nori 2012-12-04 11:35:34 UTC
link : http://gerrit.ovirt.org/#/c/9692/

change id : I20927d4732af6a22702c65c0f32f072039cb82e9

This patch lets us add groups from any domain irrespective of credentials used.

Also lets us add groups by id.

Comment 7 Ravi Nori 2012-12-05 09:13:11 UTC
Hash : 869505920388827dbf3af148f4a5d048cad52f35

Comment 10 Itamar Heim 2013-06-11 09:30:45 UTC
3.2 has been released

Comment 11 Itamar Heim 2013-06-11 09:32:32 UTC
3.2 has been released

Comment 12 Itamar Heim 2013-06-11 09:48:24 UTC
3.2 has been released