#na ontap rest info module query parameters

1 messages · Page 1 of 1 (latest)

hybrid cloud
#

Hi,

I am struggling to find documentation on how to format my Ansible task to limit the output of gather-subset
protocols/nfs/connected-clients subset to only one volume.

I tried with owning resource - volume_name, with parameter volume_name, with query volume_name but none of the limited the output or failed because of bad parameter.

I have Ansible 2.10.5, netapp.ontap 21.20.0, python 3.6.8.

Any advice?
Thanks

spare ether
#

Hi @hybrid cloud ,
when using na_ontap_rest_info (please avoid using na_ontap_info), you can simply check the REST API documentation - on box (https://<cluster_name/ip>/docs/api) or an offline copy on DevNet:
https://devnet.netapp.com/restapi.php
https://library.netapp.com/ecmdocs/ECMLP2885799/html/index.html#/NAS/nfs_clients_get
Then you can use "parameters" parameter to query for a particular volume ("volume.name" in this case). Try something like this:

- name: Get connected NFS clients for volume netapp.ontap.na_ontap_rest_info: gather_subset: - "protocols/nfs/connected-clients" parameters: volume: name: "<put in vol name here>" use_python_keys: true <<: *input # hostname, user, password aso... register: ontap_nfs_clients

hybrid cloud
#

Oh, ok, so volume.name becomes 2 levels... Volume: name: ...
That is described nowhere, would be good to put an example like this in the documentation...
Thanks, will try.

hybrid cloud
#

Got it, I had to write
parameters:
volume.name: "volname"
svm.name: "svmname"

And then it worked.

spare ether
#

Perfect 🙂

hybrid cloud
#

thanks @spare ether

dim zephyr