Bug 1290474

Summary: [RFE] API endpoint to update content view of a host
Product: Red Hat Satellite Reporter: Sergio G. <sgarciam>
Component: API - ContentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.4CC: bkearney, slutade
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14625
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-17 14:40:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.