Bug 1537491

Summary: While updating a host's facet through API facet id is required to be passed. Ideally and according to the documentation it should not be required.
Product: Red Hat Satellite Reporter: Suraj Patil <supatil>
Component: APIAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.12CC: akarsale, bkearney, kmcdowell, mhulan, supatil, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 07:05:22 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 Suraj Patil 2018-01-23 11:01:56 UTC
Description of problem:

Updating a host's subscription facets(katello_subscription_facets) compulsorily requires the facet id to be included in facet params.

How reproducible:

--> Below API call returns successful but does not update the content. The same is mentioned in the API documentation too.

#curl -X PUT https://satellite.lab.example.com/api/v2/hosts/10 -k -s -u admin:changeme -H 'Content-Type: application/json' -d '{"id":10,"host": {"subscription_facet_attributes": {"service_level":"Self-Support"}}}'

-->But after passing facets id in facet params the content does get updated.

#curl -X PUT https://satellite.lab.example.com/api/v2/hosts/10 -k -s -u admin:changeme -H 'Content-Type: application/json' -d '{"id":10,"host": {"subscription_facet_attributes": {"id":9,"service_level":"Self-Support"}}}'


There was a bugzilla #1312107 created previously and has the current status "Status: RELEASE_PENDING → CLOSED" in 6.2.0
The version on which this has been observed is 6.2.12

Comment 1 Amit Karsale 2018-01-23 12:37:54 UTC
Hello Suraj,

Its a glitch in the documentation, Ideally the ID is required to update the facet.

need to update the documentation.

Comment 2 Kenneth McDowell II 2018-01-23 15:55:17 UTC
Amit,

That seems to be the opposite of the expected behavior due to bugzilla #1312107.

Comment 4 Marek Hulan 2018-03-20 19:54:04 UTC
Are you still able to reproduce with last 6.2 or 6.3 release? This should have been already resolved.

Comment 5 Suraj Patil 2018-03-21 11:53:46 UTC
I have tested this on satellite 6.3 not able to reproduce it again. 
I guess this has been resolved.

Comment 6 Amit Karsale 2018-05-29 07:05:22 UTC
based on Suraj's comment closing the BZ. If reproduced feel free to reopen.