283 lines
12 KiB
C#
283 lines
12 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: IPS_PowerManagementService.cs
|
|
//
|
|
// Contents: The IPS_PowerManagementService inherits CIM_PowerManagementService and adds capability to control OS power state
|
|
// This file was automatically generated from IPS_PowerManagementService.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>
|
|
///The IPS_PowerManagementService inherits CIM_PowerManagementService and adds capability to control OS power state
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_PowerManagementService")]
|
|
[System.Xml.Serialization.XmlRootAttribute("IPS_PowerManagementService", Namespace="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_PowerManagementService", IsNullable=false)]
|
|
public class IPS_PowerManagementService : CIM_Service
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public IPS_PowerManagementService() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public IPS_PowerManagementService(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 IPS_PowerManagementService(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Remove OSPowerSavingState field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveOSPowerSavingState()
|
|
{
|
|
RemoveField("OSPowerSavingState");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field OSPowerSavingState exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool OSPowerSavingStateExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("OSPowerSavingState");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The current operating system power saving state of the associated Managed System Element.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual ushort OSPowerSavingState
|
|
{
|
|
get
|
|
{
|
|
return ushort.Parse(this["OSPowerSavingState"][0], CultureInfo.InvariantCulture);
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("OSPowerSavingState",value.ToString(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
/// <summary>
|
|
///RequestOSPowerSavingStateChange defines the desired OS powersaving state of the managed element, and when the element should be put into that state. The RequestOSPowerSavingStateChange method has xxx input parameters and a result code.
|
|
///- OSPowerSavingState indicates the desired OS power saving state.
|
|
///- ManagedElement indicates the element whose OS state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
|
|
///- Time indicates when the OS power saving state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received).
|
|
///- Job is a reference to the job if started.
|
|
///- TimeOutPeriod indicates the maximum amount of time a client expects the transition to take.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
|
|
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_PowerManagementService", IsNullable=false)]
|
|
private class RequestOSPowerSavingStateChange_INPUT : CimParams
|
|
{
|
|
public RequestOSPowerSavingStateChange_INPUT(string ns) : base(ns)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, The OS power saving state for ManagedElement.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual ushort OSPowerSavingState
|
|
{
|
|
set
|
|
{
|
|
this.SetOrAddField("OSPowerSavingState",value.ToString(CultureInfo.InvariantCulture));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Optional, ManagedElement indicates the element whose state is set.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual CimReference ManagedElement
|
|
{
|
|
set
|
|
{
|
|
this.SetOrAddField("ManagedElement",value.Serialize(false));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Optional, Time indicates when the OS power saving state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual CimDateTime Time
|
|
{
|
|
set
|
|
{
|
|
this.SetOrAddField("Time",value.ToString());
|
|
}
|
|
}
|
|
/// <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>
|
|
///RequestOSPowerSavingStateChange defines the desired OS powersaving state of the managed element, and when the element should be put into that state. The RequestOSPowerSavingStateChange method has xxx input parameters and a result code.
|
|
///- OSPowerSavingState indicates the desired OS power saving state.
|
|
///- ManagedElement indicates the element whose OS state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
|
|
///- Time indicates when the OS power saving state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received).
|
|
///- Job is a reference to the job if started.
|
|
///- TimeOutPeriod indicates the maximum amount of time a client expects the transition to take.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
|
|
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_PowerManagementService", IsNullable=false)]
|
|
private class RequestOSPowerSavingStateChange_OUTPUT : CimParams
|
|
{
|
|
public RequestOSPowerSavingStateChange_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://intel.com/wbem/wscim/1/ips-schema/1/IPS_PowerManagementService", innerXML);
|
|
return epr;
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
///RequestOSPowerSavingStateChange defines the desired OS powersaving state of the managed element, and when the element should be put into that state. The RequestOSPowerSavingStateChange method has xxx input parameters and a result code.
|
|
///- OSPowerSavingState indicates the desired OS power saving state.
|
|
///- ManagedElement indicates the element whose OS state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
|
|
///- Time indicates when the OS power saving state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received).
|
|
///- Job is a reference to the job if started.
|
|
///- TimeOutPeriod indicates the maximum amount of time a client expects the transition to take.
|
|
/// </summary>
|
|
/// <param name="inOSPowerSavingState">Optional, IN -The OS power saving state for ManagedElement.</param>
|
|
/// <param name="inManagedElement">Optional, IN -ManagedElement indicates the element whose state is set.</param>
|
|
/// <param name="inTime">Optional, IN -Time indicates when the OS power saving state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received.</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 virtual uint RequestOSPowerSavingStateChange(ushort? inOSPowerSavingState,CimReference inManagedElement,CimDateTime inTime,CimDateTime inTimeoutPeriod,out CimReference outJob)
|
|
{
|
|
RequestOSPowerSavingStateChange_INPUT input = new RequestOSPowerSavingStateChange_INPUT(this.XmlNamespace);
|
|
if (inOSPowerSavingState.HasValue)
|
|
input.OSPowerSavingState=inOSPowerSavingState.Value;
|
|
if (inManagedElement != null)
|
|
input.ManagedElement=inManagedElement;
|
|
if (inTime != null)
|
|
input.Time=inTime;
|
|
if (inTimeoutPeriod != null)
|
|
input.TimeoutPeriod=inTimeoutPeriod;
|
|
RequestOSPowerSavingStateChange_OUTPUT output = new RequestOSPowerSavingStateChange_OUTPUT();
|
|
uint returnValue = base.Invoke("RequestOSPowerSavingStateChange",input,out output);
|
|
outJob=null;
|
|
if (returnValue == 0)
|
|
{
|
|
if (output.ContainsField("Job"))
|
|
outJob = output.Job;
|
|
}
|
|
return returnValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of IPS_PowerManagementService class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <param name="cimKeys">Keys for selecting the instances</param>
|
|
/// <returns>Collection of IPS_PowerManagementService objects</returns>
|
|
public static new Collection<IPS_PowerManagementService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<IPS_PowerManagementService> ret = CimBase.Enumerate<IPS_PowerManagementService>(client, cimKeys);
|
|
return new Collection<IPS_PowerManagementService>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of IPS_PowerManagementService class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of IPS_PowerManagementService objects</returns>
|
|
public static new Collection<IPS_PowerManagementService> Enumerate(IWSManClient client)
|
|
{
|
|
List<IPS_PowerManagementService> ret = CimBase.Enumerate<IPS_PowerManagementService>(client);
|
|
return new Collection<IPS_PowerManagementService>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of IPS_PowerManagementService 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<IPS_PowerManagementService>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the IPS_PowerManagementService class.
|
|
/// </summary>
|
|
|
|
public new class CimKeys : CIM_Service.CimKeys
|
|
{
|
|
}
|
|
|
|
}
|
|
}
|
|
|