Automating Firewall Rule Creation in NSX with VCO and VCAC – Part One: REST Host configuration in VCO

I’ve decided to try and publish a series of blog posts around some of the work I am doing with NSX, VCO, and VCAC. This first post will focus on using VCO and making a REST connection to NSX. The steps that I detail below should work in VCO 5.5, VCO HTTP-REST plugin 1.03, NSX 6.02, and VCAC 5.2 & 6. One word of caution, this is all fairly new to me so it is very likely that there are better ways to accomplish the same tasks.

Step One – Add the Rest Host

In order to do anything with VCO we need to first register NSX as a REST host. Do this by running the “Add a REST host” workflow.

AddRestHost

 

 

 

 

 

 

 

 

 

 

 

 

Type in the user friendly name and the API URL for the NSX Manager. Don’t forget the /api at the end of the URL

AddRestHost_part2

 

Select the authentication type. NSX will accept the HTTP basic authentication type which I will be using in these examples.

AddRestHost_part3

 

I plan on using the same credentials for my workflows so I will select the Shared Session mode and enter in the credentials.

AddRestHost_part4

 

After you click submit you should now see a new REST host in the VCO inventory.

AddRestHost_part5

 

 

 

 

 

 

Step Two – Add a simple REST operation

Since the point of this post is to work with the firewall rules in NSX I will add a REST operation that will get the current firewall configuration. Run the workflow “Add a REST operation”.

AddRestOperationt_part1

 

 

 

 

 

 

The Parent host will be the REST host that was added earlier. The Name field will be the user friendly name for this REST operation. The Template URL is the last portion of the full URL that you need to query for this operation. The HTTP method will be a GET.

AddRestOperationt_part2

 

Step Three – Test the REST operation

We need to test the REST operation now to validate that both the host and operation were created correctly.  Run the “Invoke a REST operation” workflow.

TestRestOp_part1

 

 

 

 

 

 

 

 

 

 

Select the REST operation that was just added.

TestRestOp_part2

 

And if all goes well you should see the green check mark of success and see the XML output in the workflow logs.

TestRestOp_part3

 

 Stay tuned for part two…

One thought on “Automating Firewall Rule Creation in NSX with VCO and VCAC – Part One: REST Host configuration in VCO

  1. Pingback: Objective 8.2 – Describe NSX Automation | YAVB - Rich Dowling

Leave a comment