Actions
Bug #18800
closedcontent_facet_attributes no longer optional on api/hosts
Description
Hi,
I'm having an issue after the update to katello 3.3/foreman 1.14. I've been using a simple json to create testservers via api after upgrading and my json stopped working:
# cat testserver.json
{
"host" : {
"name" : "el7testvmd001",
"location_id" : "2",
"organization_id" : "1",
"compute_resource_id" : "1",
"compute_profile_id" : "1",
"hostgroup_id" : "1",
"build" : true,
"interfaces_attributes" : [ {
"identifier" : "eth0",
"name" : "el7testvmd001",
"managed" : true,
"primary" : true,
"provision" : true,
"subnet_id" : 9,
"domain_id" : 1
}, {
"identifier" : "eth1",
"name" : "el7testvmd001a",
"managed" : true,
"primary" : false,
"provision" : false,
"subnet_id" : 1,
"domain_id" : 1
}, {
"identifier" : "eth2",
"name" : "el7testvmd001s",
"managed" : true,
"primary" : false,
"provision" : false,
"subnet_id" : 6,
"domain_id" : 1
}, {
"identifier" : "eth3",
"name" : "el7testvmd001n",
"managed" : true,
"primary" : false,
"provision" : false,
"subnet_id" : 5,
"domain_id" : 1
} ]
}
}
# curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:password -k --data @testserver.json https://foremanserver.tld/api/hosts
{
"error": {"message":"ActiveModel::ForbiddenAttributesError"}
}
if I add
"content_facet_attributes" : {},
it works as expected again
I'm not sure if this change was on purpose and its a documentation fix or if the code needs to be touched.
Greetings
Klaas
Actions