| Summary: | Cannot update puppet class for smart variable via API - 404 error | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Stanislav Tkachenko <stkachen> |
| Component: | Smart Variables | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED WORKSFORME | QA Contact: | Katello QA List <katello-qa-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.2.0 | CC: | orabin, oshtaier, stkachen |
| Target Milestone: | Unspecified | ||
| 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: | 2017-01-15 10:42:59 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
Stanislav Tkachenko
2016-09-14 06:41:43 UTC
The update request should send all data nested under smart_variable.
To change the puppet class the data sent should be:
{
"smart_variable": {
"puppetclass_id": 1
}
}
Does that work for you?
Well, it works but looks like update and create methods are not unified. For example, create sends parameters directly: > Making HTTP POST request to https://sat6.com/api/v2/smart_variables with ... data {"description": "test1", "variable": "abc", "puppetclass_id": 7}. > Received HTTP 201 response: {"description":"test1", ..., "puppetclass_id":7, ..., "variable":"abc","id":447,"override_values_count":0,"override_values":[]} Also other parameters except 'puppet_class_id' can be updated sending directly, e.g. 'description': > Making HTTP PUT request to https://sat6.com/api/v2/smart_variables/447 with ... and data {"description": "test2"}. > Received HTTP 200 response: {"description":"test2", ..., "puppetclass_id":7, ...,"variable":"abc","id":447,"override_values_count":0,"override_values":[]} Though it is also possible to send them nested under smart_variable: > Making HTTP PUT request to https://sat6.com/api/v2/smart_variables/448 with ... and data {"smart_variable": {"description": "test2"}}. > Received HTTP 200 response: {"description":"test2", ...} As for me, either both variants should work correctly (i.e. sending directly and nested) or only one should be available (e.g. sending nested). Everything should work as nested for smart variables, that is also what is documented. Some things might be working directly but that is not supported and should not be used. |