#You may use json query to parse json
1 messages · Page 1 of 1 (latest)
I think I need an example, I don't understand it.. 😕
Do you have something you can share with me?
- name: Collect SVM volumes
netapp.ontap.na_ontap_rest_info:
<<: login
use_rest: Always
fields:
- ''
gather_subset:
- storage/volumes
parameters:
svm.name: "vs_{{ target }}"
register: ontap_info_tmp
tags:
- snaplist
This collects volumes in var ontap_info_tmp to apply json query on.
And then:
- name: Create list of SVM volume
set_fact:
ontap_info_vol: "{{ ontap_info_tmp['ontap_info']['storage/volumes']['records'] | json_query(query) }}"
vars:
query: "[*].name"
tags:
- snaplist
This build the list of volumes extracted with some json_query "[*].name"
Ooh ok, thanks a lot!