/// <summary>
 /// Initializes a new instance of the ControllerPowerStateChangeRequest
 /// class.
 /// </summary>
 /// <param name="action">The power state that the request is expecting
 /// for the controller of the device. Possible values include: 'Start',
 /// 'Restart', 'Shutdown'</param>
 /// <param name="activeController">The active controller that the
 /// request is expecting on the device. Possible values include:
 /// 'Unknown', 'None', 'Controller0', 'Controller1'</param>
 /// <param name="controller0State">The controller 0's status that the
 /// request is expecting on the device. Possible values include:
 /// 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning',
 /// 'Failure'</param>
 /// <param name="controller1State">The controller 1's status that the
 /// request is expecting on the device. Possible values include:
 /// 'NotPresent', 'PoweredOff', 'Ok', 'Recovering', 'Warning',
 /// 'Failure'</param>
 /// <param name="id">The path ID that uniquely identifies the
 /// object.</param>
 /// <param name="name">The name of the object.</param>
 /// <param name="type">The hierarchical type of the object.</param>
 /// <param name="kind">The Kind of the object. Currently only
 /// Series8000 is supported. Possible values include:
 /// 'Series8000'</param>
 public ControllerPowerStateChangeRequest(ControllerPowerStateAction action, ControllerId activeController, ControllerStatus controller0State, ControllerStatus controller1State, string id = default(string), string name = default(string), string type = default(string), Kind?kind = default(Kind?))
     : base(id, name, type, kind)
 {
     Action           = action;
     ActiveController = activeController;
     Controller0State = controller0State;
     Controller1State = controller1State;
 }
Beispiel #2
0
        internal static string ToSerializedValue(this ControllerPowerStateAction value)
        {
            switch (value)
            {
            case ControllerPowerStateAction.Start:
                return("Start");

            case ControllerPowerStateAction.Restart:
                return("Restart");

            case ControllerPowerStateAction.Shutdown:
                return("Shutdown");
            }
            return(null);
        }
        /// <summary>
        /// Changes the power state of the controller.
        /// </summary>
        private void ChangeControllerPowerState(string deviceName, string hardwareComponentGroupName,
                                                ControllerId activeController, ControllerPowerStateAction controllerAction)
        {
            ControllerPowerStateChangeRequest powerChangeRequest = new ControllerPowerStateChangeRequest();

            powerChangeRequest.ActiveController = activeController;
            powerChangeRequest.Controller0State = ControllerStatus.Ok;
            powerChangeRequest.Controller1State = ControllerStatus.NotPresent;
            powerChangeRequest.Action           = controllerAction;

            this.Client.HardwareComponentGroups.ChangeControllerPowerState(
                deviceName,
                hardwareComponentGroupName,
                powerChangeRequest,
                this.ResourceGroupName,
                this.ManagerName);
        }