Ask Your Question

pass parameters to puppet api's not from curl

asked 2016-04-05 01:08:55 -0600

hKothuri gravatar image

updated 2016-04-05 08:45:37 -0600

Hi, I'm new to puppet and couldn't find from docs that how to pass parameters to api from any http client and not from curl.

Example:- I can get all the nodes information with URL http://puppet-master:8080/pdb/query/v4/nodes/ from browser itself.

Now i want to get the specific node information by certname like http://puppet-master:8080/pdb/query/v4/nodes/certname='name'


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-04-05 10:21:32 -0600

hKothuri gravatar image

updated 2016-04-05 10:27:23 -0600

http://puppet-master:8080/pdb/query/v4/nodes/ is giving the response.

edit flag offensive delete link more


Great that also works if you just need one node. :)

Alex Harvey gravatar imageAlex Harvey ( 2016-04-05 10:36:30 -0600 )edit

answered 2016-04-05 08:52:26 -0600

updated 2016-04-06 00:34:39 -0600

It should be something like:

curl -G 'http://puppet-master:8081/pdb/query/v4/nodes' --data-urlencode 'query=["=", "certname", ""]'

From the documentation.

It's not possible to pass complex queries in the URL; the HTTP POST method must be used, and the query string is sent in the data; whereas that query string that appears at the end of the URL is a feature of HTTP GET requests. See here for more info.

Doing this programmatically is not hard, and well documented. Just look up "http post" for whichever language you're using.

edit flag offensive delete link more


Hi Alex, I am aware of parameter(s) usage from curl. But my question is how to pass parameters in the uri itself Ex: http://puppet-master:8080/pdb/query/v4/nodes/certname="" This way, i can integrate with other applications and get the required information. Thanks

hKothuri gravatar imagehKothuri ( 2016-04-05 10:08:50 -0600 )edit

Sorry, I missed the bit "not from curl". I'll update my answer.

Alex Harvey gravatar imageAlex Harvey ( 2016-04-05 10:26:35 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-05 01:08:55 -0600

Seen: 115 times

Last updated: Apr 06 '16