To use this function add it to the class library file named PluginVCHostSystemService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: PluginVCHostSystemService.ts
Public Function: IPv6Enable
publicIPv6Enable(objVcHostSystem:VcHostSystem):boolean{
letblnReturn:boolean=this.IPv6Toggle(objVcHostSystem,true);
returnblnReturn;
}TypeScriptPublic Function: IPv6Disable
publicIPv6Disable(objVcHostSystem:VcHostSystem):boolean{
letblnReturn:boolean=this.IPv6Toggle(objVcHostSystem,false);
returnblnReturn;
}TypeScriptPrivate Function: IPv6Toggle
privateIPv6Toggle(objVcHostSystem:VcHostSystem,blnEnable:boolean):boolean{
letobjVcHostNetworkConfig:VcHostNetworkConfig=newVcHostNetworkConfig();
objVcHostNetworkConfig.ipV6Enabled=blnEnable;
try{
letobjVcHostConfigManager:VcHostConfigManager=objVcHostSystem.configManager;
letobjVcHostNetworkSystem:VcHostNetworkSystem=objVcHostConfigManager.networkSystem;
letobjVcHostNetworkConfigCurrent:VcHostNetworkConfig=objVcHostNetworkSystem.networkConfig;
if (objVcHostNetworkConfigCurrent.ipV6Enabled===!blnEnable){
this.MaintenanceModeEnter(objVcHostSystem);
objVcHostNetworkSystem.updateNetworkConfig(objVcHostNetworkConfig,"modify");
this.MaintenanceModeExit(objVcHostSystem);
}
returntrue;
}
catch (objException){
returnfalse;
}
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
