Connect vCO to Nutanix API – Part 1

Connect vCO to Nutanix API – Foundation

Here you can find more about Nutanix Foundation. However in this post I will explain how to connect vCenter Orchestrator to Nutanix API. Nutanix foundation API accept and return information in JSON format. JSON is very easy to learn, even such a coding lame as myself can easily operate and build JSON code.

Requirements:

Let’s get started then.

Log in to vCenter Orchestrator using vCO client. From main vCO client window switch over to workflow view and from there, expand HTTP-REST –> Configuration a–> run workflow called Add a Rest host.

Add Nutanix Res API host

Add Nutanix Foundation Rest API host

Provide name for HTTP-REST API host, url under which API call can be found by vCO. For Nutanix foundation it would be http://IP_ADDRESS_FOUNDATION_VM:8000/foundation/ . Remain options leave unchanged – also those for authentication – you don’t need to authenticate to use API on Foundation 1.2.1. Submit workflow to execute.

When workflow finis, switch over to Inventory view and from there click on HTTP-REST.  Under HTTP-REST section you should see brand new API target\host which you can play with.

2014-08-07_23h19_49

Build workflows which one can use to run against Nutanix Foundation API. First what we have to do is Add rest operation. There are several HTTP REST operations:

  • GET – pul information from host
  • POST – push configuration to host
  • PUT – upload files on HTTP-REST host
  • DELETE – delete files from

Connect vCO to Nutanix API – Add rest operation

For test I we will add GET operation which will list all the hypervisor ISOs available on Foundation VM.

Right click on HTTP-Rest host –> Run Workflow and from new window choose Add rest operation.

Provide:

  • Choose API target
  • Name: GEThypervisorISO
  • Template URL; in our example would be   /enumerate_hypervisor_isos
  • from drop down menu choose GET as method

Submit

After WF is completed you should see the new item just right below HTTP-REST target – see picture above.

Connect vCO to Nutanix API – Generate WF based on REST operation

So, now we can generate new workflow based on REST operation we just created.

Right click on Rest operation –> Run Workflow –> Generate new workflow from REST operation. Make sure the under REST operation to be used for the call you have correct REST operation selected, On next screen provide Workflow name and set folder for new workflow  –> Submit

Switch to workflow tab in vCO client and browse to folder with new workflow. Let’s test it then. Simply run workflow and in workflow LOG tab you should see a list of the ISOs available on Foundation VM – assuming you have uploaded hypervisor ISOs on Foundation VM 🙂

Connect vCO to Nutanix API – Part 2 – I will show how you can connect to Prism API

Artur Krzywdzinski

Artur is Consulting Architect at Nutanix. He has been using, designing and deploying VMware based solutions since 2005 and Microsoft since 2012. He specialize in designing and implementing private and hybrid cloud solution based on VMware and Microsoft software stacks, datacenter migrations and transformation, disaster avoidance. Artur holds VMware Certified Design Expert certification (VCDX #077).