484 lines
22 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_EnabledLogicalElement.cs
//
// Contents: This class extends LogicalElement to abstract the concept of an element that is enabled and disabled, such as a LogicalDevice or a ServiceAccessPoint.
// This file was automatically generated from CIM_EnabledLogicalElement.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>
///This class extends LogicalElement to abstract the concept of an element that is enabled and disabled, such as a LogicalDevice or a ServiceAccessPoint.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EnabledLogicalElement")]
[System.Xml.Serialization.XmlRootAttribute("CIM_EnabledLogicalElement", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EnabledLogicalElement", IsNullable=false)]
public class CIM_EnabledLogicalElement : CIM_LogicalElement
{
/// <summary>
/// Default constructor.
/// </summary>
public CIM_EnabledLogicalElement() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public CIM_EnabledLogicalElement(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_EnabledLogicalElement(IWSManClient client): base(client)
{
}
/// <summary>
/// Remove AvailableRequestedStates field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveAvailableRequestedStates()
{
RemoveField("AvailableRequestedStates");
}
/// <summary>
/// Is true if the field AvailableRequestedStates exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool AvailableRequestedStatesExist
{
get
{
return ContainsField("AvailableRequestedStates");
}
}
/// <summary>
/// Optional, AvailableRequestedStates indicates the possible values for the RequestedState parameter of the method RequestStateChange, used to initiate a state change. The values listed shall be a subset of the values contained in the RequestedStatesSupported property of the associated instance of CIM_EnabledLogicalElementCapabilities where the values selected are a function of the current state of the CIM_EnabledLogicalElement. This property may be non-null if an implementation is able to advertise the set of possible values as a function of the current state. This property shall be null if an implementation is unable to determine the set of possible values as a function of the current state.
/// </summary>
[CimField(false, false)]
public virtual ushort[] AvailableRequestedStates
{
get
{
return CimTypesUtils.StringArrayToArray<ushort>(this["AvailableRequestedStates"]);
}
set
{
string[] arr = CimTypesUtils.ArrayToStringArray<ushort>(value);
this.SetOrAddField("AvailableRequestedStates", arr);
}
}
/// <summary>
/// Remove EnabledDefault field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveEnabledDefault()
{
RemoveField("EnabledDefault");
}
/// <summary>
/// Is true if the field EnabledDefault exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool EnabledDefaultExist
{
get
{
return ContainsField("EnabledDefault");
}
}
/// <summary>
/// Optional, An enumerated value indicating an administrator's default or startup configuration for the Enabled State of an element. By default, the element is "Enabled" (value=2).
/// </summary>
[CimField(false, false)]
public virtual ushort EnabledDefault
{
get
{
return ushort.Parse(this["EnabledDefault"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("EnabledDefault",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Remove EnabledState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveEnabledState()
{
RemoveField("EnabledState");
}
/// <summary>
/// Is true if the field EnabledState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual 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.
/// Starting (10) indicates that the element is in the process of going to an Enabled state. New requests are queued.
/// </summary>
[CimField(false, false)]
public virtual ushort EnabledState
{
get
{
return ushort.Parse(this["EnabledState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("EnabledState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Remove OtherEnabledState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveOtherEnabledState()
{
RemoveField("OtherEnabledState");
}
/// <summary>
/// Is true if the field OtherEnabledState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool OtherEnabledStateExist
{
get
{
return ContainsField("OtherEnabledState");
}
}
/// <summary>
/// Optional, A string that describes the enabled or disabled state of the element when the EnabledState property is set to 1 ("Other"). This property must be set to null when EnabledState is any value other than 1.
/// </summary>
[CimField(false, false)]
public virtual string OtherEnabledState
{
get
{
return this.GetField("OtherEnabledState")[0];
}
set
{
this.SetOrAddField("OtherEnabledState",value);
}
}
/// <summary>
/// Remove RequestedState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveRequestedState()
{
RemoveField("RequestedState");
}
/// <summary>
/// Is true if the field RequestedState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool RequestedStateExist
{
get
{
return ContainsField("RequestedState");
}
}
/// <summary>
/// Optional, RequestedState is an integer enumeration that indicates the last requested or desired state for the element, irrespective of the mechanism through which it was requested. The actual state of the element is represented by EnabledState. This property is provided to compare the last requested and current enabled or disabled states. Note that when EnabledState is set to 5 ("Not Applicable"), then this property has no meaning. Refer to the EnabledState property description for explanations of the values in the RequestedState enumeration.
/// "Unknown" (0) indicates the last requested state for the element is unknown.
/// Note that the value "No Change" (5) has been deprecated in lieu of indicating the last requested state is "Unknown" (0). If the last requested or desired state is unknown, RequestedState should have the value "Unknown" (0), but may have the value "No Change" (5).Offline (6) indicates that the element has been requested to transition to the Enabled but Offline EnabledState.
/// It should be noted that there are two new values in RequestedState that build on the statuses of EnabledState. These are "Reboot" (10) and "Reset" (11). Reboot refers to doing a "Shut Down" and then moving to an "Enabled" state. Reset indicates that the element is first "Disabled" and then "Enabled". The distinction between requesting "Shut Down" and "Disabled" should also be noted. Shut Down requests an orderly transition to the Disabled state, and might involve removing power, to completely erase any existing state. The Disabled state requests an immediate disabling of the element, such that it will not execute or accept any commands or processing requests.
///
/// This property is set as the result of a method invocation (such as Start or StopService on CIM_Service), or can be overridden and defined as WRITEable in a subclass. The method approach is considered superior to a WRITEable property, because it allows an explicit invocation of the operation and the return of a result code.
///
/// If knowledge of the last RequestedState is not supported for the EnabledLogicalElement, the property shall be NULL or have the value 12 "Not Applicable".
/// </summary>
[CimField(false, false)]
public virtual ushort RequestedState
{
get
{
return ushort.Parse(this["RequestedState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("RequestedState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Remove TimeOfLastStateChange field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveTimeOfLastStateChange()
{
RemoveField("TimeOfLastStateChange");
}
/// <summary>
/// Is true if the field TimeOfLastStateChange exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool TimeOfLastStateChangeExist
{
get
{
return ContainsField("TimeOfLastStateChange");
}
}
/// <summary>
/// Optional, The date or time when the EnabledState of the element last changed. If the state of the element has not changed and this property is populated, then it must be set to a 0 interval value. If a state change was requested, but rejected or not yet processed, the property must not be updated.
/// </summary>
[CimField(false, false)]
public virtual CimDateTime TimeOfLastStateChange
{
get
{
return CimDateTime.Parse(this["TimeOfLastStateChange"][0]);
}
set
{
this.SetOrAddField("TimeOfLastStateChange",value.ToString());
}
}
/// <summary>
/// Remove TransitioningToState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveTransitioningToState()
{
RemoveField("TransitioningToState");
}
/// <summary>
/// Is true if the field TransitioningToState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool TransitioningToStateExist
{
get
{
return ContainsField("TransitioningToState");
}
}
/// <summary>
/// Optional, TransitioningToState indicates the target state to which the instance is transitioning.
/// A value of 5 "No Change" shall indicate that no transition is in progress.A value of 12 "Not Applicable" shall indicate the implementation does not support representing ongoing transitions.
/// A value other than 5 or 12 shall identify the state to which the element is in the process of transitioning.
/// </summary>
[CimField(false, false)]
public virtual ushort TransitioningToState
{
get
{
return ushort.Parse(this["TransitioningToState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("TransitioningToState",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.
///A return code of 0 shall indicate the state change was successfully initiated.
///A return code of 3 shall indicate that the state transition cannot complete within the interval specified by the TimeoutPeriod parameter.
///A return code of 4096 (0x1000) shall indicate the state change was successfully initiated, a ConcreteJob has been 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_EnabledLogicalElement", 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'), 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' shall 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.
///A return code of 0 shall indicate the state change was successfully initiated.
///A return code of 3 shall indicate that the state transition cannot complete within the interval specified by the TimeoutPeriod parameter.
///A return code of 4096 (0x1000) shall indicate the state change was successfully initiated, a ConcreteJob has been 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_EnabledLogicalElement", IsNullable=false)]
private class RequestStateChange_OUTPUT : CimParams
{
public RequestStateChange_OUTPUT() : base("")
{
}
/// <summary>
/// Optional, May contain a reference to the ConcreteJob created to track the state transition initiated by the method invocation.
/// </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_EnabledLogicalElement", 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.
///A return code of 0 shall indicate the state change was successfully initiated.
///A return code of 3 shall indicate that the state transition cannot complete within the interval specified by the TimeoutPeriod parameter.
///A return code of 4096 (0x1000) shall indicate the state change was successfully initiated, a ConcreteJob has been 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'), 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' shall be returned.</param>
/// <param name="outJob">OUT - May contain a reference to the ConcreteJob created to track the state transition initiated by the method invocation.</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 virtual 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>
/// Enumerate instances of CIM_EnabledLogicalElement 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_EnabledLogicalElement objects</returns>
public static new Collection<CIM_EnabledLogicalElement> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<CIM_EnabledLogicalElement> ret = CimBase.Enumerate<CIM_EnabledLogicalElement>(client, cimKeys);
return new Collection<CIM_EnabledLogicalElement>(ret);
}
/// <summary>
/// Enumerate instances of CIM_EnabledLogicalElement class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of CIM_EnabledLogicalElement objects</returns>
public static new Collection<CIM_EnabledLogicalElement> Enumerate(IWSManClient client)
{
List<CIM_EnabledLogicalElement> ret = CimBase.Enumerate<CIM_EnabledLogicalElement>(client);
return new Collection<CIM_EnabledLogicalElement>(ret);
}
/// <summary>
/// Delete the instance of CIM_EnabledLogicalElement 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_EnabledLogicalElement>(client);
}
/// <summary>
/// Represents the keys of the CIM_EnabledLogicalElement class.
/// </summary>
public new class CimKeys : CIM_LogicalElement.CimKeys
{
}
}
}