Feature #22090
closedAPI Support for easier use of Smart-Class Param Overrides
Description
Similiar to #15003 around using Hammer to remove smart-class param overrides to hosts.
Currently there is a trivial API call to add an override by FQDN for a specific host - this is very useful for us;
-X POST --/api/v2/puppetclasses/:puppetclass_name/smart_class_parameters/:parameter_name/override_values -d '{"match":"fqdn=:hostname","value":":parameter_value}"}}'
e.g
--/api/v2/puppetclasses/apache::vhost/smart_class_parameters/port/override_values -d '{"match":"fqdn=myhost1","value":"4055"}}'
this is really nice and clean way of assigning values to hosts on a single basis, particularly when interfacing with external systems.
However when it comes to changing or removing this override, the calls are more elaborate, as you need to know both the specific numeric ID of the parameter, as well as the numeric ID of the override itself.
e.g
-X PUT --/api/v2/smart_class_parameters/412/override_values/1021 -d '{"override_value":{"match":"fqdn=myhost1","value":"4056"}}' -X DELETE --/api/v2/smart_class_parameters/412/override_values/1021
This means external systems need to cache a list potentially of all override ids, parse and choose the related one.
Hence I would like to be able to edit using the same call as adding an override, or equivalent functionality for delete, eg.
-X PUT --/api/v2/puppetclasses/apache::vhost/smart_class_parameters/port/override_values -d '{"match":"fqdn=host1","value":"4057"}}'
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/5242 added
Updated by Daniel Lobato Garcia over 6 years ago
- Target version set to 1.20.0
- Fixed in Releases 1.20.0 added
Updated by Ori Rabin about 6 years ago
- Related to Bug #26232: Override Values API - request fails if the matcher attribute name has space or dot(.) character added