Exemple #1
0
        protected override void ProcessRecord()
        {
            Types.returnServerLaunch result = new Types.returnServerLaunch();

            base.ProcessRecord();

            try
            {
                bool rsLaunchServer = RightScale.netClient.Server.terminate(serverID);

                if (rsLaunchServer == true)
                {
                    result.ServerID = serverID;
                    result.Message  = "Server Terminated";
                    result.Result   = true;

                    WriteObject(result);
                }
                else
                {
                    result.ServerID = serverID;
                    result.Message  = "Error Terminating server";
                    result.Result   = false;

                    WriteObject(result);
                }
            }
            catch (RightScaleAPIException errLaunch)
            {
                WriteObject(errLaunch);
                WriteObject(errLaunch.InnerException);
            }
        }
        protected override void ProcessRecord()
        {
            Types.returnServerLaunch result = new Types.returnServerLaunch();

            base.ProcessRecord();

            try
            {
                bool rsLaunchServer = RightScale.netClient.Server.terminate(serverID);

                if (rsLaunchServer == true)
                {
                    result.ServerID = serverID;
                    result.Message = "Server Terminated";
                    result.Result = true;

                    WriteObject(result);
                }
                else
                {
                    result.ServerID = serverID;
                    result.Message = "Error Terminating server";
                    result.Result = false;

                    WriteObject(result);

                }
            }
            catch (RightScaleAPIException errLaunch)
            {
                WriteObject(errLaunch);
                WriteObject(errLaunch.InnerException);
            }
        }