Try:

curl -vv -G -H "Accept: application/json"
'http://localhost:8080/v2/commands' --data-urlencode
'payload={"command":"deactivate node","version":
1,"payload":"\"yournodename\""}'

The command needs to be submitted with the form parameter 'payload'.
The 'payload' part of the command is itself a JSON serialised string
(hence the extra quotes and escaping).

ken.

On Wed, Mar 27, 2013 at 6:46 AM, Alexander Grushin <[email protected]> wrote:
> Hello, all
>
> I'm trying to use puppetdb's deactivate api call but can't find how to
> correctly pass node name via payload.
>
> Calls like
> `curl -G -H "Accept: application/json" 'http://localhost:8080/v2/commands'
> --data-urlencode '{ "command": "deactivate node", "version": 1, "payload": {
> "name": "nodename.domain.tld" } }'`
> returns 'missing payload' error.
>
> Perhaps, key name is wrong, but in the documentation there are just 'JSON
> string', without any key names.
> http://docs.puppetlabs.com/puppetdb/1.1/api/commands.html#deactivate-node-version-1
>
> Could anybody give the real example how to use this call?
>
> Thanks!
>
> ---
> Alexander Grushin
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to