I haven't coded this sort of thing but I know of one example. We use a module where I work to configure our Opsview monitoring software. It sends requests to the Opsview REST API, parses the responses, and sends more requests to update anything that needs it.
If you want to look at it: https://forge.puppetlabs.com/cparedes/puppet_opsview Rich On Thu, Nov 14, 2013 at 1:06 AM, ulrich igor ngouagna kouete < igor.ngoua...@gmail.com> wrote: > Hi, > thanks for reacting. > > To describe more what I want to do: > > I have a web API and I want to make some REST requests to it, and verify > the response satus or body to make sure the request succeeded. With "curl" > it gives this: > > exec{"add a cluster ${clusterName}": > command => "curl -u > ${$::clouderapuppet::cm::server::params::cmUsername}:${$::clouderapuppet::cm::server::params::cmUsername} > -X POST -H \"Content-Type:application/json\" ' > http://localhost:7180/api/v4/clusters' -d > '{\"items\":[{\"name\":\"${clusterName}\", > \"version\":\"${clusterVersion}\"}]}'" > } > > See how it is long and annoying? (hahah ;) ). And imagine I have to POST a > huge JSON doc, the code will be unreadable! > > Do you tell me I can do that with hiera or generate() function? > > I'll explore those paths now, but feel free to continue the discussion :) > > thanks a lot. > > Le mercredi 13 novembre 2013 17:03:35 UTC+1, ulrich igor ngouagna kouete a > écrit : > >> Hi, >> >> I'm looking for a resource / type that will allow me to issue web >> requests from a manifest file. I've heard about the web_request module , >> but seems quite dificult to use (in fact I do not succeed in issuing a POST >> request with a JSON body doc). >> >> Any ideas about that? >> >> Thanks. >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/a09bca0f-6b45-4875-bed4-bb8c4d3fd293%40googlegroups.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAPGcbtBsnJ4922LnR4SXkzG6iezxf5yMYfnLJCQy_nJ4uyu9dg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.