On Wed, Nov 20, 2013 at 2:24 PM, PePe Amengual <[email protected]>wrote:

> I'm basically having the same issue I need to get  from this :
>
> {
>    "httpStatus" : 201,
>    "detail" : "Request accepted.",
>    "estimatedSeconds" : 420,
>    "purgeId" : "95b5a092-043f-4af0-843f-aaf0043faaf0",
>    "progressUri" : "/ccu/v2/purges/95b5a092-043f-4af0-843f-aaf0043faaf0",
>    "pingAfterSeconds" : 420,
>    "supportId" : "17PY1321286429616716-211907680",
> }
>
> the pingAfterSeconds to use it in a wait_for task and the purgeid but this
> is a JSON so dunno if the process is similar to a string parsing?
>


If the web service returns a Content-type header set as "application/json"
and the response you get is valid json then the uri module will parse the
JSON and make it available via the key.

See https://github.com/ansible/ansible/pull/2119 for more details.

So you should be able to do something like {{
register_var.content.pingAfterSeconds }} to get the value. (Not tested, but
you get the idea.)

Once you get it, it would be good to send a pull request better documenting
this :)


-- 
Romeo

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to