#First time here Having trouble figuring
1 messages · Page 1 of 1 (latest)
We have two modules, na_ontap_rest_cli, and na_ontap_restit. For na_ontap_rest_cli, you would need to follow the rules documented under Using the private CLI passthrough with the ONTAP REST API in the REST API documentation. I believe the command should be snapmirror/update-ls-set, and the path in params.
When using na_ontap_restit, we are calling the API directly. But it presents no value with private/cli as the previous module does it already.
I've tried a number of different things. The only thing I have accomplished so far is to change the error. Anything with 'snapmirror/update-ls-set' fails with error 3, no API. Tried underscores, nope. If I remove '/update-ls-set' from the command and make that the first arg in params I get unexpected argument. I have been able to make the examples in the Ansible-doc page work. I don't understand the syntax for params, body or even command.
Here is a working task using the na_ontap_restit module.
name: Update LS mirror
netapp.ontap.na_ontap_restit:
hostname: "{{ cluster }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: false
use_rest: always
method: "POST"
api: private/cli/snapmirror/update-ls-set
body:
source_path: "{{ source_path }}"
register: std
Do you have any library of tested examples? Could something like that be created? For those of us that are doing Ansible automation on the side, it would save hours of time! Thanks for pointing me to restit. Any idea whether the na_ontap_rest_cli module will work?
One last item, it was using the OPTIONS API method that indicated I needed to use POST instead of PATCH.
Yes, private/cli is a pain. It's always trial and error. The general rules is that parameters that help identify the resource are going into params, while what you want to set or update goes into body. So maybe update-ls-set goes into the body and you would have to convert - to _. There are some examples in the REST documentation, but questions about private/cli should be addressed in #┊・ontap-api . Our team focuses on the Ansible modules.