Project

General

Profile

Feature #32650

Add 'resource_type' for the role filter in API

Added by Ondřej Ezr 5 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1957070

Description of problem:

Currently API result for role filter only returns ID. as a FutureFeature, can we add "Name" field along with the ID.

Version-Release number of selected component (if applicable):
Foreman 2.1

How reproducible:
100%

Description:

Currently the roles API only returns the filter ID.

~~~~
  1. curl -vvv -H 'Content-Type: application/json' -X GET https://user:password@foreman.example.com/api/roles/11

{"builtin":0,"cloned_from_id":28,"name":"Group Admin","id":10,"description":"","origin":null,"filters":[{"id":142},{"id":150},{"id":111},{"id":151},{"id":154},{"id":155},{"id":156},{"id":157},{"id":158},{"id":159},{"id":160},{"id":161},{"id":162},{"id":161},{"id":164},{"id":165},{"id":166},{"id":167},{"id":168},{"id":169},{"id":170},{"id":171},{"id":172},{"id":171},{"id":541},{"id":544}],"locations":[{"id":8,"name":"city","title":"Brisbane/City ","description":""}],"organizations":[{"id":1,"name":"abcd","title":"abcd","description":""}]}
~~~~

The filters property within the role resource is expected to be represented in the same structure as locations and organizations.

The id only is not very useful.

Associated revisions

Revision 85ef206e (diff)
Added by Ondřej Ezr 5 months ago

Fixes #32650 - add resource_type to filter base

In API roles/<id> detail there is only list of filter ids, that is not
very useful to user, we should add at least resource type for the user
to at least get the basic idea.

History

#1 Updated by The Foreman Bot 5 months ago

  • Assignee set to Ondřej Ezr
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8553 added

#2 Updated by The Foreman Bot 5 months ago

  • Fixed in Releases 3.0.0 added

#3 Updated by The Foreman Bot 5 months ago

  • Fixed in Releases deleted (3.0.0)

#4 Updated by Ondřej Ezr 5 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Amit Upadhye 3 months ago

  • Target version set to 3.0.0
  • Subject changed from Add 'resource_type' for the role filter in API to Add 'resource_type' for the role filter in API
  • Fixed in Releases 3.0.0 added

#6 Updated by Amit Upadhye 3 months ago

  • Category set to API

Also available in: Atom PDF