Project

General

Profile

Feature #2931

API v2 hosts JSON response, add *_name for each *_id

Added by Joseph Magen almost 10 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Currently

host": {
"name": "fdev2.sat.lab.tlv.redhat.com",
"id": 394,
"ip": "10.35.27.3",
"operatingsystem_id": 42,
"environment_id": 1,

Wanted

host": {
"name": "fdev2.sat.lab.tlv.redhat.com",
"id": 394,
"ip": "10.35.27.3",
"operatingsystem_id": 42,
"operatingsystem_name": "Centos 6.3",
"environment_id": 1,
"environment_name": "Production",


Related issues

Related to Foreman - Feature #2945: Extend AR to add getter/setter methods *_names similar to *_idsClosed2013-08-18
Has duplicate Foreman - Bug #3098: _name for _id of associated resources are missing in API (rabl)Duplicate2013-09-16

Associated revisions

Revision 636e9830 (diff)
Added by Joseph Magen over 9 years ago

fixes #2931 - API v2 hosts JSON response, add *_name for each *_id

History

#1 Updated by Tomáš Strachota almost 10 years ago

The same for *_ids -> *_names, please

#2 Updated by Joseph Magen almost 10 years ago

https://github.com/theforeman/foreman/pull/844

Default is *_name for all *_id fields. I would like to make this flexible for performance reasons if a user just wants fields=id,name

#3 Updated by Dominic Cleal almost 10 years ago

  • Status changed from Assigned to Ready For Testing
  • Target version set to 1.3.0

#4 Updated by Dominic Cleal almost 10 years ago

  • Status changed from Ready For Testing to Assigned

The PR's been closed, but I think this is still needed, right?

#5 Updated by Dominic Cleal almost 10 years ago

  • Related to Feature #2945: Extend AR to add getter/setter methods *_names similar to *_ids added

#6 Updated by Joseph Magen almost 10 years ago

Yes, PR to provide this functionality is merged, but the JSON rabl views have not been updated, so keep this issue open.

#7 Updated by Lukas Zapletal over 9 years ago

  • Target version changed from 1.3.0 to 1.4.0

#8 Updated by Greg Sutcliffe over 9 years ago

  • Target version deleted (1.4.0)

#9 Updated by Joseph Magen over 9 years ago

  • Target version set to 1.15.0

#11 Updated by Joseph Magen over 9 years ago

  • Status changed from Assigned to Ready For Testing

#12 Updated by Dominic Cleal over 9 years ago

  • Target version changed from 1.15.0 to 1.10.0

#13 Updated by Dominic Cleal over 9 years ago

  • Legacy Backlogs Release (now unused) set to 2

#14 Updated by Anonymous over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#15 Updated by Dominic Cleal over 9 years ago

  • Has duplicate Bug #3098: _name for _id of associated resources are missing in API (rabl) added

Also available in: Atom PDF