Пример #1
0
        /// <summary>
        /// command specific implementation 
        /// </summary>
        internal override void commandImplementation()
        {
            Contracts.BootResponse myResponse = new Contracts.BootResponse();
            dynamic bootType = null;
            dynamic bladeId = null;
            dynamic uefi = null;
            dynamic isPersistent = null;
            dynamic bootInstance = null;

            try
            {
                if (this.argVal.TryGetValue('i', out bladeId) && this.argVal.TryGetValue('t', out bootType) && this.argVal.TryGetValue('m', out uefi) && this.argVal.TryGetValue('p', out isPersistent) && this.argVal.TryGetValue('n', out bootInstance))
                {
                    myResponse = WcsCli2CmConnectionManager.channel.SetNextBoot((int)bladeId, getBootType((int)bootType), getIsUefi((int)uefi), (bool)getIsPersistent((int)isPersistent), (int)bootInstance);
                }
                else
                {
                    Console.WriteLine(WcsCliConstants.invalidCommandString);
                }
            }
            catch (Exception ex)
            {
                SharedFunc.ExceptionOutput(ex);
                return;
            }

            if (myResponse == null)
            {
                Console.WriteLine(WcsCliConstants.serviceResponseEmpty);
                return;
            }

            if (myResponse.completionCode == Contracts.CompletionCode.Success)
            {
                Console.WriteLine(WcsCliConstants.commandSucceeded + ". Next boot is " + myResponse.nextBoot);
            }
            else if (myResponse.completionCode == Contracts.CompletionCode.Failure)
            {
                Console.WriteLine(WcsCliConstants.commandFailure);
            }
            else if (myResponse.completionCode == Contracts.CompletionCode.Timeout)
            {
                Console.WriteLine(WcsCliConstants.commandTimeout);
            }
            else
            {
                Console.WriteLine("Command failed with the completion code : {0}", myResponse.completionCode);
            }
        }
        /// <summary>
        /// command specific implementation 
        /// </summary>
        internal override void commandImplementation()
        {
            Contracts.BootResponse myResponse = new Contracts.BootResponse();
            dynamic bootType = null;
            dynamic bladeId = null;
            dynamic uefi = null;
            dynamic isPersistent = null;
            dynamic bootInstance = null;

            try
            {
                if (this.argVal.TryGetValue('i', out bladeId) && this.argVal.TryGetValue('t', out bootType) && this.argVal.TryGetValue('m', out uefi) && this.argVal.TryGetValue('p', out isPersistent) && this.argVal.TryGetValue('n', out bootInstance))
                {
                    myResponse = WcsCli2CmConnectionManager.channel.SetNextBoot((int)bladeId, getBootType((int)bootType), getIsUefi((int)uefi), (bool)getIsPersistent((int)isPersistent), (int)bootInstance);
                }
                else
                {
                    Console.WriteLine(WcsCliConstants.invalidCommandString);
                }
            }
            catch (Exception ex)
            {
                SharedFunc.ExceptionOutput(ex);
                return;
            }

            if (ResponseValidation.ValidateBladeResponse(myResponse.bladeNumber, null, myResponse, false))
            {
                Console.WriteLine(WcsCliConstants.commandSuccess + " Next boot is " + myResponse.nextBoot);
            }
        }
Пример #3
0
        /// <summary>
        /// command specific implementation 
        /// </summary>
        internal override void commandImplementation()
        {
            Contracts.BootResponse myResponse = new Contracts.BootResponse();
            dynamic bladeId = null;

            try
            {
                if (this.argVal.TryGetValue('i', out bladeId))
                {
                    myResponse = WcsCli2CmConnectionManager.channel.GetNextBoot((int)bladeId);
                }
                else
                {
                    Console.WriteLine(WcsCliConstants.invalidCommandString);
                }
            }
            catch (Exception ex)
            {
                SharedFunc.ExceptionOutput(ex);
                return;
            }

            if (myResponse == null)
            {
                Console.WriteLine(WcsCliConstants.serviceResponseEmpty);
                return;
            }

            if (myResponse.completionCode == Contracts.CompletionCode.Success)
            {
                Console.WriteLine("Next boot is " + myResponse.nextBoot);
            }
            else if (myResponse.completionCode == Contracts.CompletionCode.Failure)
            {
                Console.WriteLine(WcsCliConstants.commandFailure);
            }
            else if (myResponse.completionCode == Contracts.CompletionCode.Timeout)
            {
                Console.WriteLine(WcsCliConstants.commandTimeout);
            }
            else
            {
                Console.WriteLine("Command failed with the completion code : {0}", myResponse.completionCode);
            }
        }
        /// <summary>
        /// command specific implementation 
        /// </summary>
        internal override void commandImplementation()
        {
            Contracts.BootResponse myResponse = new Contracts.BootResponse();
            dynamic bladeId = null;

            try
            {
                if (this.argVal.TryGetValue('i', out bladeId))
                {
                    myResponse = WcsCli2CmConnectionManager.channel.GetNextBoot((int)bladeId);
                }
                else
                {
                    Console.WriteLine(WcsCliConstants.invalidCommandString);
                }
            }
            catch (Exception ex)
            {
                SharedFunc.ExceptionOutput(ex);
                return;
            }

            if (ResponseValidation.ValidateBladeResponse(myResponse.bladeNumber, null, myResponse, false))
            {
                Console.WriteLine(WcsCliConstants.commandSuccess + "Next boot is " + myResponse.nextBoot);
            }
        }