Examples of AlarmSpec


Examples of com.vmware.vim.binding.vim.alarm.AlarmSpec

      tSpec.setStartState(Status.green);
      tSpec.setFinalState(Status.yellow);
      alarmAction.setTransitionSpecs(new TransitionSpec[] { tSpec });
      alarmAction.setGreen2yellow(true);

      AlarmSpec spec = new AlarmSpecImpl();
      spec.setActionFrequency(0);
      spec.setExpression(or);

      /* the name has to be unique, but we need a way to find any matching
      alarms later so we use a known prefix */
      String alarmName = "BDE Health " + SERENGETI_UUID;
      if (alarmName.length() > 80) {
         alarmName = alarmName.substring(0, 80);
      }
      spec.setName(alarmName);
      spec.setSystemName(null);
      spec.setDescription("Indicates a health issue with a compute VM managed by Big Data Extensions. The specific health issue is detailed in a warning event in the event log.");
      spec.setEnabled(true);

      AlarmSetting as = new AlarmSettingImpl();
      as.setReportingFrequency(0);
      as.setToleranceRange(0);

      spec.setSetting(as);

      ManagedObjectReference[] existingAlarms = alarmManager.getAlarm(rootFolder._getRef());
      Alarm existing = null;
      try {
         if (existingAlarms != null) {
View Full Code Here

Examples of com.vmware.vim25.AlarmSpec

      return;
    }
   
    AlarmManager alarmMgr = si.getAlarmManager();
   
    AlarmSpec spec = new AlarmSpec();
   
    StateAlarmExpression expression =
      createStateAlarmExpression();
    AlarmAction emailAction = createAlarmTriggerAction(
        createEmailAction());
    AlarmAction methodAction = createAlarmTriggerAction(
        createPowerOnAction());
    GroupAlarmAction gaa = new GroupAlarmAction();

    gaa.setAction(new AlarmAction[]{emailAction, methodAction});
    spec.setAction(gaa);
    spec.setExpression(expression);
    spec.setName("VmPowerStateAlarm");
    spec.setDescription("Monitor VM state and send email " +
        "and power it on if VM powers off");
    spec.setEnabled(true);   
   
    AlarmSetting as = new AlarmSetting();
    as.setReportingFrequency(0); //as often as possible
    as.setToleranceRange(0);
   
    spec.setSetting(as);
   
    alarmMgr.createAlarm(vm, spec);
   
    si.getServerConnection().logout();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.