Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1290474 - [RFE] API endpoint to update content view of a host
Summary: [RFE] API endpoint to update content view of a host
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API - Content
Version: 6.1.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-10 15:50 UTC by Sergio G.
Modified: 2019-09-26 13:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-17 14:40:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14625 0 None None None 2016-04-22 16:06:04 UTC

Description Sergio G. 2015-12-10 15:50:05 UTC
Description of problem:
/api/katello/systems endpoint is deprecated according to documentation but can't find any other endpoint to update a host to change it's content view.


Version-Release number of selected component (if applicable):
Red Hat Satellite 6.0.4 / API v2


Additional info:
I've review what hammer does and it is actually using /api/katello/systems endpoint.

Comment 1 Bryan Kearney 2016-04-13 19:43:05 UTC
The /hosts api should support this.. but this did not make 6.2. Adding to 6.3 to get he hammer CLI and hosts api in there. This should back the 


hammer content-host update --content-view-id id  --name name 

command

Comment 2 Bryan Kearney 2016-04-13 19:43:31 UTC
Created redmine issue http://projects.theforeman.org/issues/14625 from this bug

Comment 3 Bryan Kearney 2016-07-08 20:48:43 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 5 Bryan Kearney 2016-08-10 19:11:55 UTC
Upstream bug component is API - Content

Comment 6 Bryan Kearney 2016-08-10 20:12:57 UTC
Upstream bug component is API

Comment 7 Bryan Kearney 2016-08-10 22:12:36 UTC
Upstream bug component is API - Content

Comment 8 Sagar Lutade 2018-07-06 15:47:09 UTC
Hi,

On Satellite 6.3 we can use this API to update the host content view.

# curl -X PUT -k -H 'Content-Type: application/json' -u admin:redhat https://satellite.example.com/api/v2/hosts/1 -d '{"id": 1,"host": {"content_facet_attributes": {"id": 1,"content_view_id": 12}}}'


# curl -k -u admin:redhat https://satellite.example.com/api/v2/hosts/1 | json_reformat | grep -A5 content_facet_attribute


Or the put method if using Rest Client.

URL: https://satellite.example.com/api/hosts/3 

Syntax: {"id": 1,"host": {"content_facet_attributes": {"id": 1,"content_view_id": 12}}}


Where id is the host ID.

Comment 9 Bryan Kearney 2018-07-17 14:40:17 UTC
this exists in 6.3.


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