Bug 1301658 - POST /api/v2/usergroups returns an incomplete set of attributes
Summary: POST /api/v2/usergroups returns an incomplete set of attributes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.1.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-25 15:45 UTC by Andrii Balakhtar
Modified: 2019-09-26 13:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-05 14:17:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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