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
public IPv6Enable(objVcHostSystem: VcHostSystem): boolean {
let blnReturn: boolean = this.IPv6Toggle(objVcHostSystem, true);
return blnReturn;
}TypeScriptPublic Function: IPv6Disable
public IPv6Disable(objVcHostSystem: VcHostSystem): boolean {
let blnReturn: boolean = this.IPv6Toggle(objVcHostSystem, false);
return blnReturn;
}TypeScriptPrivate Function: IPv6Toggle
private IPv6Toggle(objVcHostSystem: VcHostSystem, blnEnable: boolean): boolean {
let objVcHostNetworkConfig: VcHostNetworkConfig = new VcHostNetworkConfig();
objVcHostNetworkConfig.ipV6Enabled = blnEnable;
try {
let objVcHostConfigManager: VcHostConfigManager = objVcHostSystem.configManager;
let objVcHostNetworkSystem: VcHostNetworkSystem = objVcHostConfigManager.networkSystem;
let objVcHostNetworkConfigCurrent: VcHostNetworkConfig = objVcHostNetworkSystem.networkConfig;
if (objVcHostNetworkConfigCurrent.ipV6Enabled === !blnEnable) {
this.MaintenanceModeEnter(objVcHostSystem);
objVcHostNetworkSystem.updateNetworkConfig(objVcHostNetworkConfig, "modify");
this.MaintenanceModeExit(objVcHostSystem);
}
return true;
}
catch (objException) {
return false;
}
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
