Bug 1301658

Summary: POST /api/v2/usergroups returns an incomplete set of attributes
Product: Red Hat Satellite Reporter: Andrii Balakhtar <abalakht>
Component: APIAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 6.1.0CC: bkearney, rankumar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-05 14:17:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Andrii Balakhtar 2016-01-25 15:45:09 UTC
Description of problem:
The API returns different information for the following two calls:

* POST /api/v2/media
* GET /api/v2/media/:id

For POST the fields are:
[u'admin', u'created_at', u'id', u'updated_at', u'name']
FOR GET fields are:
[u'usergroups', u'name', u'roles', u'created_at', u'updated_at', u'external_usergroups', u'id', u'users']

So for POST, fields 'usergroups', 'roles', 'external_usergroups' and 'users' are missing.

Version-Release number of selected component (if applicable):
Sat6.1.6C5

How reproducible:
Always

Steps to Reproduce:
1. Create some UserGroup via API and investigate the server responce:
Making HTTP POST request to https://****************************.redhat.com:443/api/v2/usergroups with options {'verify': False, 'auth': ('admin', '********'), 'headers': {'content-type': 'application/json'}} and data {"usergroup": {"user_ids": [54], "role_ids": [23], "name": "testgroup"}}.

Actual results:
Received HTTP 201 response: {"admin":false,"created_at":"2016-01-25T15:22:37Z","id":3,"name":"testgroup","updated_at":"2016-01-25T15:22:37Z"}

Expected results:
Missing fields like 'users', 'roles', 'external_usergroups' and 'usergroups' should be present in server's response.

Additional info:

Comment 1 Andrii Balakhtar 2016-01-25 15:50:05 UTC
Typo in a description:
* POST /api/v2/usergroups
* GET /api/v2/usergroups/:id

Comment 4 Bryan Kearney 2016-07-26 15:25:24 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 5 Bryan Kearney 2016-07-26 15:36:55 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 7 Bryan Kearney 2017-01-05 14:17:44 UTC
Closing it out per comment 3. If this s incorrect, please feel free to re-open with additional data.