Package pywbem :: Module cim_obj :: Class CIMProperty
[frames] | no frames]

Class CIMProperty

source code

                   object --+    
                            |    
cim_types._CIMComparisonMixin --+
                                |
                               CIMProperty

Defines a CIM property including cim type, value, and possibly qualifiers.

The property can be used in a CIM instance (as part of a CIMInstance object) or in a CIM class (as part of a CIMClass object).

For properties in CIM instances:

For properties in CIM classes:

Scalar (=non-array) properties may have a value of NULL (= None), any primitive CIM type, reference type, and string type with embedded instance or embedded object.

Array properties may be Null or may have elements with a value of NULL, any primitive CIM type, and string type with embedded instance or embedded object. Reference types are not allowed in property arrays in CIM, as per DMTF DSP0004.

Instance Methods
 
__init__(self, name, value, type=None, class_origin=None, array_size=None, propagated=None, is_array=None, reference_class=None, qualifiers=None, embedded_object=None)
Initialize the CIMProperty object.
source code
 
copy(self)
Return a copy of the CIMProperty object
source code
 
__repr__(self)
Return a string repesenting the CIMProperty in name=value form for each attribute of the CIMProperty
source code
 
tocimxml(self)
Return the string with CIM/XML form of the CIMProperty object using the representation defined in DSP0200
source code

Inherited from cim_types._CIMComparisonMixin: __eq__, __ge__, __gt__, __le__, __lt__, __ne__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables
  ...
All parameters of __init__ are set as instance variables.
Properties

Inherited from object: __class__

Method Details

__init__(self, name, value, type=None, class_origin=None, array_size=None, propagated=None, is_array=None, reference_class=None, qualifiers=None, embedded_object=None)
(Constructor)

source code 

Initialize the CIMProperty object.

This function infers optional arguments that are not specified (for example, it infers type from the Python type of value and other information). If the specified arguments are inconsistent, an exception is raised. If an optional argument is needed for some reason, an exception is raised.

Examples:

Parameters:
  • name (Unicode string or UTF-8 encoded byte string) - Name of the property. Must not be None.
  • value - Value of the property (interpreted as actual value when the property object is used in an instance, and as default value when it is used in a class). For valid types for CIM values, see cim_types.
  • type (Unicode string or UTF-8 encoded byte string) - Name of the CIM type of the property (e.g. 'uint8'). None means that the argument is unspecified, causing the corresponding instance variable to be inferred. An exception is raised if it cannot be inferred.
  • class_origin (Unicode string or UTF-8 encoded byte string) - The CIM class origin of the property (the name of the most derived class that defines or overrides the property in the class hierarchy of the class owning the property). None means that class origin information is not available.
  • array_size (int) - The size of the array property, for fixed-size arrays. None means that the array property has variable size.
  • propagated (Unicode string or UTF-8 encoded byte string) - The CIM propagated attribute of the property (the effective value of the Propagated qualifier of the property, which is a string that specifies the name of the source property from which the property value should be propagated). None means that propagation information is not available.
  • is_array (bool) - A boolean indicating whether the property is an array (True) or a scalar (False). None means that the argument is unspecified, causing the corresponding instance variable to be inferred from the value parameter, and if that is None it defaults to False (scalar).
  • reference_class (Unicode string or UTF-8 encoded byte string) - The name of the referenced class, for reference properties. None means that the argument is unspecified, causing the corresponding instance variable to be inferred. An exception is raised if it cannot be inferred.
  • qualifiers (dict or NocaseDict) - A dictionary specifying CIM qualifier values. The dictionary keys must be the qualifier names. The dictionary values must be CIMQualifier objects specifying the qualifier values. None means that there are no qualifier values. In all cases, the qualifiers instance variable will be a NocaseDict object.
  • embedded_object (Unicode string or UTF-8 encoded byte string) - A string value indicating the kind of embedded object represented by the property value. The following values are defined for this argument: 'instance': The property is declared with the EmbeddedInstance qualifier, indicating that the property value is an embedded instance of a known class name (or Null). 'object': The property is declared with the EmbeddedObject qualifier, indicating that the property value is an embedded object (instance or class) of which the class name is not known (or Null). None means that the argument is unspecified, causing the corresponding instance variable to be inferred. An exception is raised if it cannot be inferred.
Raises:
  • TypeError
  • ValueError
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
Return a string repesenting the CIMProperty in name=value form for each attribute of the CIMProperty
Overrides: object.__repr__