Bug 1301658 - POST /api/v2/usergroups returns an incomplete set of attributes
POST /api/v2/usergroups returns an incomplete set of attributes
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API (Show other bugs)
x86_64 Linux
low Severity low (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2016-01-25 10:45 EST by Andrii Balakhtar
Modified: 2017-01-05 09:17 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-01-05 09:17:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrii Balakhtar 2016-01-25 10:45:09 EST
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):

How reproducible:

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 10:50:05 EST
Typo in a description:
* POST /api/v2/usergroups
* GET /api/v2/usergroups/:id
Comment 4 Bryan Kearney 2016-07-26 11:25:24 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 5 Bryan Kearney 2016-07-26 11:36:55 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 7 Bryan Kearney 2017-01-05 09:17:44 EST
Closing it out per comment 3. If this s incorrect, please feel free to re-open with additional data.

Note You need to log in before you can comment on or make changes to this bug.