PuppetDB version- 5.2
I want to retrieve list of servers with a specific role- tata_umg
The json is in below format:
[
{
"certname":"<hostname>",
"environment":"xxxx",
"name":"xxxx_clientname",
"value":{
"clientabc":{
"xxxx_productname":{
"tata":{
"xxxx_instanceid":"0",
"xxxx_serverrole":[
"tata_umg"
]
}
}
}
}
}]
Can use below 2 get requests to reterive:
curl -X GET '
http://puppetdb.aws.internal:8080/pdb/query/v4/facts/xxxx_clientname'
curl -X GET '
http://puppetdb.aws.internal:8080/pdb/query/v4/facts' --data-urlencode 'query=["=", "name", "xxxx_clientname"]'
But this gives me a json with all server's - 'xxxx_clientname' and not specific to a certain role.
Can anyone please help me update the query to make it work as per my need.