177 lines
6.0 KiB
C#
177 lines
6.0 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: CIM_Policy.cs
|
|
//
|
|
// Contents: An abstract class defining the common properties of the policy managed elements derived from CIM_Policy. The subclasses are used to create rules and groups of rules that work together to form a coherent set of policies within an administrative domain or set of domains.
|
|
// This file was automatically generated from CIM_Policy.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>
|
|
///An abstract class defining the common properties of the policy managed elements derived from CIM_Policy. The subclasses are used to create rules and groups of rules that work together to form a coherent set of policies within an administrative domain or set of domains.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_Policy")]
|
|
[System.Xml.Serialization.XmlRootAttribute("CIM_Policy", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_Policy", IsNullable=false)]
|
|
public class CIM_Policy : CIM_ManagedElement
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public CIM_Policy() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public CIM_Policy(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_Policy(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Remove CommonName field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemoveCommonName()
|
|
{
|
|
RemoveField("CommonName");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field CommonName exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool CommonNameExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("CommonName");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, A user-friendly name of this policy-related object.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual string CommonName
|
|
{
|
|
get
|
|
{
|
|
return this.GetField("CommonName")[0];
|
|
}
|
|
set
|
|
{
|
|
this.SetOrAddField("CommonName",value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Remove PolicyKeywords field.
|
|
/// Note: This method will succeed only if this field is optional in the concrete object.
|
|
/// </summary>
|
|
public virtual void RemovePolicyKeywords()
|
|
{
|
|
RemoveField("PolicyKeywords");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Is true if the field PolicyKeywords exists in the current object,
|
|
/// otherwise is false.
|
|
/// </summary>
|
|
public virtual bool PolicyKeywordsExist
|
|
{
|
|
get
|
|
{
|
|
return ContainsField("PolicyKeywords");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, An array of keywords for characterizing / categorizing policy objects. Keywords are of one of two types:
|
|
/// - Keywords defined in this and other MOFs, or in DMTF white papers. These keywords provide a vendor- independent, installation-independent way of characterizing policy objects.
|
|
/// - Installation-dependent keywords for characterizing policy objects. Examples include 'Engineering', 'Billing', and 'Review in December 2000'.
|
|
/// This MOF defines the following keywords: 'UNKNOWN', 'CONFIGURATION', 'USAGE', 'SECURITY', 'SERVICE', 'MOTIVATIONAL', 'INSTALLATION', and 'EVENT'. These concepts are self-explanatory and are further discussed in the SLA/Policy White Paper. One additional keyword is defined: 'POLICY'. The role of this keyword is to identify policy-related instances that may not be otherwise identifiable, in some implementations. The keyword 'POLICY' is NOT mutually exclusive of the other keywords specified above.
|
|
/// </summary>
|
|
[CimField(false, false)]
|
|
public virtual string[] PolicyKeywords
|
|
{
|
|
get
|
|
{
|
|
return CimTypesUtils.StringArrayToArray<string>(this["PolicyKeywords"]);
|
|
}
|
|
set
|
|
{
|
|
string[] arr = CimTypesUtils.ArrayToStringArray<string>(value);
|
|
this.SetOrAddField("PolicyKeywords", arr);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_Policy 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_Policy objects</returns>
|
|
public static new Collection<CIM_Policy> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<CIM_Policy> ret = CimBase.Enumerate<CIM_Policy>(client, cimKeys);
|
|
return new Collection<CIM_Policy>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_Policy class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of CIM_Policy objects</returns>
|
|
public static new Collection<CIM_Policy> Enumerate(IWSManClient client)
|
|
{
|
|
List<CIM_Policy> ret = CimBase.Enumerate<CIM_Policy>(client);
|
|
return new Collection<CIM_Policy>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of CIM_Policy 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_Policy>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the CIM_Policy class.
|
|
/// </summary>
|
|
|
|
public new class CimKeys : CIM_ManagedElement.CimKeys
|
|
{
|
|
}
|
|
|
|
}
|
|
}
|
|
|