I have created a solution for this in TypeScript using the Aria Build Tools
https://github.com/vmware/build-tools-for-vmware-aria
The first step is to create a function to check if Alarm Actions are currently enabled or not.
public VcHostSystemAreAlarmActionsEnabled(@notNull @notEmpty @required objVcHostSystem: VcHostSystem): boolean {
let objVcSdkConnection: VcSdkConnection = objVcHostSystem.sdkConnection;
let objVcAlarmManager: VcAlarmManager = objVcSdkConnection.alarmManager;
let blnAreAlarmActionsEnabled: boolean = objVcAlarmManager.areAlarmActionsEnabled(objVcHostSystem);
return blnAreAlarmActionsEnabled;
}
The second step is to create a helper function that will enable us to toggle the setting on and off.
private VcHostSystemAlarmActionsToggle(@notNull @notEmpty @required objVcHostSystem: VcHostSystem, @notNull @notEmpty @required blnAlarmActionsState: boolean): void {
let objVcSdkConnection: VcSdkConnection = objVcHostSystem.sdkConnection;
let objVcAlarmManager: VcAlarmManager = objVcSdkConnection.alarmManager;
objVcAlarmManager.enableAlarmActions(objVcHostSystem, blnAlarmActionsState);
}
The third step is to create 2 functions to call the helper function to do the enable and disable.
public VcHostSystemAlarmActionsEnable(@notNull @notEmpty @required objVcHostSystem: VcHostSystem): void {
this.VcHostSystemAlarmActionsToggle(objVcHostSystem, true);
}
public VcHostSystemAlarmActionsDisable(@notNull @notEmpty @required objVcHostSystem: VcHostSystem): void {
this.VcHostSystemAlarmActionsToggle(objVcHostSystem, false);
}
------------------------------
Simon Sparks
Automation & Orchestration Consultant
North West England, UK, Europe
Broadcom Employee
------------------------------