| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
CIMProvider2
Base class for CIM Providers.
A derived class might normally override the following:
- enum_instances
- get_instance
- set_instance
- delete_instance
- references
If the provider is a "read-only" instance provider, set_instance and
delete_instance need not be overridden.
Only association providers need to override references.
A method provider should implement a method of the form:
def cim_method_<method_name>(self, env, object_name, method,
param_<input_param_1>,
param_<input_param_2>,
...):
Where <method_name> is the name of the method from the CIM schema.
<method_name> needs to be all lowercase, regardless of the case of
the method name in the CIM schema (CIM method names are case
insensitive).
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
object_name -- A pywbem.CIMInstanceName or pywbem.CIMClassname
specifying the object on which the method is to be invoked.
method -- A pywbem.CIMMethod, representing the method to execute.
param_<param_name> -- Corresponds to the input parameter <param_name>
from the CIM schema. <param_name> needs to be all lowercase,
regardless of the case of the parameter name in the CIM schema
(CIM parameter names are case insensitive).
The method returns a two-tuple containing the return value of the
method, and a dictionary containing the output parameters.
Example:
def cim_method_requeststatechange(self, env, object_name, method,
param_requestedstate,
param_timeoutperiod):
# do stuff.
out_params = {'job': pywbem.CIMInstanceName(...)}
rval = pywbem.Uint32(0)
return (rval, out_params)
The methods prefixed with "MI_" correspond to the WBEM operations
from http://www.dmtf.org/standards/published_documents/DSP200.html
The default implementations of these methods call the methods
described above. These will not normally be overridden or extended
by a subclass.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
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.
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)
|
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.
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)
|
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.
modify_existing -- True if ModifyInstance, False if CreateInstance
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 modify_existing is False, indicating that the operation
was CreateInstance)
CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
if modify_existing is True, indicating that the operation
was ModifyInstance)
CIM_ERR_FAILED (some other unspecified error occurred)
|
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)
|
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.
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] model.classname | |
| 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)
|
Return instance names of a given CIM class Implements the WBEM operation EnumerateInstanceNames in terms of the enum_instances method. A derived class will not normally override this method. |
Return instances of a given CIM class Implements the WBEM operation EnumerateInstances in terms of the enum_instances method. A derived class will not normally override this method. |
Return a specific CIM instance Implements the WBEM operation GetInstance in terms of the get_instance method. A derived class will not normally override this method. |
Create a CIM instance, and return its instance name Implements the WBEM operation CreateInstance in terms of the set_instance method. A derived class will not normally override this method. |
Modify a CIM instance Implements the WBEM operation ModifyInstance in terms of the set_instance method. A derived class will not normally override this method. |
Delete a CIM instance Implements the WBEM operation DeleteInstance in terms of the delete_instance method. A derived class will not normally override this method. |
Return instances associated to a given object. Implements the WBEM operation Associators in terms of the references method. A derived class will not normally override this method. |
Return instances names associated to a given object. Implements the WBEM operation AssociatorNames in terms of the references method. A derived class will not normally override this method. |
Return instances of an association class. Implements the WBEM operation References in terms of the references method. A derived class will not normally override this method. |
Return instance names of an association class. Implements the WBEM operation ReferenceNames in terms of the references method. A derived class will not normally override this method. |
Invoke an extrinsic method.
Implements the InvokeMethod WBEM operation by calling the
method on a derived class called cim_method_<method_name>,
where <method_name> is the name of the CIM method, in all
lower case.
Arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
objectName -- The InstanceName or ClassName of the object on
which the method is invoked.
methodName -- The name of the method to be invoked.
inputParams -- A Dictionary where the key is the parameter name
and the value is the parameter value.
The return value for invokeMethod must be a tuple of size 2
where:
element 0 is a tuple of size 2 where element 0 is the return
data type name and element 1 is the actual data value.
element 1 is a dictionary where the key is the output
parameter name and the value is a tuple of size 2 where
element 0 is the data type name for the output parameter
and element 1 is the actual value of the output parameter.
A derived class will not normally override this method.
|
Remove properties from an instance that aren't in the PropertyList
inst -- The CIMInstance
plist -- The property List, or None. The list items must be all
lowercase.
|
Allow or disallow an indication subscription request. Arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) filter -- The WQL select statement namespace -- The namepace where the indication is registered for classes -- The classpath of the indication registered for owner -- The name of the principal (cimom user) |
Activate an indication subscription. Arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) filter -- The WQL select statement namespace -- The namepace where the indication is registered for classes -- The classpath of the indication registered for first_activation -- boolean - whether first activation |
Deactivate an indication subscription. Arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) filter -- The WQL select statement ns -- The namepace where the indication is registered for classes -- The classpath of the indication registered for last_activation -- boolean - whether last activation |
Enable indications. Arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) |
Disable indications. Arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Jan 23 01:23:06 2015 | http://epydoc.sourceforge.net |