List uuid with curl based on a fact.

Latest response

Hi,

so what I`m trying to do is get the uuid of all hosts that have a particular hostname.

curl  -u user:pass -k "https://subscription.rhn.redhat.com/subscription/consumers?owner=3614426&fact=uname.nodename:testhost"

but I get {"displayMessage":"Insufficient permissions","requestUuid":"c2bffd6f-f4be-4bde-ad20-8e9bb5759a1e"}

Does anybody know what exactly I`m doing wrong. I have been reading this http://www.candlepinproject.org/docs/candlepin/consumer_fact_lookup.html .

Responses

Did this ever get answered? I'm trying to do something very similar and getting the same result.... However, if I use /consumers/, it does return the JSON object. It's making me wonder if that part of the API is avaiable / implemented (not sure why it wouldn't be, but hey...)

you could get them like this: https://subscription.rhn.redhat.com/subscription/owners/[owner key]/consumers?fact=uname.nodename:[hostname] http://www.candlepinproject.org/swagger/?url=candlepin/swagger-2.0.13.json#!/owners/listConsumers

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.