373 lines
14 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: AMT_TimeSynchronizationService.cs
//
// Contents: Exposes Intel(R) AMT time synchronization services to management clients.
// This file was automatically generated from AMT_TimeSynchronizationService.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>
///Exposes Intel(R) AMT time synchronization services to management clients.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService")]
[System.Xml.Serialization.XmlRootAttribute("AMT_TimeSynchronizationService", Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
public class AMT_TimeSynchronizationService : CIM_Service
{
/// <summary>
/// Default constructor.
/// </summary>
public AMT_TimeSynchronizationService() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public AMT_TimeSynchronizationService(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 AMT_TimeSynchronizationService(IWSManClient client): base(client)
{
}
/// <summary>
/// Remove LocalTimeSyncEnabled field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveLocalTimeSyncEnabled()
{
RemoveField("LocalTimeSyncEnabled");
}
/// <summary>
/// Is true if the field LocalTimeSyncEnabled exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool LocalTimeSyncEnabledExist
{
get
{
return ContainsField("LocalTimeSyncEnabled");
}
}
/// <summary>
/// Optional, Determines if user with LOCAL_SYSTEM_REALM permission can set the time.The values are: DEFAULT_TRUE - Time sync is enabled by default. Was not configured to enabled or disabled by the configuration SW.CONFIGURED_TRUE - Time Sync is enabled and configured by configuration SW to TRUE. This option is required in order to differentiate between legacy configuration SW that do not support this setting and new SW that can configure it to TRUE.FALSE - Time Sync is disabled.
/// </summary>
[CimField(false, false)]
public virtual uint LocalTimeSyncEnabled
{
get
{
return uint.Parse(this["LocalTimeSyncEnabled"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("LocalTimeSyncEnabled",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Remove TimeSource field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveTimeSource()
{
RemoveField("TimeSource");
}
/// <summary>
/// Is true if the field TimeSource exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool TimeSourceExist
{
get
{
return ContainsField("TimeSource");
}
}
/// <summary>
/// Optional, Determines if RTC was set to UTC by any configuration SW.
/// </summary>
[CimField(false, false)]
public virtual uint TimeSource
{
get
{
return uint.Parse(this["TimeSource"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("TimeSource",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
///This method is used for reading the Intel(R) AMT device's internal clock.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class GetLowAccuracyTimeSynch_INPUT : CimParams
{
public GetLowAccuracyTimeSynch_INPUT(string ns) : base(ns)
{
}
}
/// <summary>
///This method is used for reading the Intel(R) AMT device's internal clock.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class GetLowAccuracyTimeSynch_OUTPUT : CimParams
{
public GetLowAccuracyTimeSynch_OUTPUT() : base("")
{
}
/// <summary>
/// Optional, An unsigned 32-bit value representing the local time as the number of seconds from 00:00:00, January 1, 1970 UTC. This format is sufficient to maintain time stamps with one-second resolution past the year 2100. This is based on a longstanding UNIX-based standard for timekeeping, which represents time as the number of seconds from 00:00:00, January 1, 1970 UTC. Similar time formats are used in ANSI C.
/// </summary>
[CimField(false,false)]
public virtual uint Ta0
{
get
{
return uint.Parse(this["Ta0"][0], CultureInfo.InvariantCulture);
}
}
}
/// <summary>
///This method is used for reading the Intel(R) AMT device's internal clock.
/// </summary>
/// <param name="outTa0">OUT - An unsigned 32-bit value representing the local time as the number of seconds from 00:00:00, January 1, 1970 UTC. This format is sufficient to maintain time stamps with one-second resolution past the year 2100. This is based on a longstanding UNIX-based standard for timekeeping, which represents time as the number of seconds from 00:00:00, January 1, 1970 UTC. Similar time formats are used in ANSI C.</param>
/// <returns>
/// Legal values:
/// PT_STATUS_SUCCESS : 0
/// PT_STATUS_INTERNAL_ERROR : 1
/// </returns>
public virtual uint GetLowAccuracyTimeSynch(out uint outTa0)
{
GetLowAccuracyTimeSynch_INPUT input = new GetLowAccuracyTimeSynch_INPUT(this.XmlNamespace);
GetLowAccuracyTimeSynch_OUTPUT output = new GetLowAccuracyTimeSynch_OUTPUT();
uint returnValue = base.Invoke("GetLowAccuracyTimeSynch",input,out output);
outTa0=0;
if (returnValue == 0)
{
if (output.ContainsField("Ta0"))
outTa0 = output.Ta0;
}
return returnValue;
}
/// <summary>
///This method is used to synchronize the Intel(R) AMT device's internal clock with an external clock. Intel(R) AMT Release 2.0 constrains this value to be greater than January 1 2004.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class SetHighAccuracyTimeSynch_INPUT : CimParams
{
public SetHighAccuracyTimeSynch_INPUT(string ns) : base(ns)
{
}
/// <summary>
/// Required, The time value received from invoking GetLowAccuracyTimeSynch().
/// </summary>
[CimField(false,true)]
public virtual uint Ta0
{
set
{
this.SetOrAddField("Ta0",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Required, The remote client timestamp after getting a response from GetLowAccuracyTimeSynch(). should be greater than January 1 2004.
/// </summary>
[CimField(false,true)]
public virtual uint Tm1
{
set
{
this.SetOrAddField("Tm1",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Required, The remote client timestamp obtained immediately prior to invoking this method. should be greater than January 1 2004.
/// </summary>
[CimField(false,true)]
public virtual uint Tm2
{
set
{
this.SetOrAddField("Tm2",value.ToString(CultureInfo.InvariantCulture));
}
}
}
/// <summary>
///This method is used to synchronize the Intel(R) AMT device's internal clock with an external clock. Intel(R) AMT Release 2.0 constrains this value to be greater than January 1 2004.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class SetHighAccuracyTimeSynch_OUTPUT : CimParams
{
public SetHighAccuracyTimeSynch_OUTPUT() : base("")
{
}
}
/// <summary>
///This method is used to synchronize the Intel(R) AMT device's internal clock with an external clock. Intel(R) AMT Release 2.0 constrains this value to be greater than January 1 2004.
/// </summary>
/// <param name="inTa0">Required, IN -The time value received from invoking GetLowAccuracyTimeSynch().</param>
/// <param name="inTm1">Required, IN -The remote client timestamp after getting a response from GetLowAccuracyTimeSynch(). should be greater than January 1 2004.</param>
/// <param name="inTm2">Required, IN -The remote client timestamp obtained immediately prior to invoking this method. should be greater than January 1 2004.</param>
/// <returns>
/// Legal values:
/// PT_STATUS_SUCCESS : 0
/// PT_STATUS_INTERNAL_ERROR : 1
/// PT_STATUS_INVALID_PARAMETER : 36
/// PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED : 38
/// </returns>
public virtual uint SetHighAccuracyTimeSynch(uint? inTa0,uint? inTm1,uint? inTm2)
{
SetHighAccuracyTimeSynch_INPUT input = new SetHighAccuracyTimeSynch_INPUT(this.XmlNamespace);
if (inTa0.HasValue)
input.Ta0=inTa0.Value;
if (inTm1.HasValue)
input.Tm1=inTm1.Value;
if (inTm2.HasValue)
input.Tm2=inTm2.Value;
SetHighAccuracyTimeSynch_OUTPUT output = new SetHighAccuracyTimeSynch_OUTPUT();
uint returnValue = base.Invoke("SetHighAccuracyTimeSynch",input,out output);
return returnValue;
}
/// <summary>
///This method sets the LocalTimeSyncEnabled property.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class EnableLocalTimeSync_INPUT : CimParams
{
public EnableLocalTimeSync_INPUT(string ns) : base(ns)
{
}
/// <summary>
/// Required, Determines if user with LOCAL_SYSTEM_REALM permission can set the time.
/// </summary>
[CimField(false,true)]
public virtual bool Enable
{
set
{
this.SetOrAddField("Enable",value.ToString().ToLower(CultureInfo.InvariantCulture));
}
}
}
/// <summary>
///This method sets the LocalTimeSyncEnabled property.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService", IsNullable=false)]
private class EnableLocalTimeSync_OUTPUT : CimParams
{
public EnableLocalTimeSync_OUTPUT() : base("")
{
}
}
/// <summary>
///This method sets the LocalTimeSyncEnabled property.
/// </summary>
/// <param name="inEnable">Required, IN -Determines if user with LOCAL_SYSTEM_REALM permission can set the time.</param>
/// <returns>
/// Legal values:
/// PT_STATUS_SUCCESS : 0
/// PT_STATUS_INTERNAL_ERROR : 1
/// RESERVED : 2..
/// </returns>
public virtual uint EnableLocalTimeSync(bool? inEnable)
{
EnableLocalTimeSync_INPUT input = new EnableLocalTimeSync_INPUT(this.XmlNamespace);
if (inEnable.HasValue)
input.Enable=inEnable.Value;
EnableLocalTimeSync_OUTPUT output = new EnableLocalTimeSync_OUTPUT();
uint returnValue = base.Invoke("EnableLocalTimeSync",input,out output);
return returnValue;
}
/// <summary>
/// Enumerate instances of AMT_TimeSynchronizationService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <param name="cimKeys">Keys for selecting the instances</param>
/// <returns>Collection of AMT_TimeSynchronizationService objects</returns>
public static new Collection<AMT_TimeSynchronizationService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<AMT_TimeSynchronizationService> ret = CimBase.Enumerate<AMT_TimeSynchronizationService>(client, cimKeys);
return new Collection<AMT_TimeSynchronizationService>(ret);
}
/// <summary>
/// Enumerate instances of AMT_TimeSynchronizationService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of AMT_TimeSynchronizationService objects</returns>
public static new Collection<AMT_TimeSynchronizationService> Enumerate(IWSManClient client)
{
List<AMT_TimeSynchronizationService> ret = CimBase.Enumerate<AMT_TimeSynchronizationService>(client);
return new Collection<AMT_TimeSynchronizationService>(ret);
}
/// <summary>
/// Delete the instance of AMT_TimeSynchronizationService 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<AMT_TimeSynchronizationService>(client);
}
/// <summary>
/// Represents the keys of the AMT_TimeSynchronizationService class.
/// </summary>
public new class CimKeys : CIM_Service.CimKeys
{
}
}
}