| Summary: | API: operatingsystems_ids options for architectures in PUT/POST does not work at all | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Roman Plevka <rplevka> |
| Component: | API | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED NOTABUG | QA Contact: | Roman Plevka <rplevka> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.3.0 | CC: | bbuckingham, jcallaha, mhulan, rplevka |
| Target Milestone: | Unspecified | Keywords: | Regression, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-30 10:14:30 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: | |
|
Description
Roman Plevka
2016-11-25 12:55:51 UTC
This seems to be a regression since as this works on the recent 6.2 I don't think this is a correct way of doing such call. Could you please let me know where you found it? This seems to work fine
curl -X PUT -H 'content-type: application/json' -d '{"architecture": {"operatingsystem_ids": [1], "name": "i386"}}' https://admin:changeme@sat63.example.tst/api/v2/architectures/2
In Satellite 6.2 API documentation I see example with architectures using wrapped attributes. Also 6.2 live documentation at /apidoc/v2/architectures.html shows the wrapped variant.
You're right it worked in 6.2 and no longer works in 6.3. It seems that there might be some issue with automatic wrapping which was the layer that should unify Katello and Foreman differences. The right solution would be unifying both APIs and introducing new version of API for that.
Thanks Marek, It only accepts the hash now. I've filed this BZ based on our automation results, which does not use the wrapping, so it looks like it relies on it. Could you investigate on the automatic wrapping? If it is by design, I would update our automation. thanks I'm unable to find what changed this behavior, my guess would be something with strong params. Anyway I don't think we want to support this way. The example I provided in comment 3 should be used. There's an alternative to specify array of identifiers, e.g. curl -X PUT -H 'content-type: application/json' -d '{"operatingsystems": [{"name": "CentOS 6.7"}, {"id": 1}], "name": "i386"}' https://admin:changeme@sat63.example.tst/api/v2/architectures/2 but note that the key must be plural form of the resource (operatingsystems), not operatingsystem_ids. Both and id would work. Still, I'd recommend testing the documented way. I think we can close this BZ. @mhulan, thanks for the explanation. based on the further discussion on irc i'm closing this and removing the test from our automation as no longer supported |