219 lines
10 KiB
C#
219 lines
10 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
|
|
//
|
|
// File: CIM_AccountManagementService.cs
|
|
//
|
|
// Contents: CIM_AccountManagementService creates, manages, and if necessary destroys Accounts on behalf of other SecuritySerices.
|
|
// This file was automatically generated from CIM_AccountManagementService.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>
|
|
///CIM_AccountManagementService creates, manages, and if necessary destroys Accounts on behalf of other SecuritySerices.
|
|
/// </summary>
|
|
[System.SerializableAttribute()]
|
|
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AccountManagementService")]
|
|
[System.Xml.Serialization.XmlRootAttribute("CIM_AccountManagementService", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AccountManagementService", IsNullable=false)]
|
|
public class CIM_AccountManagementService : CIM_SecurityService
|
|
{
|
|
/// <summary>
|
|
/// Default constructor.
|
|
/// </summary>
|
|
public CIM_AccountManagementService() :base()
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Constructor that recieves an xml string for deserialization.
|
|
/// </summary>
|
|
/// <param name="xml">xml string to deserialize</param>
|
|
public CIM_AccountManagementService(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_AccountManagementService(IWSManClient client): base(client)
|
|
{
|
|
}
|
|
/// <summary>
|
|
///CreateAccount creates an Account on the specified ComputerSystem. Upon successful completion of the method, there shall be a newly created instance of CIM_Account associated through the CIM_AccountOnSystem association with the instance of ComputerSystem identified by the System parameter such that each property of the CIM_Account instance has the value of the corresponding property of the template instance specified by the AccountTemplate parameter and the CIM_Account instance is associated with this instance of CIM_AccountManagementService through the CIM_ServiceAffectsElement association.
|
|
///Instances of CIM_Identity may be created by the method and associated with the instance of CIM_Account through CIM_AssignedIdentity. If one or more instances of CIM_Identity are created, a reference to each shall be returned in the Identities parameter, otherwise the Identities parameter shall be NULL upon method completion.
|
|
/// </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_AccountManagementService", IsNullable=false)]
|
|
private class CreateAccount_INPUT : CimParams
|
|
{
|
|
public CreateAccount_INPUT(string ns) : base(ns)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Required, The scoping ComputerSystem in which to create the Account.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual CimReference System
|
|
{
|
|
set
|
|
{
|
|
this.SetOrAddField("System",value.Serialize(false));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Required, AccountTemplate is a template for the desired Account to be created.
|
|
/// </summary>
|
|
[CimField(false,true)]
|
|
public virtual CIM_Account AccountTemplate
|
|
{
|
|
set
|
|
{
|
|
this.SetOrAddField("AccountTemplate",value.SerializeInner());
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
///CreateAccount creates an Account on the specified ComputerSystem. Upon successful completion of the method, there shall be a newly created instance of CIM_Account associated through the CIM_AccountOnSystem association with the instance of ComputerSystem identified by the System parameter such that each property of the CIM_Account instance has the value of the corresponding property of the template instance specified by the AccountTemplate parameter and the CIM_Account instance is associated with this instance of CIM_AccountManagementService through the CIM_ServiceAffectsElement association.
|
|
///Instances of CIM_Identity may be created by the method and associated with the instance of CIM_Account through CIM_AssignedIdentity. If one or more instances of CIM_Identity are created, a reference to each shall be returned in the Identities parameter, otherwise the Identities parameter shall be NULL upon method completion.
|
|
/// </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_AccountManagementService", IsNullable=false)]
|
|
private class CreateAccount_OUTPUT : CimParams
|
|
{
|
|
public CreateAccount_OUTPUT() : base("")
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Optional, Reference to the instance of CIM_Account created when the method returns a value of 0.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual CimReference Account
|
|
{
|
|
get
|
|
{
|
|
string innerXML = this.GetField("Account")[0];
|
|
CimReference epr = new CimReference("Account", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AccountManagementService", innerXML);
|
|
return epr;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Optional, Reference to the instances of CIM_Identity created when the method returns a value of 0. NULL if no such instances are created.
|
|
/// </summary>
|
|
[CimField(false,false)]
|
|
public virtual CimReference[] Identities
|
|
{
|
|
get
|
|
{
|
|
string[] strArray = this.GetField("Identities");
|
|
CimReference[] eprArray = new CimReference[strArray.Length];
|
|
for (int i = 0; i < strArray.Length; i++)
|
|
{
|
|
string innerXML = strArray[i];
|
|
CimReference tmpEPR = new CimReference("Identities", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AccountManagementService", innerXML);
|
|
eprArray.SetValue(tmpEPR, i);
|
|
}
|
|
return eprArray;
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
///CreateAccount creates an Account on the specified ComputerSystem. Upon successful completion of the method, there shall be a newly created instance of CIM_Account associated through the CIM_AccountOnSystem association with the instance of ComputerSystem identified by the System parameter such that each property of the CIM_Account instance has the value of the corresponding property of the template instance specified by the AccountTemplate parameter and the CIM_Account instance is associated with this instance of CIM_AccountManagementService through the CIM_ServiceAffectsElement association.
|
|
///Instances of CIM_Identity may be created by the method and associated with the instance of CIM_Account through CIM_AssignedIdentity. If one or more instances of CIM_Identity are created, a reference to each shall be returned in the Identities parameter, otherwise the Identities parameter shall be NULL upon method completion.
|
|
/// </summary>
|
|
/// <param name="inSystem">Required, IN -The scoping ComputerSystem in which to create the Account.</param>
|
|
/// <param name="inAccountTemplate">Required, IN -AccountTemplate is a template for the desired Account to be created.</param>
|
|
/// <param name="outAccount">OUT - Reference to the instance of CIM_Account created when the method returns a value of 0.</param>
|
|
/// <param name="outIdentities">OUT - Reference to the instances of CIM_Identity created when the method returns a value of 0. NULL if no such instances are created.</param>
|
|
/// <returns>
|
|
/// Legal values:
|
|
/// Completed with No Error : 0
|
|
/// Not Supported : 1
|
|
/// Failed : 2
|
|
/// Method Reserved : ..
|
|
/// Vendor Specific : 32768..65535
|
|
/// </returns>
|
|
public virtual uint CreateAccount(CimReference inSystem,CIM_Account inAccountTemplate,out CimReference outAccount,out CimReference[] outIdentities)
|
|
{
|
|
CreateAccount_INPUT input = new CreateAccount_INPUT(this.XmlNamespace);
|
|
if (inSystem != null)
|
|
input.System=inSystem;
|
|
if (inAccountTemplate != null)
|
|
input.AccountTemplate=inAccountTemplate;
|
|
CreateAccount_OUTPUT output = new CreateAccount_OUTPUT();
|
|
uint returnValue = base.Invoke("CreateAccount",input,out output);
|
|
outAccount=null;
|
|
outIdentities=null;
|
|
if (returnValue == 0)
|
|
{
|
|
if (output.ContainsField("Account"))
|
|
outAccount = output.Account;
|
|
if (output.ContainsField("Identities"))
|
|
outIdentities = output.Identities;
|
|
}
|
|
return returnValue;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_AccountManagementService 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_AccountManagementService objects</returns>
|
|
public static new Collection<CIM_AccountManagementService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
|
|
{
|
|
List<CIM_AccountManagementService> ret = CimBase.Enumerate<CIM_AccountManagementService>(client, cimKeys);
|
|
return new Collection<CIM_AccountManagementService>(ret);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerate instances of CIM_AccountManagementService class at an endpoint.
|
|
/// </summary>
|
|
/// <param name="client">WS-Management client</param>
|
|
/// <returns>Collection of CIM_AccountManagementService objects</returns>
|
|
public static new Collection<CIM_AccountManagementService> Enumerate(IWSManClient client)
|
|
{
|
|
List<CIM_AccountManagementService> ret = CimBase.Enumerate<CIM_AccountManagementService>(client);
|
|
return new Collection<CIM_AccountManagementService>(ret);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Delete the instance of CIM_AccountManagementService 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_AccountManagementService>(client);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Represents the keys of the CIM_AccountManagementService class.
|
|
/// </summary>
|
|
|
|
public new class CimKeys : CIM_SecurityService.CimKeys
|
|
{
|
|
}
|
|
|
|
}
|
|
}
|
|
|