PUT Method error

Posted on

Hi,
We are trying to use the API to manage the product content of our serves.
We successfully download the product content to a file:

curl -X GET -k -u ${USER}:${PASSWORD} https://satellite.example.com/api/hosts/${HOST_ID}/subscriptions/product_content | python -m json.tool > product_content_sample.json

The file looks like this:
[root@satellite]# cat product_content_sample.json
{
"results": [
{
"content": {
"id": "2699",
"label": "rhel-6-server-thirdparty-oracle-java-rpms",
"name": "Red Hat Enterprise Linux 6 Server - Oracle Java (RPMs)"
},
"enabled": false,
"enabled_override": "default",
"product": {
"id": 4,
"name": "Oracle Java for RHEL Server"
}
},
{
"content": {
"id": "3254",
"label": "rhel-7-server-thirdparty-oracle-java-rpms",
"name": "Red Hat Enterprise Linux 7 Server - Oracle Java (RPMs)"
},
"enabled": false,
(content clipped)

But, when we try to use this same file to override the product content, we get the "Value must be 0/1, or 'default'" error:

[root@satellite]# curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X PUT -u ${USER}:${PASSWORD} -k -d @product_content_sample.json https://satellite.example.com/api/hosts/${HOST_ID}/subscriptions/content_override | json_reformat
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9594 0 97 100 9497 253 24844 --:--:-- --:--:-- --:--:-- 24796
{
"displayMessage": "Value must be 0/1, or 'default'",
"errors": [
"Value must be 0/1, or 'default'"
]
}
[root@satellite]#

I was unable to find anything similar in the documentation, the json file needs to be modified in some way maybe?
Regards,

Responses