We're new to using Calm for automation/orchestration and I'm looking to get additional information/guidance on how we can leverage the Nutanix REST APIs during our virtual workload PreCreate/PostDelete tasks. I under how to work with the HTTP Task itself, but I'm not quite sure how to chain them together in such a way that it would work. They function as I would want individually, via the Test functionality for each HTTP Task.The first three cases we're trying to get to work to get our feet wet include:
-
During Package Install, leverage Prism Central REST APIv3 vms to GET the complete spec of the newly created VM; modify that Response to update the Description; and set (PUT) the updated Spec with the modified Description as desired.
-
During Package Install, graceful shutdown of the new virtual workload and removal of the second CD-ROM drive that is added (ide.3) to hold the 'unattend.xml' file.
-
During Package Install, leverage Prism Element REST APIv2 protection_domains/{name}/protect_vms to assign the newly created VM to a "default" Protection Domain.
I have reviewed https://www.nutanix.dev/2019/12/06/put-that-down-updating-a-vm-with-prism-central-v3-api/, so I understand the concept I believe for the first case. I just need to better understand how to put it together. Any references, URLs, pointers would be appreciated. Thanks!