Actions
Bug #10356
closedPOST and PUT should use RABL templates for the response.
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1216236
Description of problem:
The API returns significantly different information for the following two calls:
- POST /api/v2/locations
- GET /api/v2/locations/:id
This is problematic for two reasons:
- This is inconsistent with how other paths behave, which makes writing client code harder to do.
- Getting authoritative information about a just-created location requires a follow-up API call, which is time-consuming.
Version-Release number of selected component (if applicable):
Tested against Satellite-6.1.0-RHEL-6-20150424.0 and Satellite-6.1.0-RHEL-7-20150424.0.
How reproducible:
100%
Steps to Reproduce:
Here's a sample script:
>>> from nailgun import entities
>>> loc_attrs = entities.Location().create_json()
>>> loc_attrs2 = entities.Location(id=loc_attrs['id']).read_json()
>>> loc_attrs.keys() # contents of response to POST call
[
u'ancestry',
u'apply_info_task_id',
u'created_at',
u'default_info',
u'description',
u'id',
u'ignore_types',
u'katello_default',
u'label',
u'name',
u'title',
u'updated_at',
]
>>> loc_attrs2.keys() # contents of response to GET call
[
u'compute_resources',
u'config_templates',
u'created_at',
u'description',
u'domains',
u'environments',
u'hostgroups',
u'id',
u'media',
u'name',
u'organizations',
u'parameters',
u'select_all_types',
u'smart_proxies',
u'subnets',
u'title',
u'updated_at',
u'users',
]
Actual results:
The actual results are as shown in the above example.
Expected results:
Both POST and GET requests should return the same information.
Additional info:
Actions