359 lines
19 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_BootService.cs
//
// Contents: A class derived from Service that provides the controls to manage the boot configuration of a managed computer system or device. This includes changing the order of the boot devices and affecting settings on managed elements during the boot process. This service can also affect the load of a specific operating system on the computer system through a BootSourceSetting that points to a specific operating system image.
// This file was automatically generated from CIM_BootService.mof
//
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Globalization;
using System.Xml.Serialization;
using System.IO;
using Intel.Manageability.WSManagement;
using Intel.Manageability.Cim.Untyped;
namespace Intel.Manageability.Cim.Typed
{
/// <summary>
///A class derived from Service that provides the controls to manage the boot configuration of a managed computer system or device. This includes changing the order of the boot devices and affecting settings on managed elements during the boot process. This service can also affect the load of a specific operating system on the computer system through a BootSourceSetting that points to a specific operating system image.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService")]
[System.Xml.Serialization.XmlRootAttribute("CIM_BootService", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", IsNullable=false)]
public class CIM_BootService : CIM_Service
{
/// <summary>
/// Default constructor.
/// </summary>
public CIM_BootService() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public CIM_BootService(string xml): base((IWSManClient)null)
{
this.Deserialize(xml);
}
/// <summary>
/// Constructor which recieves a Ws-Management client object.
/// </summary>
/// <param name="client">Ws-Management client</param>
public CIM_BootService(IWSManClient client): base(client)
{
}
/// <summary>
/// Remove EnabledState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public override void RemoveEnabledState()
{
RemoveField("EnabledState");
}
/// <summary>
/// Is true if the field EnabledState exists in the current object,
/// otherwise is false.
/// </summary>
public override bool EnabledStateExist
{
get
{
return ContainsField("EnabledState");
}
}
/// <summary>
/// Optional, EnabledState is an integer enumeration that indicates the enabled and disabled states of an element. It can also indicate the transitions between these requested states. For example, shutting down (value=4) and starting (value=10) are transient states between enabled and disabled. The following text briefly summarizes the various enabled and disabled states:
/// Enabled (2) indicates that the element is or could be executing commands, will process any queued commands, and queues new requests.
/// Disabled (3) indicates that the element will not execute commands and will drop any new requests.
/// Shutting Down (4) indicates that the element is in the process of going to a Disabled state.
/// Not Applicable (5) indicates the element does not support being enabled or disabled.
/// Enabled but Offline (6) indicates that the element might be completing commands, and will drop any new requests.
/// Test (7) indicates that the element is in a test state.
/// Deferred (8) indicates that the element might be completing commands, but will queue any new requests.
/// Quiesce (9) indicates that the element is enabled but in a restricted mode. The behavior of the element is similar to the Enabled state, but it processes only a restricted set of commands. All other requests are queued.
/// Starting (10) indicates that the element is in the process of going to an Enabled state. New requests are queued.Default value is 32769, means that OCR is enabled and RPE is disabled
/// </summary>
[CimField(false, false)]
public override ushort EnabledState
{
get
{
return ushort.Parse(this["EnabledState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("EnabledState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
///Requests that the state of the element be changed to the value specified in the RequestedState parameter. When the requested state change takes place, the EnabledState and RequestedState of the element will be the same. Invoking the RequestStateChange method multiple times could result in earlier requests being overwritten or lost.
///If 0 is returned, then the task completed successfully and the use of ConcreteJob was not required. If 4096 (0x1000) is returned, then the task will take some time to complete, ConcreteJob will be created, and its reference returned in the output parameter Job. Any other return code indicates an error condition.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", IsNullable=false)]
private class RequestStateChange_INPUT : CimParams
{
public RequestStateChange_INPUT(string ns) : base(ns)
{
}
/// <summary>
/// Optional, The state requested for the element. This information will be placed into the RequestedState property of the instance if the return code of the RequestStateChange method is 0 ('Completed with No Error'), 3 ('Timeout'), or 4096 (0x1000) ('Job Started'). Refer to the description of the EnabledState and RequestedState properties for the detailed explanations of the RequestedState values.
/// </summary>
[CimField(false,false)]
public virtual ushort RequestedState
{
set
{
this.SetOrAddField("RequestedState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Optional, A timeout period that specifies the maximum amount of time that the client expects the transition to the new state to take. The interval format must be used to specify the TimeoutPeriod. A value of 0 or a null parameter indicates that the client has no time requirements for the transition.
/// If this property does not contain 0 or null and the implementation does not support this parameter, a return code of 'Use Of Timeout Parameter Not Supported' must be returned.
/// </summary>
[CimField(false,false)]
public virtual CimDateTime TimeoutPeriod
{
set
{
this.SetOrAddField("TimeoutPeriod",value.ToString());
}
}
}
/// <summary>
///Requests that the state of the element be changed to the value specified in the RequestedState parameter. When the requested state change takes place, the EnabledState and RequestedState of the element will be the same. Invoking the RequestStateChange method multiple times could result in earlier requests being overwritten or lost.
///If 0 is returned, then the task completed successfully and the use of ConcreteJob was not required. If 4096 (0x1000) is returned, then the task will take some time to complete, ConcreteJob will be created, and its reference returned in the output parameter Job. Any other return code indicates an error condition.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", IsNullable=false)]
private class RequestStateChange_OUTPUT : CimParams
{
public RequestStateChange_OUTPUT() : base("")
{
}
/// <summary>
/// Optional, Reference to the job (can be null if the task is completed).
/// </summary>
[CimField(false,false)]
public virtual CimReference Job
{
get
{
string innerXML = this.GetField("Job")[0];
CimReference epr = new CimReference("Job", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", innerXML);
return epr;
}
}
}
/// <summary>
///Requests that the state of the element be changed to the value specified in the RequestedState parameter. When the requested state change takes place, the EnabledState and RequestedState of the element will be the same. Invoking the RequestStateChange method multiple times could result in earlier requests being overwritten or lost.
///If 0 is returned, then the task completed successfully and the use of ConcreteJob was not required. If 4096 (0x1000) is returned, then the task will take some time to complete, ConcreteJob will be created, and its reference returned in the output parameter Job. Any other return code indicates an error condition.
/// </summary>
/// <param name="inRequestedState">Optional, IN -The state requested for the element. This information will be placed into the RequestedState property of the instance if the return code of the RequestStateChange method is 0 ('Completed with No Error'), 3 ('Timeout'), or 4096 (0x1000) ('Job Started'). Refer to the description of the EnabledState and RequestedState properties for the detailed explanations of the RequestedState values.</param>
/// <param name="inTimeoutPeriod">Optional, IN -A timeout period that specifies the maximum amount of time that the client expects the transition to the new state to take. The interval format must be used to specify the TimeoutPeriod. A value of 0 or a null parameter indicates that the client has no time requirements for the transition.
/// If this property does not contain 0 or null and the implementation does not support this parameter, a return code of 'Use Of Timeout Parameter Not Supported' must be returned.</param>
/// <param name="outJob">OUT - Reference to the job (can be null if the task is completed).</param>
/// <returns>
/// Legal values:
/// Completed with No Error : 0
/// Not Supported : 1
/// Unknown or Unspecified Error : 2
/// Cannot complete within Timeout Period : 3
/// Failed : 4
/// Invalid Parameter : 5
/// In Use : 6
/// DMTF Reserved : ..
/// Method Parameters Checked - Job Started : 4096
/// Invalid State Transition : 4097
/// Use of Timeout Parameter Not Supported : 4098
/// Busy : 4099
/// Method Reserved : 4100..32767
/// Vendor Specific : 32768..65535
/// </returns>
public override uint RequestStateChange(ushort? inRequestedState,CimDateTime inTimeoutPeriod,out CimReference outJob)
{
RequestStateChange_INPUT input = new RequestStateChange_INPUT(this.XmlNamespace);
if (inRequestedState.HasValue)
input.RequestedState=inRequestedState.Value;
if (inTimeoutPeriod != null)
input.TimeoutPeriod=inTimeoutPeriod;
RequestStateChange_OUTPUT output = new RequestStateChange_OUTPUT();
uint returnValue = base.Invoke("RequestStateChange",input,out output);
outJob=null;
if (returnValue == 0)
{
if (output.ContainsField("Job"))
outJob = output.Job;
}
return returnValue;
}
/// <summary>
///This method is called to set the role of the BootConfigSetting that is directly or indirectly associated to one or more ComputerSystems. The method applies the new role equally to all related ComputerSystems. If a BootConfigSetting can be related to more than one ComputerSystem, but role modification applies to just one of them, the SetBootConfigUsage method shall be used instead.
///The method shall update the IsNext or IsDefault property of every ElementSettingData that directly or indirectly associates BootConfigSetting to a ComputerSystem. The method may also update the IsNext or IsDefault property of other ElementSettingDatas that reference the same ComputerSystems to satisfy cardinality constraints.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", IsNullable=false)]
private class SetBootConfigRole_INPUT : CimParams
{
public SetBootConfigRole_INPUT(string ns) : base(ns)
{
}
/// <summary>
/// Required, An existing BootConfigSetting instance whose role will be updated.
/// </summary>
[CimField(false,false)]
public virtual CimReference BootConfigSetting
{
set
{
this.SetOrAddField("BootConfigSetting",value.Serialize(false));
}
}
/// <summary>
/// Required, The desired Role of the BootConfigSetting.
/// "IsNext" updates the ElementSettingData.IsNext property and indicates that the specified BootConfigSetting is to be used in the future when any of its related ComputerSystems are enabled.
/// "IsNextSingleUse" updates the ElementSettingData.IsNext property. It is similar to IsNext, except the change applies only to the next time a related ComputerSystem is enabled.
/// "IsDefault" updates the ElementSettingData.IsDefault property to indicate that the BootConfigSetting is identified as the default boot configuration for any of its related ComputerSystems
/// </summary>
[CimField(false,true)]
public virtual ushort Role
{
set
{
this.SetOrAddField("Role",value.ToString(CultureInfo.InvariantCulture));
}
}
}
/// <summary>
///This method is called to set the role of the BootConfigSetting that is directly or indirectly associated to one or more ComputerSystems. The method applies the new role equally to all related ComputerSystems. If a BootConfigSetting can be related to more than one ComputerSystem, but role modification applies to just one of them, the SetBootConfigUsage method shall be used instead.
///The method shall update the IsNext or IsDefault property of every ElementSettingData that directly or indirectly associates BootConfigSetting to a ComputerSystem. The method may also update the IsNext or IsDefault property of other ElementSettingDatas that reference the same ComputerSystems to satisfy cardinality constraints.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", IsNullable=false)]
private class SetBootConfigRole_OUTPUT : CimParams
{
public SetBootConfigRole_OUTPUT() : base("")
{
}
/// <summary>
/// Optional, Reference to the job spawned if the operation continues after the method returns. (May be null if the task is completed).
/// </summary>
[CimField(false,false)]
public virtual CimReference Job
{
get
{
string innerXML = this.GetField("Job")[0];
CimReference epr = new CimReference("Job", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootService", innerXML);
return epr;
}
}
}
/// <summary>
///This method is called to set the role of the BootConfigSetting that is directly or indirectly associated to one or more ComputerSystems. The method applies the new role equally to all related ComputerSystems. If a BootConfigSetting can be related to more than one ComputerSystem, but role modification applies to just one of them, the SetBootConfigUsage method shall be used instead.
///The method shall update the IsNext or IsDefault property of every ElementSettingData that directly or indirectly associates BootConfigSetting to a ComputerSystem. The method may also update the IsNext or IsDefault property of other ElementSettingDatas that reference the same ComputerSystems to satisfy cardinality constraints.
/// </summary>
/// <param name="inBootConfigSetting">Required, IN -An existing BootConfigSetting instance whose role will be updated.</param>
/// <param name="inRole">Required, IN -The desired Role of the BootConfigSetting.
/// "IsNext" updates the ElementSettingData.IsNext property and indicates that the specified BootConfigSetting is to be used in the future when any of its related ComputerSystems are enabled.
/// "IsNextSingleUse" updates the ElementSettingData.IsNext property. It is similar to IsNext, except the change applies only to the next time a related ComputerSystem is enabled.
/// "IsDefault" updates the ElementSettingData.IsDefault property to indicate that the BootConfigSetting is identified as the default boot configuration for any of its related ComputerSystems</param>
/// <param name="outJob">OUT - Reference to the job spawned if the operation continues after the method returns. (May be null if the task is completed).</param>
/// <returns>
/// Legal values:
/// Completed with No Error : 0
/// Not Supported : 1
/// Unknown/Unspecified Error : 2
/// Busy : 3
/// Invalid Reference : 4
/// Invalid Parameter : 5
/// Access Denied : 6
/// DMTF Reserved : ..
/// Method Parameters Checked - Job Started : 4096
/// Method Reserved : 4097..32767
/// Vendor Specified : 32768..65535
/// </returns>
public virtual uint SetBootConfigRole(CimReference inBootConfigSetting,ushort? inRole,out CimReference outJob)
{
SetBootConfigRole_INPUT input = new SetBootConfigRole_INPUT(this.XmlNamespace);
if (inBootConfigSetting != null)
input.BootConfigSetting=inBootConfigSetting;
if (inRole.HasValue)
input.Role=inRole.Value;
SetBootConfigRole_OUTPUT output = new SetBootConfigRole_OUTPUT();
uint returnValue = base.Invoke("SetBootConfigRole",input,out output);
outJob=null;
if (returnValue == 0)
{
if (output.ContainsField("Job"))
outJob = output.Job;
}
return returnValue;
}
/// <summary>
/// Enumerate instances of CIM_BootService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <param name="cimKeys">Keys for selecting the instances</param>
/// <returns>Collection of CIM_BootService objects</returns>
public static new Collection<CIM_BootService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<CIM_BootService> ret = CimBase.Enumerate<CIM_BootService>(client, cimKeys);
return new Collection<CIM_BootService>(ret);
}
/// <summary>
/// Enumerate instances of CIM_BootService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of CIM_BootService objects</returns>
public static new Collection<CIM_BootService> Enumerate(IWSManClient client)
{
List<CIM_BootService> ret = CimBase.Enumerate<CIM_BootService>(client);
return new Collection<CIM_BootService>(ret);
}
/// <summary>
/// Delete the instance of CIM_BootService if it is singular.
/// Note: This method will succeed only if a single instance of the class exists.
/// </summary>
/// <param name="client">WS-Management client</param>
public static new void Delete(IWSManClient client)
{
CimBase.Delete<CIM_BootService>(client);
}
/// <summary>
/// Represents the keys of the CIM_BootService class.
/// </summary>
public new class CimKeys : CIM_Service.CimKeys
{
}
}
}