Ejemplo n.º 1
0
        /// <summary>
        /// Undeploy vApp async
        /// </summary>
        /// <param name="vApp"></param>
        /// <param name="timeout"></param>
        public void UndeployVappAsync(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("Undeploy vApp: {0}", vApp.Reference.name));
                vApp.Undeploy(UndeployPowerActionType.DEFAULT);
            }
            catch (Exception e)
            {
                Log.logger.Error(e.Message);
                throw new EnvironmentException(VCLOUD, e.Message, e);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Undeploy vApp
        /// </summary>
        /// <param name="vApp"></param>
        /// <param name="timeout"></param>
        public void UndeployVapp(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("Undeploy vApp Start: {0}", vApp.Reference.name));
                vApp.Undeploy(UndeployPowerActionType.DEFAULT).WaitForTask(timeout);
                Log.logger.Debug(string.Format("Undeploy vApp Finish: {0}", vApp.Reference.name));
            }
            catch (Exception e)
            {
                Log.logger.Error(e.Message);
                throw new EnvironmentException(VCLOUD, e.Message, e);
            }
        }