250 lines
12 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_PowerManagementService.cs
//
// Contents: A class derived from Service that describes power management functionality, hosted on a System. Whether this service might be used to affect the power state of a particular element is defined by the CIM_ServiceAvailable ToElement association.
// This file was automatically generated from CIM_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>
///A class derived from Service that describes power management functionality, hosted on a System. Whether this service might be used to affect the power state of a particular element is defined by the CIM_ServiceAvailable ToElement association.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService")]
[System.Xml.Serialization.XmlRootAttribute("CIM_PowerManagementService", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PowerManagementService", IsNullable=false)]
public class CIM_PowerManagementService : CIM_Service
{
/// <summary>
/// Default constructor.
/// </summary>
public CIM_PowerManagementService() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public CIM_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 CIM_PowerManagementService(IWSManClient client): base(client)
{
}
/// <summary>
///RequestPowerStateChange defines the desired power state of the managed element, and when the element should be put into that state. The RequestPowerStateChange method has five input parameters and a result code.
///- PowerState indicates the desired power state.
///- ManagedElement indicates the element whose state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
///- Time indicates when the power 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 is expects the transition to take.
///See CIM_PowerStateCapabilities for descriptions of PowerState parameter enumerations.
/// </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_PowerManagementService", IsNullable=false)]
private class RequestPowerStateChange_INPUT : CimParams
{
public RequestPowerStateChange_INPUT(string ns) : base(ns)
{
}
/// <summary>
/// Optional, The power state for ManagedElement.
/// </summary>
[CimField(false,false)]
public virtual ushort PowerState
{
set
{
this.SetOrAddField("PowerState",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 power 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>
///RequestPowerStateChange defines the desired power state of the managed element, and when the element should be put into that state. The RequestPowerStateChange method has five input parameters and a result code.
///- PowerState indicates the desired power state.
///- ManagedElement indicates the element whose state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
///- Time indicates when the power 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 is expects the transition to take.
///See CIM_PowerStateCapabilities for descriptions of PowerState parameter enumerations.
/// </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_PowerManagementService", IsNullable=false)]
private class RequestPowerStateChange_OUTPUT : CimParams
{
public RequestPowerStateChange_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_PowerManagementService", innerXML);
return epr;
}
}
}
/// <summary>
///RequestPowerStateChange defines the desired power state of the managed element, and when the element should be put into that state. The RequestPowerStateChange method has five input parameters and a result code.
///- PowerState indicates the desired power state.
///- ManagedElement indicates the element whose state is set. This element SHOULD be associated to the service using the AssociatedPowerManagementService relationship.
///- Time indicates when the power 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 is expects the transition to take.
///See CIM_PowerStateCapabilities for descriptions of PowerState parameter enumerations.
/// </summary>
/// <param name="inPowerState">Optional, IN -The power 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 power 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 RequestPowerStateChange(ushort? inPowerState,CimReference inManagedElement,CimDateTime inTime,CimDateTime inTimeoutPeriod,out CimReference outJob)
{
RequestPowerStateChange_INPUT input = new RequestPowerStateChange_INPUT(this.XmlNamespace);
if (inPowerState.HasValue)
input.PowerState=inPowerState.Value;
if (inManagedElement != null)
input.ManagedElement=inManagedElement;
if (inTime != null)
input.Time=inTime;
if (inTimeoutPeriod != null)
input.TimeoutPeriod=inTimeoutPeriod;
RequestPowerStateChange_OUTPUT output = new RequestPowerStateChange_OUTPUT();
uint returnValue = base.Invoke("RequestPowerStateChange",input,out output);
outJob=null;
if (returnValue == 0)
{
if (output.ContainsField("Job"))
outJob = output.Job;
}
return returnValue;
}
/// <summary>
/// Enumerate instances of CIM_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 CIM_PowerManagementService objects</returns>
public static new Collection<CIM_PowerManagementService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<CIM_PowerManagementService> ret = CimBase.Enumerate<CIM_PowerManagementService>(client, cimKeys);
return new Collection<CIM_PowerManagementService>(ret);
}
/// <summary>
/// Enumerate instances of CIM_PowerManagementService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of CIM_PowerManagementService objects</returns>
public static new Collection<CIM_PowerManagementService> Enumerate(IWSManClient client)
{
List<CIM_PowerManagementService> ret = CimBase.Enumerate<CIM_PowerManagementService>(client);
return new Collection<CIM_PowerManagementService>(ret);
}
/// <summary>
/// Delete the instance of CIM_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<CIM_PowerManagementService>(client);
}
/// <summary>
/// Represents the keys of the CIM_PowerManagementService class.
/// </summary>
public new class CimKeys : CIM_Service.CimKeys
{
}
}
}