|
From: <np...@us...> - 2007-09-10 16:38:45
|
Revision: 488
http://omc.svn.sourceforge.net/omc/?rev=488&view=rev
Author: npaxton
Date: 2007-09-10 09:38:45 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
simpleIdentity initial checkin, under new top-level pyprofiles
Added Paths:
-----------
pyprofiles/
pyprofiles/simpleIdentity/
pyprofiles/simpleIdentity/MANIFEST
pyprofiles/simpleIdentity/OMC_Account.mof
pyprofiles/simpleIdentity/OMC_Account.py
pyprofiles/simpleIdentity/OMC_Account.reg
pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof
pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py
pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg
pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof
pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py
pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg
pyprofiles/simpleIdentity/OMC_AccountOnSystem.mof
pyprofiles/simpleIdentity/OMC_AccountOnSystem.py
pyprofiles/simpleIdentity/OMC_AccountOnSystem.reg
pyprofiles/simpleIdentity/OMC_AssignedIdentity.mof
pyprofiles/simpleIdentity/OMC_AssignedIdentity.py
pyprofiles/simpleIdentity/OMC_AssignedIdentity.reg
pyprofiles/simpleIdentity/OMC_Identity.mof
pyprofiles/simpleIdentity/OMC_Identity.py
pyprofiles/simpleIdentity/OMC_Identity.reg
pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedService.mof
pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedService.reg
pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py
pyprofiles/simpleIdentity/OMC_UserAccountManagementService.mof
pyprofiles/simpleIdentity/OMC_UserAccountManagementService.reg
pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py
pyprofiles/simpleIdentity/omc-simple-identity-management-provider.spec
pyprofiles/simpleIdentity/setup.py
Added: pyprofiles/simpleIdentity/MANIFEST
===================================================================
--- pyprofiles/simpleIdentity/MANIFEST (rev 0)
+++ pyprofiles/simpleIdentity/MANIFEST 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,25 @@
+OMC_Account.mof
+OMC_Account.py
+OMC_Account.reg
+OMC_AccountElementCapabilities.mof
+OMC_AccountElementCapabilities.py
+OMC_AccountElementCapabilities.reg
+OMC_AccountManagementCapabilities.mof
+OMC_AccountManagementCapabilities.py
+OMC_AccountManagementCapabilities.reg
+OMC_AccountOnSystem.mof
+OMC_AccountOnSystem.py
+OMC_AccountOnSystem.reg
+OMC_AssignedIdentity.mof
+OMC_AssignedIdentity.py
+OMC_AssignedIdentity.reg
+OMC_Identity.mof
+OMC_Identity.py
+OMC_Identity.reg
+OMC_UserAccntMgmtHostedService.mof
+OMC_UserAccntMgmtHostedService.reg
+OMC_UserAccntMgmtHostedServiceProvider.py
+OMC_UserAccountManagementService.mof
+OMC_UserAccountManagementService.reg
+OMC_UserAccountManagementServiceProvider.py
+setup.py
Property changes on: pyprofiles/simpleIdentity/MANIFEST
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_Account.mof
===================================================================
--- pyprofiles/simpleIdentity/OMC_Account.mof (rev 0)
+++ pyprofiles/simpleIdentity/OMC_Account.mof 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,4 @@
+[Description("Model a Account class for getting user information")]
+class OMC_Account : CIM_Account
+{
+};
Property changes on: pyprofiles/simpleIdentity/OMC_Account.mof
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_Account.py
===================================================================
--- pyprofiles/simpleIdentity/OMC_Account.py (rev 0)
+++ pyprofiles/simpleIdentity/OMC_Account.py 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,414 @@
+"""Python Provider for OMC_Account
+
+Instruments the CIM class OMC_Account
+
+"""
+
+import pywbem
+import pwd
+import os
+from socket import getfqdn
+
+class OMC_AccountProvider(pywbem.CIMProvider):
+ """Instrument the CIM class OMC_Account
+
+ Model a Account class for getting user information
+
+ """
+
+ def __init__ (self, env):
+ logger = env.get_logger()
+ logger.log_debug('Initializing provider %s from %s' \
+ % (self.__class__.__name__, __file__))
+ # If you will be filtering instances yourself according to
+ # property_list, role, result_role, and result_class_name
+ # parameters, set self.filter_results to False
+ # self.filter_results = False
+
+ def get_instance(self, env, model, cim_class):
+ """Return an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstance to be returned. The
+ key properties are set on this instance to correspond to the
+ instanceName that was requested. The properties of the model
+ are already filtered according to the PropertyList from the
+ request. Only properties present in the model need to be
+ given values. If you prefer, you can set all of the
+ values, and the instance will be filtered for you.
+ cim_class -- The pywbem.CIMClass
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.get_instance()' \
+ % self.__class__.__name__)
+ for userinfo in pwd.getpwall():
+ if model['Name'] == userinfo[0]:
+ model['UserPassword'] = userinfo[1]
+ model['UserID'] = str(userinfo[2])
+ model['ElementName'] = userinfo[4]+ ':' + userinfo[0]
+ model['OrganizationName'] = 'Novell'
+ break
+
+ #model['Caption'] = # TODO (type = unicode)
+ #model['ComplexPasswordRulesEnforced'] = # TODO (type = [pywbem.Uint16,] self.Values.ComplexPasswordRulesEnforced)
+ #model['Description'] = # TODO (type = unicode)
+ #model['Descriptions'] = # TODO (type = [unicode,])
+ #model['ElementName'] = # TODO (type = unicode)
+ #model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L)
+ #model['EnabledState'] = # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L)
+ #model['HealthState'] = # TODO (type = pywbem.Uint16 self.Values.HealthState)
+ #model['Host'] = # TODO (type = [unicode,])
+ #model['InactivityTimeout'] = # TODO (type = pywbem.CIMDateTime)
+ #model['InstallDate'] = # TODO (type = pywbem.CIMDateTime)
+ #model['LastLogin'] = # TODO (type = pywbem.CIMDateTime)
+ #model['LocalityName'] = # TODO (type = [unicode,])
+ #model['MaximumSuccessiveLoginFailures'] = # TODO (type = pywbem.Uint16)
+ #model['ObjectClass'] = # TODO (type = [unicode,])
+ #model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus)
+ #model['OrganizationName'] = # TODO (type = [unicode,]) (Required)
+ #model['OtherEnabledState'] = # TODO (type = unicode)
+ #model['OU'] = # TODO (type = [unicode,])
+ #model['PasswordExpiration'] = # TODO (type = pywbem.CIMDateTime)
+ #model['PasswordHistoryDepth'] = # TODO (type = pywbem.Uint16)
+ #model['RequestedState'] = # TODO (type = pywbem.Uint16 self.Values.RequestedState) (default=12L)
+ #model['SeeAlso'] = # TODO (type = [unicode,])
+ #model['Status'] = # TODO (type = unicode self.Values.Status)
+ #model['StatusDescriptions'] = # TODO (type = [unicode,])
+ #model['TimeOfLastStateChange'] = # TODO (type = pywbem.CIMDateTime)
+ #model['UserCertificate'] = # TODO (type = [unicode,])
+ #model['UserID'] = # TODO (type = unicode)
+ #model['UserPassword'] = # TODO (type = [unicode,])
+ return model
+
+ def enum_instances(self, env, model, cim_class, keys_only):
+ """Enumerate instances.
+
+ The WBEM operations EnumerateInstances and EnumerateInstanceNames
+ are both mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstances to be generated.
+ The properties of the model are already filtered according to
+ the PropertyList from the request. Only properties present in
+ the model need to be given values. If you prefer, you can
+ always set all of the values, and the instance will be filtered
+ for you.
+ cim_class -- The pywbem.CIMClass
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ Possible Errors:
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.enum_instances()' \
+ % self.__class__.__name__)
+
+ #while False: # TODO more instances?
+ # TODO fetch system resource
+ # Key properties
+ #model['SystemName'] = # TODO (type = unicode)
+ #model['SystemCreationClassName'] = # TODO (type = unicode)
+ model['CreationClassName'] = 'OMC_Account'
+ model['SystemCreationClassName'] = 'OMC_UnitaryComputerSystem'
+ model['SystemName'] = getfqdn()
+ for userinfo in pwd.getpwall():
+ model['Name'] = userinfo[0]
+ #model['Name'] = # TODO (type = unicode)
+ if keys_only:
+ yield model
+ else:
+ try:
+ yield self.get_instance(env, model, cim_class)
+ except pywbem.CIMError, (num, msg):
+ if num not in (pywbem.CIM_ERR_NOT_FOUND,
+ pywbem.CIM_ERR_ACCESS_DENIED):
+ raise
+
+ def set_instance(self, env, instance, previous_instance, cim_class):
+ """Return a newly created or modified instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance -- The new pywbem.CIMInstance. If modifying an existing
+ instance, the properties on this instance have been filtered by
+ the PropertyList from the request.
+ previous_instance -- The previous pywbem.CIMInstance if modifying
+ an existing instance. None if creating a new instance.
+ cim_class -- The pywbem.CIMClass
+
+ Return the new instance. The keys must be set on the new instance.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
+ valid if previous_instance is None, indicating that the operation
+ was CreateInstance)
+ CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
+ if previous_instance is not None, indicating that the operation
+ was ModifyInstance)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.set_instance()' \
+ % self.__class__.__name__)
+ # TODO create or modify the instance
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+ return instance
+
+ def delete_instance(self, env, instance_name):
+ """Delete an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance_name -- A pywbem.CIMInstanceName specifying the instance
+ to delete.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
+ namespace)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.delete_instance()' \
+ % self.__class__.__name__)
+
+ # TODO delete the resource
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+
+ def cim_method_requeststatechange(self, env, object_name, method,
+ param_requestedstate,
+ param_timeoutperiod):
+ """Implements OMC_Account.RequestStateChange()
+
+ Requests that the state of the element be changed to the value
+ specified in the RequestedState parameter. When the requested
+ state change takes place, the EnabledState and RequestedState of
+ the element will be the same. Invoking the RequestStateChange
+ method multiple times could result in earlier requests being
+ overwritten or lost. If 0 is returned, then the task completed
+ successfully and the use of ConcreteJob was not required. If 4096
+ (0x1000) is returned, then the task will take some time to
+ complete, ConcreteJob will be created, and its reference returned
+ in the output parameter Job. Any other return code indicates an
+ error condition.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName
+ specifying the object on which the method RequestStateChange()
+ should be invoked.
+ method -- A pywbem.CIMMethod representing the method meta-data
+ param_requestedstate -- The input parameter RequestedState (type pywbem.Uint16 self.Values.RequestStateChange.RequestedState)
+ The state requested for the element. This information will be
+ placed into the RequestedState property of the instance if the
+ return code of the RequestStateChange method is 0 ('Completed
+ with No Error'), 3 ('Timeout'), or 4096 (0x1000) ('Job
+ Started'). Refer to the description of the EnabledState and
+ RequestedState properties for the detailed explanations of the
+ RequestedState values.
+
+ param_timeoutperiod -- The input parameter TimeoutPeriod (type pywbem.CIMDateTime)
+ 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.
+
+
+ Returns a two-tuple containing the return value (type pywbem.Uint32 self.Values.RequestStateChange)
+ and a dictionary with the out-parameters
+
+ Output parameters:
+ Job -- (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...))
+ Reference to the job (can be null if the task is completed).
+
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate,
+ unrecognized or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the target CIM Class or instance does not
+ exist in the specified namespace)
+ CIM_ERR_METHOD_NOT_AVAILABLE (the CIM Server is unable to honor
+ the invocation request)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.cim_method_requeststatechange()' \
+ % self.__class__.__name__)
+
+ # TODO do something
+ raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented
+ out_params = {}
+ #out_params['job'] = # TODO (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...))
+ rval = None # TODO (type pywbem.Uint32 self.Values.RequestStateChange)
+ return (rval, out_params)
+
+ class Values(object):
+ class Status(object):
+ OK = 'OK'
+ Error = 'Error'
+ Degraded = 'Degraded'
+ Unknown = 'Unknown'
+ Pred_Fail = 'Pred Fail'
+ Starting = 'Starting'
+ Stopping = 'Stopping'
+ Service = 'Service'
+ Stressed = 'Stressed'
+ NonRecover = 'NonRecover'
+ No_Contact = 'No Contact'
+ Lost_Comm = 'Lost Comm'
+ Stopped = 'Stopped'
+
+ class RequestedState(object):
+ Enabled = pywbem.Uint16(2)
+ Disabled = pywbem.Uint16(3)
+ Shut_Down = pywbem.Uint16(4)
+ No_Change = pywbem.Uint16(5)
+ Offline = pywbem.Uint16(6)
+ Test = pywbem.Uint16(7)
+ Deferred = pywbem.Uint16(8)
+ Quiesce = pywbem.Uint16(9)
+ Reboot = pywbem.Uint16(10)
+ Reset = pywbem.Uint16(11)
+ Not_Applicable = pywbem.Uint16(12)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 32768..65535
+
+ class HealthState(object):
+ Unknown = pywbem.Uint16(0)
+ OK = pywbem.Uint16(5)
+ Degraded_Warning = pywbem.Uint16(10)
+ Minor_failure = pywbem.Uint16(15)
+ Major_failure = pywbem.Uint16(20)
+ Critical_failure = pywbem.Uint16(25)
+ Non_recoverable_error = pywbem.Uint16(30)
+ # DMTF_Reserved = ..
+
+ class EnabledDefault(object):
+ Enabled = pywbem.Uint16(2)
+ Disabled = pywbem.Uint16(3)
+ Not_Applicable = pywbem.Uint16(5)
+ Enabled_but_Offline = pywbem.Uint16(6)
+ No_Default = pywbem.Uint16(7)
+ Quiesce = pywbem.Uint16(9)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 32768..65535
+
+ class EnabledState(object):
+ Unknown = pywbem.Uint16(0)
+ Other = pywbem.Uint16(1)
+ Enabled = pywbem.Uint16(2)
+ Disabled = pywbem.Uint16(3)
+ Shutting_Down = pywbem.Uint16(4)
+ Not_Applicable = pywbem.Uint16(5)
+ Enabled_but_Offline = pywbem.Uint16(6)
+ In_Test = pywbem.Uint16(7)
+ Deferred = pywbem.Uint16(8)
+ Quiesce = pywbem.Uint16(9)
+ Starting = pywbem.Uint16(10)
+ # DMTF_Reserved = 11..32767
+ # Vendor_Reserved = 32768..65535
+
+ class ComplexPasswordRulesEnforced(object):
+ Minimum_Length = pywbem.Uint16(2)
+ Preclude_User_ID_Inclusion = pywbem.Uint16(3)
+ Maximum_Repeating_Characters = pywbem.Uint16(4)
+ Lower_Case_Alpha = pywbem.Uint16(5)
+ Upper_Case_Alpha = pywbem.Uint16(6)
+ Numeric_Character = pywbem.Uint16(7)
+ Special_Character = pywbem.Uint16(8)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 0x8000..0xFFFF
+
+ class OperationalStatus(object):
+ Unknown = pywbem.Uint16(0)
+ Other = pywbem.Uint16(1)
+ OK = pywbem.Uint16(2)
+ Degraded = pywbem.Uint16(3)
+ Stressed = pywbem.Uint16(4)
+ Predictive_Failure = pywbem.Uint16(5)
+ Error = pywbem.Uint16(6)
+ Non_Recoverable_Error = pywbem.Uint16(7)
+ Starting = pywbem.Uint16(8)
+ Stopping = pywbem.Uint16(9)
+ Stopped = pywbem.Uint16(10)
+ In_Service = pywbem.Uint16(11)
+ No_Contact = pywbem.Uint16(12)
+ Lost_Communication = pywbem.Uint16(13)
+ Aborted = pywbem.Uint16(14)
+ Dormant = pywbem.Uint16(15)
+ Supporting_Entity_in_Error = pywbem.Uint16(16)
+ Completed = pywbem.Uint16(17)
+ Power_Mode = pywbem.Uint16(18)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 0x8000..
+
+ class RequestStateChange(object):
+ Completed_with_No_Error = pywbem.Uint32(0)
+ Not_Supported = pywbem.Uint32(1)
+ Unknown_or_Unspecified_Error = pywbem.Uint32(2)
+ Cannot_complete_within_Timeout_Period = pywbem.Uint32(3)
+ Failed = pywbem.Uint32(4)
+ Invalid_Parameter = pywbem.Uint32(5)
+ In_Use = pywbem.Uint32(6)
+ # DMTF_Reserved = ..
+ Method_Parameters_Checked___Job_Started = pywbem.Uint32(4096)
+ Invalid_State_Transition = pywbem.Uint32(4097)
+ Use_of_Timeout_Parameter_Not_Supported = pywbem.Uint32(4098)
+ Busy = pywbem.Uint32(4099)
+ # Method_Reserved = 4100..32767
+ # Vendor_Specific = 32768..65535
+ class RequestedState(object):
+ Enabled = pywbem.Uint16(2)
+ Disabled = pywbem.Uint16(3)
+ Shut_Down = pywbem.Uint16(4)
+ Offline = pywbem.Uint16(6)
+ Test = pywbem.Uint16(7)
+ Defer = pywbem.Uint16(8)
+ Quiesce = pywbem.Uint16(9)
+ Reboot = pywbem.Uint16(10)
+ Reset = pywbem.Uint16(11)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 32768..65535
+
+## end of class OMC_AccountProvider
+
+def get_providers(env):
+ omc_account_prov = OMC_AccountProvider(env)
+ return {'OMC_Account': omc_account_prov}
Property changes on: pyprofiles/simpleIdentity/OMC_Account.py
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_Account.reg
===================================================================
--- pyprofiles/simpleIdentity/OMC_Account.reg (rev 0)
+++ pyprofiles/simpleIdentity/OMC_Account.reg 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,9 @@
+// Provider registration for OMC_Account
+instance of OpenWBEM_PyProviderRegistration
+{
+ InstanceID = "OMC:OMC_Account:01";
+ NamespaceNames = {"root/cimv2"};
+ ClassName = "OMC_Account";
+ ProviderTypes = {1,6}; // Instance, Method
+ ModulePath = "/usr/lib/pycim/OMC_Account.py";
+};
Property changes on: pyprofiles/simpleIdentity/OMC_Account.reg
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,11 @@
+[Association,Description("Relationship between a UserAccountService and UserAccountCapabilities")]
+class OMC_AccountElementCapabilities : CIM_ElementCapabilities
+{
+ [Key,Description ("Capabilities of the User Account service")]
+ OMC_AccountManagementCapabilities REF Capabilities;
+
+ [Key, Min(1),Description ("The user account service")]
+ OMC_UserAccountManagementService REF ManagedElement;
+
+
+};
Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,286 @@
+"""Python Provider for OMC_AccountElementCapabilities
+
+Instruments the CIM class OMC_AccountElementCapabilities
+
+"""
+
+import pywbem
+
+class OMC_AccountElementCapabilitiesProvider(pywbem.CIMProvider):
+ """Instrument the CIM class OMC_AccountElementCapabilities
+
+ Relationship between a UserAccountService and UserAccountCapabilities
+
+ """
+
+ def __init__ (self, env):
+ logger = env.get_logger()
+ logger.log_debug('Initializing provider %s from %s' \
+ % (self.__class__.__name__, __file__))
+ # If you will be filtering instances yourself according to
+ # property_list, role, result_role, and result_class_name
+ # parameters, set self.filter_results to False
+ # self.filter_results = False
+
+ def get_instance(self, env, model, cim_class):
+ """Return an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstance to be returned. The
+ key properties are set on this instance to correspond to the
+ instanceName that was requested. The properties of the model
+ are already filtered according to the PropertyList from the
+ request. Only properties present in the model need to be
+ given values. If you prefer, you can set all of the
+ values, and the instance will be filtered for you.
+ cim_class -- The pywbem.CIMClass
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.get_instance()' \
+ % self.__class__.__name__)
+
+ #model['Characteristics'] = # TODO (type = [pywbem.Uint16,] self.Values.Characteristics)
+ return model
+
+ def enum_instances(self, env, model, cim_class, keys_only):
+ """Enumerate instances.
+
+ The WBEM operations EnumerateInstances and EnumerateInstanceNames
+ are both mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstances to be generated.
+ The properties of the model are already filtered according to
+ the PropertyList from the request. Only properties present in
+ the model need to be given values. If you prefer, you can
+ always set all of the values, and the instance will be filtered
+ for you.
+ cim_class -- The pywbem.CIMClass
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ Possible Errors:
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.enum_instances()' \
+ % self.__class__.__name__)
+ ch = env.get_cimom_handle()
+ """ There is always one instance of OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """
+ capabilityInstanceName = pywbem.CIMInstanceName(classname='OMC_AccountManagementCapabilities',
+ namespace=model.path.namespace,
+ keybindings={'InstanceID':'OMC:AccountCapability'})
+ model['Capabilities'] = capabilityInstanceName
+ serviceList = []
+ try:
+ """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """
+ ch.EnumerateInstances('OMC_UserAccountManagementService', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:serviceList.append(inst))
+ except:
+ return
+ for serviceInstance in serviceList:
+ if(serviceInstance['CreationClassName'] == 'OMC_UserAccountManagementService'):
+ model['ManagedElement'] = serviceInstance.path
+ if keys_only:
+ yield model
+ else:
+ try:
+ yield self.get_instance(env, model, cim_class)
+ except pywbem.CIMError, (num, msg):
+ if num not in (pywbem.CIM_ERR_NOT_FOUND,
+ pywbem.CIM_ERR_ACCESS_DENIED):
+ raise
+
+ def set_instance(self, env, instance, previous_instance, cim_class):
+ """Return a newly created or modified instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance -- The new pywbem.CIMInstance. If modifying an existing
+ instance, the properties on this instance have been filtered by
+ the PropertyList from the request.
+ previous_instance -- The previous pywbem.CIMInstance if modifying
+ an existing instance. None if creating a new instance.
+ cim_class -- The pywbem.CIMClass
+
+ Return the new instance. The keys must be set on the new instance.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
+ valid if previous_instance is None, indicating that the operation
+ was CreateInstance)
+ CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
+ if previous_instance is not None, indicating that the operation
+ was ModifyInstance)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.set_instance()' \
+ % self.__class__.__name__)
+ # TODO create or modify the instance
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+ return instance
+
+ def delete_instance(self, env, instance_name):
+ """Delete an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance_name -- A pywbem.CIMInstanceName specifying the instance
+ to delete.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
+ namespace)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.delete_instance()' \
+ % self.__class__.__name__)
+
+ # TODO delete the resource
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+
+ def references(self, env, object_name, model, assoc_class,
+ result_class_name, role, result_role, keys_only):
+ """Instrument Associations.
+
+ All four association-related operations (Associators, AssociatorNames,
+ References, ReferenceNames) are mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ object_name -- A pywbem.CIMInstanceName that defines the source
+ CIM Object whose associated Objects are to be returned.
+ model -- A template pywbem.CIMInstance to serve as a model
+ of the objects to be returned. Only properties present on this
+ model need to be set.
+ assoc_class -- The pywbem.CIMClass.
+ result_class_name -- If not empty, this string acts as a filter on
+ the returned set of Instances by mandating that each returned
+ Instances MUST represent an association between object_name
+ and an Instance of a Class whose name matches this parameter
+ or a subclass.
+ role -- If not empty, MUST be a valid Property name. It acts as a
+ filter on the returned set of Instances by mandating that each
+ returned Instance MUST refer to object_name via a Property
+ whose name matches the value of this parameter.
+ result_role -- If not empty, MUST be a valid Property name. It acts
+ as a filter on the returned set of Instances by mandating that
+ each returned Instance MUST represent associations of
+ object_name to other Instances, where the other Instances play
+ the specified result_role in the association (i.e. the
+ name of the Property in the Association Class that refers to
+ the Object related to object_name MUST match the value of this
+ parameter).
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ The following diagram may be helpful in understanding the role,
+ result_role, and result_class_name parameters.
+ +------------------------+ +-------------------+
+ | object_name.classname | | result_class_name |
+ | ~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~ |
+ +------------------------+ +-------------------+
+ | +-----------------------------------+ |
+ | | [Association] assoc_class | |
+ | object_name | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ +--------------+ object_name.classname REF role | |
+ (CIMInstanceName) | result_class_name REF result_role +------+
+ | |(CIMInstanceName)
+ +-----------------------------------+
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.references()' \
+ % self.__class__.__name__)
+ ch = env.get_cimom_handle()
+ # This is a common pattern. YMMV
+ if (not role or role.lower() == 'capabilities') and \
+ pywbem.is_subclass(ch, object_name.namespace,
+ sub=object_name.classname,
+ super='OMC_AccountManagementCapabilities'):
+ model['Capabilities'] = object_name
+ serviceList = []
+ try:
+ """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """
+ ch.EnumerateInstances('OMC_UserAccountManagementService', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:serviceList.append(inst))
+ except:
+ return
+ for serviceInstance in serviceList:
+ if(serviceInstance['CreationClassName'] == 'OMC_UserAccountManagementService'):
+ model['ManagedElement'] = serviceInstance.path
+ yield model # TODO: Yield association instances where
+ # object_name is capabilities.
+ # Only appropriate if object_name.classname
+ # is 'OMC_AccountManagementCapabilities' or a subclass.
+
+ if (not role or role.lower() == 'managedelement') and \
+ pywbem.is_subclass(ch, object_name.namespace,
+ sub=object_name.classname,
+ super='OMC_UserAccountManagementService'):
+ model['ManagedElement'] = object_name
+ capabilityList = []
+ try:
+ """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """
+ ch.EnumerateInstances('OMC_AccountManagementCapabilities', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:capabilityList.append(inst))
+ except:
+ return
+ for capabilityInstance in capabilityList:
+ if(capabilityInstance['InstanceID'] == 'OMC:AccountCapability'):
+ model['Capabilities'] = capabilityInstance.path
+ yield model # TODO: Yield association instances where
+ # object_name is managedelement.
+ # Only appropriate if object_name.classname
+ # is 'OMC_UserAccountManagementService' or a subclass.
+
+ class Values(object):
+ class Characteristics(object):
+ Default = pywbem.Uint16(2)
+ Current = pywbem.Uint16(3)
+ # DMTF_Reserved = ..
+ # Vendor_Specific = 32768..65535
+
+## end of class OMC_AccountElementCapabilitiesProvider
+
+def get_providers(env):
+ omc_accountelementcapabilities_prov = OMC_AccountElementCapabilitiesProvider(env)
+ return {'OMC_AccountElementCapabilities': omc_accountelementcapabilities_prov}
Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,9 @@
+// Provider registration for OMC_ElementCapabilities
+instance of OpenWBEM_PyProviderRegistration
+{
+ InstanceID = "OMC:OMC_AccountElementCapabilities:01";
+ NamespaceNames = {"root/cimv2"};
+ ClassName = "OMC_AccountElementCapabilities";
+ ProviderTypes = {1,3}; // Instance, Associator
+ ModulePath = "/usr/lib/pycim/OMC_AccountElementCapabilities.py";
+};
Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,14 @@
+// <change cr="WIPCR00316.003" type="add">new class.</change>
+// ==================================================================
+// OMC_AccountManagementCapabilities
+// ==================================================================
+[Description (
+ "AccountManagementCapabilities describes the capabilities "
+ "supported for managing Accounts associated with an instance of "
+ "AccountManagementService. AccountManagementCapabilities is "
+ "associated with an instance of AccountManagementService "
+ "through the ElementCapabilities association.")]
+class OMC_AccountManagementCapabilities : CIM_AccountManagementCapabilities {
+
+};
+
Property changes on: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,355 @@
+"""Python Provider for OMC_AccountManagementCapabilities
+
+Instruments the CIM class OMC_AccountManagementCapabilities
+
+"""
+
+import pywbem
+import pwd
+
+class OMC_AccountManagementCapabilitiesProvider(pywbem.CIMProvider):
+ """Instrument the CIM class OMC_AccountManagementCapabilities
+
+ AccountManagementCapabilities describes the capabilities supported for
+ managing Accounts associated with an instance of
+ AccountManagementService. AccountManagementCapabilities is associated
+ with an instance of AccountManagementService through the
+ ElementCapabilities association.
+
+ """
+
+ def __init__ (self, env):
+ logger = env.get_logger()
+ logger.log_debug('Initializing provider %s from %s' \
+ % (self.__class__.__name__, __file__))
+ # If you will be filtering instances yourself according to
+ # property_list, role, result_role, and result_class_name
+ # parameters, set self.filter_results to False
+ # self.filter_results = False
+
+ def get_instance(self, env, model, cim_class):
+ """Return an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstance to be returned. The
+ key properties are set on this instance to correspond to the
+ instanceName that was requested. The properties of the model
+ are already filtered according to the PropertyList from the
+ request. Only properties present in the model need to be
+ given values. If you prefer, you can set all of the
+ values, and the instance will be filtered for you.
+ cim_class -- The pywbem.CIMClass
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.get_instance()' \
+ % self.__class__.__name__)
+
+ #model['Caption'] = # TODO (type = unicode)
+ #model['Description'] = # TODO (type = unicode)
+ #model['ElementName'] = # TODO (type = unicode) (Required)
+ #model['ElementNameEditSupported'] = # TODO (type = bool)
+ #model['ElementNameMask'] = # TODO (type = unicode)
+ #model['MaxElementNameLen'] = # TODO (type = pywbem.Uint16)
+ #model['OperationsSupported'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationsSupported)
+ model['ElementName'] = 'AccountManagementCapability'
+ model['ElementNameEditSupported'] = False
+ return model
+
+ def enum_instances(self, env, model, cim_class, keys_only):
+ """Enumerate instances.
+
+ The WBEM operations EnumerateInstances and EnumerateInstanceNames
+ are both mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstances to be generated.
+ The properties of the model are already filtered according to
+ the PropertyList from the request. Only properties present in
+ the model need to be given values. If you prefer, you can
+ always set all of the values, and the instance will be filtered
+ for you.
+ cim_class -- The pywbem.CIMClass
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ Possible Errors:
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.enum_instances()' \
+ % self.__class__.__name__)
+
+ #while true: # TODO more instances?
+ # TODO fetch system resource
+ # Key properties
+ model['InstanceID'] = 'OMC:AccountCapability'
+ if keys_only:
+ yield model
+ else:
+ try:
+ yield self.get_instance(env, model, cim_class)
+ except pywbem.CIMError, (num, msg):
+ if num not in (pywbem.CIM_ERR_NOT_FOUND,
+ pywbem.CIM_ERR_ACCESS_DENIED):
+ raise
+
+ def set_instance(self, env, instance, previous_instance, cim_class):
+ """Return a newly created or modified instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance -- The new pywbem.CIMInstance. If modifying an existing
+ instance, the properties on this instance have been filtered by
+ the PropertyList from the request.
+ previous_instance -- The previous pywbem.CIMInstance if modifying
+ an existing instance. None if creating a new instance.
+ cim_class -- The pywbem.CIMClass
+
+ Return the new instance. The keys must be set on the new instance.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
+ valid if previous_instance is None, indicating that the operation
+ was CreateInstance)
+ CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
+ if previous_instance is not None, indicating that the operation
+ was ModifyInstance)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ #logger = env.get_logger()
+ #logger.log_debug('Entering %s.set_instance()' \
+ # % self.__class__.__name__)
+ # TODO create or modify the instance
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+ #return instance
+
+ def delete_instance(self, env, instance_name):
+ """Delete an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance_name -- A pywbem.CIMInstanceName specifying the instance
+ to delete.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
+ namespace)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ #logger = env.get_logger()
+ #logger.log_debug('Entering %s.delete_instance()' \
+ # % self.__class__.__name__)
+
+ # TODO delete the resource
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+
+ def cim_method_creategoalsettings(self, env, object_name, method,
+ param_supportedgoalsettings,
+ param_templategoalsettings):
+ """Implements OMC_AccountManagementCapabilities.CreateGoalSettings()
+
+ Method to create a set of supported SettingData elements, from two
+ sets of SettingData elements, provided by the caller. CreateGoal
+ should be used when the SettingData instances that represents the
+ goal will not persist beyond the execution of the client and where
+ those instances are not intended to be shared with other,
+ non-cooperating clients. Both TemplateGoalSettings and
+ SupportedGoalSettings are represented as strings containing
+ EmbeddedInstances of a CIM_SettingData subclass. These embedded
+ instances do not exist in the infrastructure supporting this
+ method but are maintained by the caller/client. This method
+ should return CIM_Error(s) representing that a single named
+ property of a setting (or other) parameter (either reference or
+ embedded object) has an invalid value or that an invalid
+ combination of named properties of a setting (or other) parameter
+ (either reference or embedded object) has been requested. If the
+ input TemplateGoalSettings is NULL or the empty string, this
+ method returns a default SettingData element that is supported by
+ this Capabilities element. If the TemplateGoalSettings specifies
+ values that cannot be supported, this method shall return an
+ appropriate CIM_Error and should return a best match for a
+ SupportedGoalSettings. The client proposes a goal using the
+ TemplateGoalSettings parameter and gets back Success if the
+ TemplateGoalSettings is exactly supportable. It gets back
+ "Alternative Proposed" if the output SupportedGoalSettings
+ represents a supported alternative. This alternative should be a
+ best match, as defined by the implementation. If the
+ implementation is conformant to a RegisteredProfile, then that
+ profile may specify the algorithms used to determine best match. A
+ client may compare the returned value of each property against the
+ requested value to determine if it is left unchanged, degraded or
+ upgraded. Otherwise, if the TemplateGoalSettings is not
+ applicable an "Invalid Parameter" error is returned. When a
+ mutually acceptable SupportedGoalSettings has been achieved, the
+ client may use the contained SettingData instances as input to
+ methods for creating a new object ormodifying an existing object.
+ Also the embedded SettingData instances returned in the
+ SupportedGoalSettings may be instantiated via CreateInstance,
+ either by a client or as a side-effect of the execution of an
+ extrinsic method for which the returned SupportedGoalSettings is
+ passed as an embedded instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName
+ specifying the object on which the method CreateGoalSettings()
+ should be invoked.
+ method -- A pywbem.CIMMethod representing the method meta-data
+ param_supportedgoalsettings -- The input parameter SupportedGoalSettings (type pywbem.CIMInstance(classname='CIM_SettingData', ...))
+ SupportedGoalSettings are elements of class CIM_SettingData, or
+ a derived class. At most, one instance of each SettingData
+ subclass may be supplied. All SettingData instances provided
+ by this property are interpreted as a set, relative to this
+ Capabilities instance. To enable a client to provide
+ additional information towards achieving the
+ TemplateGoalSettings, an input set of SettingData instances
+ may be provided. If not provided, this property shall be set
+ to NULL on input.. Note that when provided, what property
+ values are changed, and how, is implementation dependent and
+ may be the subject of other standards. If provided, the input
+ SettingData instances must be ones that the implementation is
+ able to support relative to the ManagedElement associated via
+ ElementCapabilities. Typically, the input SettingData
+ instances are created by a previous instantiation of
+ CreateGoalSettings. If the input SupportedGoalSettings is not
+ supported by the implementation, then an "Invalid Parameter"
+ (5) error is returned by this call. In this case, a
+ corresponding CIM_ERROR should also be returned. On output,
+ this property is used to return the best supported match to
+ the TemplateGoalSettings. If the output SupportedGoalSettings
+ matches the input SupportedGoalSettings, then the
+ implementation is unable to improve further towards meeting
+ the TemplateGoalSettings.
+
+ param_templategoalsettings -- The input parameter TemplateGoalSettings (type pywbem.CIMInstance(classname='CIM_SettingData', ...))
+ If provided, TemplateGoalSettings are elements of class
+ CIM_SettingData, or a derived class, that is used as the
+ template to be matched. . At most, one instance of each
+ SettingData subclass may be supplied. All SettingData
+ instances provided by this property are interpreted as a set,
+ relative to this Capabilities instance. SettingData instances
+ that are not relevant to this instance are ignored. If not
+ provided, it shall be set to NULL. In that case, a SettingData
+ instance representing the default settings of the associated
+ ManagedElement is used.
+
+
+ Returns a two-tuple containing the return value (type pywbem.Uint16 self.Values.CreateGoalSettings)
+ and a dictionary with the out-parameters
+
+ Output parameters:
+ SupportedGoalSettings -- (type pywbem.CIMInstance(classname='CIM_SettingData', ...))
+ SupportedGoalSettings are elements of class CIM_SettingData, or
+ a derived class. At most, one instance of each SettingData
+ subclass may be supplied. All SettingData instances provided
+ by this property are interpreted as a set, relative to this
+ Capabilities instance. To enable a client to provide
+ additional information towards achieving the
+ TemplateGoalSettings, an input set of SettingData instances
+ may be provided. If not provided, this property shall be set
+ to NULL on input.. Note that when provided, what property
+ values are changed, and how, is implementation dependent and
+ may be the subject of other standards. If provided, the input
+ SettingData instances must be ones that the implementation is
+ able to support relative to the ManagedElement associated via
+ ElementCapabilities. Typically, the input SettingData
+ instances are created by a previous instantiation of
+ CreateGoalSettings. If the input SupportedGoalSettings is not
+ supported by the implementation, then an "Invalid Parameter"
+ (5) error is returned by this call. In this case, a
+ corresponding CIM_ERROR should also be returned. On output,
+ this property is used to return the best supported match to
+ the TemplateGoalSettings. If the output SupportedGoalSettings
+ matches the input SupportedGoalSettings, then the
+ implementation is unable to improve further towards meeting
+ the TemplateGoalSettings.
+
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate,
+ unrecognized or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the target CIM Class or instance does not
+ exist in the specified namespace)
+ CIM_ERR_METHOD_NOT_AVAILABLE (the CIM Server is unable to honor
+ the invocation request)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.cim_method_creategoalsettings()' \
+ % self.__class__.__name__)
+
+ # TODO do something
+ raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented
+ out_params = {}
+ #out_params['supportedgoalsettings'] = # TODO (type pywbem.CIMInstance(classname='CIM_SettingData', ...))
+ rval = None # TODO (type pywbem.Uint16 self.Values.CreateGoalSettings)
+ return (rval, out_params)
+
+ class Values(object):
+ class RequestedStatesSupported(object):
+ Enabled = pywbem.Uint16(2)
+ Disabled = pywbem.Uint16(3)
+ Shut_Down = pywbem.Uint16(4)
+ Offline = pywbem.Uint16(6)
+ Test = pywbem.Uint16(7)
+ Defer = pywbem.Uint16(8)
+ Quiesce = pywbem.Uint16(9)
+ Reboot = pywbem.Uint16(10)
+ Reset = pywbem.Uint16(11)
+
+ class CreateGoalSettings(object):
+ Success = pywbem.Uint16(0)
+ Not_Supported = pywbem.Uint16(1)
+ Unknown = pywbem.Uint16(2)
+ Timeout = pywbem.Uint16(3)
+ Failed = pywbem.Uint16(4)
+ Invalid_Parameter = pywbem.Uint16(5)
+ Alternative_Proposed = pywbem.Uint16(6)
+ # DMTF_Reserved = ..
+ # Vendor_Specific = 32768..65535
+
+ class OperationsSupported(object):
+ Create = pywbem.Uint16(2)
+ Modify = pywbem.Uint16(3)
+ Delete = pywbem.Uint16(4)
+ # DMTF_Reserved = ..
+ # Vendor_Reserved = 0x8000..0xFFFF
+
+## end of class OMC_AccountManagementCapabilitiesProvider
+
+def get_providers(env):
+ omc_accountmanagementcapabilities_prov = OMC_AccountManagementCapabilitiesProvider(env)
+ return {'OMC_AccountManagementCapabilities': omc_accountmanagementcapabilities_prov}
Property changes on: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py
___________________________________________________________________
Name: svn:executable
+ *
Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg
===================================================================
--- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg (rev 0)
+++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg 2007-09-10 16:38:45 UTC (rev 488)
@@ -0,0 +1,9 @@
+// Provider registration for OMC_AccountManagementCapabilities
+instance of OpenWBEM_PyProviderRegistration
+{
+ InstanceID = "OMC:OMC_AccountManagementCapabilities:01";
+ NamespaceNames = {"root/cimv2"};
+ ClassName = "OMC_AccountManagementCapabilities";
+ P...
[truncated message content] |