Check the current value of a smart class parameter with the API

Hi,

I am trying to update smart class parameters with the api for a given
host. Before I have to check the current value but it does not seem easy.

I can get the list of smart class parameters:
foreman.mydomain/api/hosts/myhost.mydomain/smart_class_parameters but I
only see the default value.
I can have more details with
foreman.mydomain/api/hosts/myhost.mydomain/smart_class_parameters/my_parameter
but I still can't see the override value for my host. But I can list
override values for this smart class parameter. I can check each rules,
but it is not convenient.

There is an open bug which seems to be linked to my problem, but it is
an old one Feature #3759: smart class parameter controller is missing call for manipulation with override values - Foreman

Does anyone can help me with this ?

Another way is to update without the check, but I would prefer check before.

··· -- Elodie Bertoncello

Hello,

I also tried to get the smart class parameter value for my host with
hammer, but it only displays the default value. Hammer seems to be based
on the API (v2) and I think if it is not implemented yet in hammer it is
because it is difficult to have this information using the API. I think
the API should directly give this information.

Regards,

Elodie Bertoncello

··· On 21/01/2015 16:15, Elodie Bertoncello wrote: > Hi, > > I am trying to update smart class parameters with the api for a given > host. Before I have to check the current value but it does not seem easy. > > I can get the list of smart class parameters: > foreman.mydomain/api/hosts/myhost.mydomain/smart_class_parameters but > I only see the default value. > I can have more details with > foreman.mydomain/api/hosts/myhost.mydomain/smart_class_parameters/my_parameter > but I still can't see the override value for my host. But I can list > override values for this smart class parameter. I can check each > rules, but it is not convenient. > > There is an open bug which seems to be linked to my problem, but it is > an old one http://projects.theforeman.org/issues/3759 > > Does anyone can help me with this ? > > Another way is to update without the check, but I would prefer check > before. >