Automating Rubrik with vRO Part 3: Authenticate with Rubrik via REST

In this post I’m going to walk you through utilizing the vRO workflow Eric Shanks and I developed for creating a Rubrik session over REST. This is the first workflow in the series, and without it, none of the subsequent workflows can be utilized..

Why do I need this workflow?

In order to complete REST requests against the Rubrik API, an authenticated session is required. This workflow authenticates with the Rubrik REST API, and returns an authentication token. This token is encoded into a base64 token for use in subsequent REST calls.

How was this workflow coded?

For all the coding details, please see www.theithollow.com. As this is a co-blog series, Eric Shanks is posting the coding details on his blog, and i’m posting the how to here. A list to the entire series can be found here.

Pre Requisites:

1. Rubrik Appliance configured and ready to receive REST calls
2. vRealize Orchestrator installed and configured
3. Rubrik REST Host and Operations configured
4. Download the vRO workflow package from Flowgrab

Step 1: Import the Rubrik vRO workflow package

Import the vRO package you downloaded from Flowgrab.

You will find the following objects now available to you in Orchestrator:

Workflows

workflowimport

Actions

actionsimport

Configuration Elements

configelementsimport

Step 2: Configure REST Operation for your environment (Only required if you didn’t complete this piece in part 2)

Select the “Rubrik_Authenticate” workflow and Edit it.

authenticate1

In the General Attributes section, select the REST Operation

requesttoken

Now select the one you configured for your environment (see Part 2)

requestoken2

Your end result should look something like this:

requesttoken

Step 3: Configure your username and password

Go over to Configuration Elements in vRealize Orchestrator and edit the Rubrik-Login configuration element.

configelements2

Update the username and password for your Rubrik Appliance. Save and Exit.

Step 4: Test Authentication

Now to enjoy the fruits of our labor! Run the “Rubrik_Authenticate” workflow.

Check the Logs and you should see a result similar this:

rubrikauth

Make sure you see a Status code returned of “200”, and a Token returned at the bottom. This is the token that will then be passed out for all additional REST Operations. Without it, none of the future workflows in the series will work.

That’s it for now!