Restarting INFOBLOX Services via the REST API via vRealize Orchestrator

I was recently working with Infoblox where I had to restart some services in order to registering the information I was configuring. Here is a quick over view of the workflow I wrote to achieve this.

Screen Shot 2015-02-17 at 22.07.48

You would need to register aVRO REST host that points to the infoblox grid. Then we need to first find the GRIB _ref. The _ref returns a URI that we append to the REST host that does something. It is like an HREF in XML.

Here is the first script.

operationUrl = "grid"
requestType = "GET";

We then pass this in to the Invoke REST host workflow. This workflow accepts a requestType and the opertionUrl. Once this has been submitted, we then look at the contenResponse and get the _ref for the infoblox grid.

// Parsing JSON response
var grid = JSON.parse(restOutput.contentAsString);

// Setting and logging next available IP information
System.log("Creating the grid reference " + grid[0]._ref);

// Setting the REST operation URL
var operationUrl = grid[0]._ref + "?_function=restartservices";

// Creating request JSON content - using strinfiy to convert form object to JSON string.

var requestContent = JSON.stringify({
"restart_option" : "RESTART_IF_NEEDED",
"service_option" : "DHCP",
"member_order" : "SEQUENTIALLY",
"sequential_delay" : 10

requestType = "POST";

The script above parses the content response and looks for the _ref value in the returned object (grid[0]._ref).

Once we have that _ref URI, we append that onto the end of the REST host. We also pass in the following JSON post payload.

"restart_option" : "RESTART_IF_NEEDED",
"service_option" : "DHCP",
"member_order" : "SEQUENTIALLY",
"sequential_delay" : 10

I was updating DHCP options and I was able to specify the service I wanted to restart. I could have specified other options such as ALL and DNS. I set the sequential_delay to 10 which means that it will wait 10 seconds before restarted in the DHCP service in each GRID master.

Some other really helpful info can be found here:

Hope that helps!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s