vCO Workflow Script to Create an NSX Edge

The following is the vCO Workflow Script to Create an NSX Edge

 

 

var objNSXAddressGroup;
	objNSXAddressGroup = new NSXAddressGroup(null);
	objNSXAddressGroup.displayName = strDisplayName;
	objNSXAddressGroup.subnetMask = strSubnetMask;
	objNSXAddressGroup.primaryAddress = strPrimaryAddress;
	objNSXAddressGroup.secondaryAddresses = null;
	
var arrNSXAddressGroups;
	arrNSXAddressGroups = new Array();
	arrNSXAddressGroups.push(objNSXAddressGroup);

var objNSXAddressGroups;
	objNSXAddressGroups	= new NSXAddressGroups();
	objNSXAddressGroups.addressGroups = arrNSXAddressGroups;

var objNSXNicINTERNAL;
	objNSXNicINTERNAL = new NSXNic();
	objNSXNicINTERNAL.index = 0;
	objNSXNicINTERNAL.name = "Internal";
	objNSXNicINTERNAL.type = "Internal";
	objNSXNicINTERNAL.portgroupId = strPortGroupID;
	objNSXNicINTERNAL.addressGroups = objNSXAddressGroups;

var objNSXNicEXTERNAL;
	objNSXNicEXTERNAL = new NSXNic();
	objNSXNicEXTERNAL.index = 0;
	objNSXNicEXTERNAL.name = "Uplink";
	objNSXNicEXTERNAL.type = "Uplink";
	objNSXNicEXTERNAL.portgroupId = strPortGroupID;
	objNSXNicEXTERNAL.addressGroups = objNSXAddressGroups;
	
var arrNSXNic;
	arrNSXNic = new Array();
	arrNSXNic.push(objNSXNicINTERNAL);
	arrNSXNic.push(objNSXNicEXTERNAL);

var objNSXNics;
	objNSXNics = new NSXNics();
	objNSXNics.nics = arrNSXNic;

var objNSXAppliances;
	objNSXAppliances = new NSXAppliances();
	
var arrNSXAppliances;
	arrNSXAppliances = objNSXAppliances.appliances;

var objNSXEdge;
	objNSXEdge = new NSXEdge();
	objNSXEdge.name = strName;
	objNSXEdge.description = strDescription;
	objNSXEdge.datacenterMoid = datacenterMoid;
	objNSXEdge.tenantId = tenant;	
	objNSXEdge.appliances = arrNSXAppliances;
	objNSXEdge.nics = objNSXNics;

	objNSXEdge = NSXEdgeManager.createEdge(objNSXConnection, objNSXEdge);

Leave a Reply