Add Authentication

In this short guide, we will be setting up authentication in order to list virtual machines using the VMWare vSphere API using Pliant.io. Pliant allows you to easily save multiple authentications for your services safely, securely, and easily, without having to divulge credentials to your services during API calls.

First, create a new, empty workflow.

Setting up authentication

To begin, you will need to know the credentials of the authentication you plan to use.

Add the Authentication to Pliant's authentication keys by clicking on the "Auth" icon and clicking "Add Authentication".

Select the appropriate service using the "Service" dropdown. In this example, we will select VMWarevSphere.

Give this authentication key a unique name (we'll stick with "vmware" for this example) .

Fill in the secrets.

If you would like to read or override an attribute from another block, check the appropriate box(es) to allow these operations.

Note: When the Authentication is saved, it's full name will be "admin/vmware", since the username of the auth key creator is part of the name.


Adding output variables

In order to display or use any kind of a result from an API, it must be first written to a variable.

Add a new OUTPUT variable of type object, that will hold the list of VMs, give your workflow a name and save it.

We will now list the available virtual machines to demonstrate successful authentication.

To list virtual machines, navigate to VMWare > VMWarevSphere > vcenter > VM and drag and drop the "list" block.

In order for the API call to succeed, the authKey field must be a valid name of an authentication key that is applicable to VMWare. In this example case "admin/vmware" must be entered in the box with the quotes. This should look like "user"/"authentication-name", where "user" is your username and "authentication-name" is what you named the authentication for this particular service previously.

From within the action block VMWarevSphere (in our case), we can simply click the field for "authKey" and we should see the authentication we previously created as available to autofill.

If the authentication key cannot be found from within the action block, be sure you selected the correct service during set up of the authentication key; It must be the same service!

Saving the result

Use the common "Assign" block to save the output of the VM list API call to the output variable you had defined. The end result should look similar to this:

Running the flow

Upon saving and running, a list of running and powered off VMs should be outputted on success.