Orchestrator Function: Add a Private Isolated Network in a vCloud vApp

by Simon Sparks · 5 September 2013

To use this function add it to the class library file named OrchestratorService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorService.ts

Description: Orchestrator Function to create a Private Isolated Network in a vCloud vApp.

Function: VclVAppNetworkCreate

publicVclVAppNetworkCreate(objVclNetworkConfigSection:VclNetworkConfigSection,strNetworkName:string,strNetworkDescription:string,strIpAddressRangeStart:string,strIpAddressRangeEnd:string,strIpAddressGateway:string,strIpSubnetMask:string,strIpAddressDnsServerPrimary:string,strIpAddressDnsServerSecondary:string,strIpAddressSyslogServerPrimary:string,strIpAddressSyslogServerSecondary:string,strIpAddressDnsSuffix:string):void{
letobjVclIpRange: VclIpRange=newVclIpRange();
objVclIpRange.startAddress=strIpAddressRangeStart;
objVclIpRange.endAddress=strIpAddressRangeEnd;

letobjVclIpRanges: VclIpRanges=newVclIpRanges();
objVclIpRanges.ipRange.add(objVclIpRange);

letobjVclIpScope: VclIpScope=newVclIpScope();
objVclIpScope.gateway=strIpAddressGateway;
objVclIpScope.netmask=strIpSubnetMask;
objVclIpScope.ipRanges=objVclIpRanges;
objVclIpScope.dns1=strIpAddressDnsServerPrimary;
objVclIpScope.dns2=strIpAddressDnsServerSecondary;
objVclIpScope.dnsSuffix=strIpAddressDnsSuffix;
objVclIpScope.allocatedIpAddresses=null;
objVclIpScope.subAllocations=null;
objVclIpScope.isEnabled=true;
objVclIpScope.isInherited=false;

letobjVclIpScopes: VclIpScopes=newVclIpScopes();
objVclIpScopes.ipScope.add(objVclIpScope);

letobjVclSyslogServerSettings: VclSyslogServerSettings=newVclSyslogServerSettings();
objVclSyslogServerSettings.syslogServerIp1=strIpAddressSyslogServerPrimary;
objVclSyslogServerSettings.syslogServerIp2=strIpAddressSyslogServerSecondary;

letobjVclNetworkConfigurationPRIVATE: VclNetworkConfiguration=newVclNetworkConfiguration();
objVclNetworkConfigurationPRIVATE.syslogServerSettings=objVclSyslogServerSettings;
objVclNetworkConfigurationPRIVATE.ipScope=objVclIpScope;
objVclNetworkConfigurationPRIVATE.ipScopes=objVclIpScopes;
objVclNetworkConfigurationPRIVATE.fenceMode="isolated";
objVclNetworkConfigurationPRIVATE.features=null;
objVclNetworkConfigurationPRIVATE.routerInfo=null;
objVclNetworkConfigurationPRIVATE.backwardCompatibilityMode=false;
objVclNetworkConfigurationPRIVATE.retainNetInfoAcrossDeployments=false;
objVclNetworkConfigurationPRIVATE.parentNetwork=null;

letobjVclVAppNetworkConfigurationPRIVATE: VclVAppNetworkConfiguration=newVclVAppNetworkConfiguration();
objVclVAppNetworkConfigurationPRIVATE.configuration=objVclNetworkConfigurationPRIVATE;
objVclVAppNetworkConfigurationPRIVATE.description=strNetworkDescription;
objVclVAppNetworkConfigurationPRIVATE.networkName=strNetworkName;
objVclVAppNetworkConfigurationPRIVATE.isDeployed=true;

objVclNetworkConfigSection.networkConfig.add(objVclVAppNetworkConfigurationPRIVATE);
}


Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like