/// <summary> /// Power on vApp /// </summary> /// <param name="vApp"></param> /// <param name="timeout"></param> public void PowerOnVapp(Vapp vApp, int timeout) { if (vApp == null) { string errorMsg = "vApp is null reference"; Log.logger.Error(errorMsg); throw new EnvironmentException(VCLOUD, errorMsg); } try { Log.logger.Debug(string.Format("PowerOn vApp Start: {0}", vApp.Reference.name)); vApp.PowerOn().WaitForTask(timeout); Log.logger.Debug(string.Format("PowerOn vApp Finish: {0}", vApp.Reference.name)); } catch (Exception e) { Log.logger.Error(e.Message); throw new EnvironmentException(VCLOUD, e.Message, e); } }
/// <summary> /// Power on vApp async /// </summary> /// <param name="vApp"></param> /// <param name="timeout"></param> public void PowerOnVappAsync(Vapp vApp) { if (vApp == null) { string errorMsg = "vApp is null reference"; Log.logger.Error(errorMsg); throw new EnvironmentException(VCLOUD, errorMsg); } try { Log.logger.Debug(string.Format("PowerOn vApp: {0}", vApp.Reference.name)); vApp.PowerOn(); } catch (Exception e) { Log.logger.Error(e.Message); throw new EnvironmentException(VCLOUD, e.Message, e); } }