Question

Nutanix Calm and working with the REST APIs via HTTP Tasks

  • 11 July 2020
  • 3 replies
  • 720 views

Userlevel 1

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:

  1. 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.

  2. 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.

  3. 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!


3 replies

Userlevel 1

Hey James,

I assume the same question is posted on reddit and the conversation is going on in reddit. LEt me know if otherwise.

 

Regards,

Charan teja

Userlevel 1

It sure is, @charan-49230! Thanks for taking the time to check in!

Userlevel 1

For all those that might be interested as well: https://www.reddit.com/r/nutanix/comments/hpdu0k/nutanix_calm_and_working_with_the_rest_apis_via/?utm_source=share&utm_medium=web2x

Reply