On 11/10/20 2:40 PM, Pravin V wrote:
> Thank you, Dick.
> 
> Here's the issue, I'm trying to automate device adding using Rest API, it 
> will accept the command as below -
> url:
> http://5.5.5.5/api/json/ncmsettings/assocCredential?apiKey=xx6689kk&RESOURCEID_LIST=4204&SSH_PROFILELIST=ABC&protocolCombinationList=SSH
> 
> Whereas in current situation it is automatically putting the value in the 
> bracket as below -
> url: http://5.5.5.5/api/json/ncmsettings/assocCredential?apiKey=
> xx6689kk 
> &RESOURCEID_LIST=[4204]&SSH_PROFILELIST=ABC&protocolCombinationList=SSH
> This way it is not working.
> 
> Please suggest what can we do in this situation.

If it is always a single value use the first element of the list:

RESOURCEID_LIST={{ resourceID.json.resourceIds[0] }}

Regards
       Racke

>
> 
> On Tuesday, 10 November 2020 at 19:03:21 UTC+5:30 [email protected] wrote:
> 
>     Brackets is the correct way to display lists variables, which your 
> variable apparently is.
> 
> 
> 
>     On Tue, 10 Nov 2020 at 14:14, Pravin V <[email protected]> wrote:
> 
>         Hello Everyone,
>         Below is the output of the task
>         json:
>               resourceIds:
>               - 66523
> 
>         and I'm trying to fetch the resourceIDs into the task like below.
>         RESOURCEID_LIST={{ resourceID.json.resourceIds }}
> 
>         But the issue is when I'm running the playbook, it is automatically 
> putting the value in bracket []
>         &RESOURCEID_LIST=[66523].
> 
>         How can we input the value without putting in the bracket.
> 
>         Thanks in advance.
> 
>         -- 
>         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].
>         To view this discussion on the web visit
>         
> https://groups.google.com/d/msgid/ansible-project/42cc9fff-b3fe-4584-bb0f-bdd580647822n%40googlegroups.com
>         
> <https://groups.google.com/d/msgid/ansible-project/42cc9fff-b3fe-4584-bb0f-bdd580647822n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
>     -- 
>     Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a0b92b62-6e44-497e-86d1-0427fb2d1316n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a0b92b62-6e44-497e-86d1-0427fb2d1316n%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5b75ccf4-6fe7-45ef-6f2d-fe3ad2511951%40linuxia.de.

Attachment: OpenPGP_0x5B93015BFA2720F8.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to